Commit graph

3584 commits

Author SHA1 Message Date
Andreas Kling 560d037c41 AK: Make it more more pleasant to copy RefPtr's.
I had a silly ambition that we would avoid unnecessary ref count churn by
forcing explicit use of "copy_ref()" wherever a copy was actually needed.
This was making RefPtr a bit clunky to work with, for no real benefit.

This patch adds the missing copy construction/assignment stuff to RefPtr.
2019-07-11 15:38:38 +02:00
Andreas Kling 32fb7ecef4 AK: Remove weird RefPtr(RefPtr&) constructor. 2019-07-11 15:19:16 +02:00
Andreas Kling 3d9f783e31 AK: Make MappedFile non-copyable. 2019-07-11 15:14:30 +02:00
Andreas Kling 6534f5f083 AK: Remove weird NonnullRefPtr(NonnullRefPtr&) constructor. 2019-07-11 14:28:29 +02:00
Robin Burchell bee39d8524 AK: Use operator== for comparison in Vector::contains_slow 2019-07-11 14:17:37 +02:00
Robin Burchell 2c4af740c7 AK: Add operator== & operator!= to Vector 2019-07-11 14:17:37 +02:00
Lawrence Manning c3ecf753b2 AKString: add missing comparison operators
And some trivial tests.
2019-07-11 14:13:30 +02:00
Andreas Kling c452aa891f AK: Add Platform.h with an ARCH() macro.
You can currently use this to detect the CPU architecture like so:

    #if ARCH(I386)
        ...
    #elif ARCH(X86_64)
        ...
    #else
        ...
    #endif

This will be helpful for separating out architecture-specific code blocks.
2019-07-09 15:48:04 +02:00
Andreas Kling eca5c2bdf8 Kernel: Move VirtualAddress.h into VM/ 2019-07-09 15:04:45 +02:00
Andreas Kling c110cf193d Kernel: Have the open() syscall take an explicit path length parameter.
Instead of computing the path length inside the syscall handler, let the
caller do that work. This allows us to implement to new variants of open()
and creat(), called open_with_path_length() and creat_with_path_length().
These are suitable for use with e.g StringView.
2019-07-08 20:01:49 +02:00
Andreas Kling 2caec95d30 StringBuilder: Reset the internal builder length after building.
This puts the StringBuilder back into a pristine state, allowing you
to use it to build more strings after you've built one.
2019-07-08 15:57:25 +02:00
Andreas Kling 0e75aba7c3 StringView: Rename characters() to characters_without_null_termination().
This should make you think twice before trying to use the const char* from
a StringView as if it's a null-terminated string.
2019-07-08 15:38:44 +02:00
Andreas Kling 567551bc12 AK: Add some missing includes in SinglyLinkedList. 2019-07-08 14:06:22 +02:00
Andreas Kling 5b19911025 AK: Add JsonValue::to_bool(). 2019-07-08 14:06:03 +02:00
Andreas Kling c79b048198 MappedFile: Fix misuse of StringView::characters().
This makes me wonder if the open() syscall should take characters+length
and we'd compute the length at the LibC layer instead. That way we could
also provide an optional non-POSIX open() that takes the length directly..
2019-07-08 13:59:10 +02:00
Andreas Kling a8aadf73e9 AK: Add JsonObject::set(key, &&value) overload.
This dodges a whole bunch of value copying in JsonParser.
2019-07-08 13:08:21 +02:00
Andreas Kling 7bb1e465c6 AK: Make it easy to convert between JsonValue and IPv4Address.
They still use string storage, but this change makes it nice and easy to
work with IPv4 addresses in JSON data.
2019-07-08 13:03:55 +02:00
Andreas Kling d8f1a7e046 AK: Add LogStream operator<< for IPv4Address. 2019-07-08 11:43:42 +02:00
Andreas Kling dddcedfd11 AK: Add IPv4Address::from_string(StringView).
This attempts to parse an IPv4Address from a string, and gives us an excuse
to try out the new Optional<T> for the return value. :^)
2019-07-08 11:38:58 +02:00
Andreas Kling 7b2a4c02e7 AK: Add a simple Optional<T> template.
This can be used to store any type, with a flag that says if any value
is present or not.
2019-07-08 11:29:38 +02:00
Andreas Kling a0ee2bad72 String: String::to_int() should fail for any empty string, not just null. 2019-07-08 10:51:45 +02:00
Andreas Kling f9089da2bc LogStream: Uninline some public functions so the linker can find them. 2019-07-08 09:22:22 +02:00
Andreas Kling 55a5c46253 AK: Add Vector::insert_before_matching(T&&, callback);
This allows you to do things like:

vector.insert_before_matching(value, [](auto& entry) {
    return value < entry;
});

Basically it scans until it finds an element that matches the condition
callback and then inserts the new value before the matching element.
2019-07-04 14:20:48 +02:00
Andreas Kling 57da8792fd Vector: Simplify functions that take both T&& and const T&.
We can implement foo(const T&) by invoking foo(T&&) with a temporary T.
2019-07-04 13:54:37 +02:00
Andreas Kling 1b013ba699 AK: Move some of LogStream out of line & add overloads for smart pointers. 2019-07-04 07:05:58 +02:00
Andreas Kling 05cc59921a AK: Start fleshing out LogStream, a type-aware logging mechanism.
The first implementation class is DebugLogStream, which can be used like so:

    dbg() << "Hello friends, I am " << m_years << " years old!";

Note that it will automatically print a newline when the object created by
dbg() goes out of scope.

This API will grow and evolve, so let's see what we end up with :^)
2019-07-04 06:43:30 +02:00
Andreas Kling 27f699ef0c AK: Rename the common integer typedefs to make it obvious what they are.
These types can be picked up by including <AK/Types.h>:

* u8, u16, u32, u64 (unsigned)
* i8, i16, i32, i64 (signed)
2019-07-03 21:20:13 +02:00
Andreas Kling b79112e6d6 AK: Add String::number() for creating a String from a number.
Instead of manually doing String::format("%d"/"%u") everywhere, let's have
a String API for this. It's just a wrapper around format() for now, but it
could be made more efficient in the future.
2019-07-03 14:56:27 +02:00
Andreas Kling a190f67450 AK: Add u8/u16/u32/u64 and i8/i16/i32/i64 typedefs.
These are more explicit and will be immediately understandable unlike the
old types which assume that you're in an IA-32 headspace. :^)
2019-07-01 15:58:21 +02:00
VAN BOSSUYT Nicolas 802d4dcb6b Meta: Removed all gitignore in the source tree only keeping the root one 2019-06-30 10:41:26 +02:00
Andreas Kling 6e95b11395 AK: Allow HashMap to be used with non-default-constructible values.
Solve this by adding find() overloads to HashTable and SinglyLinkedList
that take a templated functor for comparing the values.

This allows HashMap to call HashTable::find() without having to create
a temporary Entry for use as the table key. :^)
2019-06-29 21:09:40 +02:00
Andreas Kling d5bb98acbc AK: Defer to Traits<T> for equality comparison in container templates.
This is prep work for supporting HashMap with NonnullRefPtr<T> as values.
It's currently not possible because many HashTable functions require being
able to default-construct the value type.
2019-06-29 19:14:03 +02:00
Andreas Kling 293946c960 JsonValue: Add is_bool() and various as_foo() helpers. 2019-06-29 12:07:46 +02:00
Andreas Kling 7f224ade60 JsonValue: No need to null-check StringImpls if type is Type::String.
If you try to create a JsonValue from a null String(), it will become a
null JsonValue anyway.
2019-06-29 12:07:46 +02:00
Andreas Kling 50677a58d4 StringView: Make it easy to construct from a ByteBuffer. 2019-06-29 12:07:46 +02:00
Andreas Kling 53479f9356 HashTable: Don't use move assignment in set(const T&). 2019-06-29 12:07:46 +02:00
Andreas Kling b1d113e32a AK: Make a tiny JSON unit test based on a saved VisualBuilder form. 2019-06-29 12:07:42 +02:00
Andreas Kling 2bd8118843 Kernel: Change the format of /proc/all to JSON.
Update ProcessManager, top and WSCPUMonitor to handle the new format.

Since the kernel is not allowed to use floating-point math, we now compile
the JSON classes in AK without JsonValue::Type::Double support.
To accomodate large unsigned ints, I added a JsonValue::Type::UnsignedInt.
2019-06-29 09:04:45 +02:00
Andreas Kling 3af59dfed1 AK: We can't use std::initializer_list in LibC builds.
The LibC build is a bit complicated, since the toolchain depends on it.
During the toolchain bootstrap, after we've built parts of GCC, we have
to stop and build Serenity's LibC, so that the rest of GCC can use it.

This means that during that specific LibC build, we don't yet have access
to things like std::initializer_list.

For now we solve this by defining SERENITY_LIBC_BUILD during the LibC
build and excluding the Vector/initializer_list support inside LibC.
2019-06-28 20:58:41 +02:00
Andreas Kling 4c285f9e1a AK: Add Vector(std::initializer_list<T>) constructor.
This allows us to construct a Vector from an initializer list like so:

Vector<Object> objects = { object1, object2, object3 };
2019-06-28 20:21:23 +02:00
Andreas Kling 2282e89d3f AK: Use a SinglyLinkedList<T> as HashTable's bucket chain storage.
We were using a DoublyLinkedList<T> simply because it supported remove().
This patch consolidates the SinglyLinkedList iterators and adds remove().
2019-06-27 16:36:31 +02:00
Andreas Kling 7f613c79cd AK: Oops, fix typo in RemoveVolatile<T> helper. 2019-06-27 16:01:24 +02:00
Andreas Kling 516d736afe AK: Consolidate iterators for HashTable and DoublyLinkedList respectively.
Get rid of the ConstIterator classes for these containers and use templated
FooIterator<T, ...> and FooIterator<const T, ...> helpers.

This makes the HashTable class a lot easier to read.
2019-06-27 15:57:49 +02:00
Andreas Kling 50700c107f AK: Get rid of ConstVectorIterator.
We can achieve the same with just a VectorIterator<const Vector, const T>.
2019-06-27 14:52:12 +02:00
Andreas Kling ebe108efa6 AK: Simplify HashMap a bit. 2019-06-27 14:27:26 +02:00
Andreas Kling 3bd47a2e09 AK: NonnullRefPtrVector should use Vector<T, inline_capacity> as its base.
We were forgetting to plumb through the inline capacity in the Base typedef.
2019-06-27 13:39:09 +02:00
Andreas Kling 9ab3718266 AK: Allow constructing an empty NonnullRefPtrVector. 2019-06-27 13:23:10 +02:00
Andreas Kling 48108ec474 AK: Support range-for iteration over a NonnullRefPtrVector<T>.
This means you can now do this:

void harmonize(NonnullRefPtrVector<Voice>& voices)
{
    for (auto& voice : voices) {
        voice.sing(); // Look, no "->"!
    }
}

Pretty dang cool :^)
2019-06-27 12:11:58 +02:00
Andreas Kling 25a1bf0c90 AK: Add NonnullRefPtrVector<T>.
This is a slot-in convenience replacement for Vector<NonnullRefPtr<T>> that
makes accessors return T& instead of NonnullRefPtr<T>&.
Since NonnullRefPtr guarantees non-nullness, this allows you to access these
vector elements using dot (.) rather than arrow (->). :^)
2019-06-27 12:04:27 +02:00
Andreas Kling f83263a72b Kernel: Use a raw VM region for sorting ELF symbols instead of a Vector.
This avoids putting pressure on kmalloc() during backtrace symbolication.
Since we dump backtrace for every process that exits, this is actually a
decent performance improvement for things like GCC that chain a lot of
processes together.
2019-06-27 10:49:49 +02:00
Andreas Kling eb129bd730 AK: Use __builtin_bswap() in NetworkOrdered. 2019-06-26 20:01:48 +02:00
Andreas Kling a2e5b821b4 AK: Simplify NetworkOrdered somewhat. 2019-06-26 16:26:59 +02:00
Andreas Kling e9b619c4aa JsonParser: Support basic escaped string characters.
I didn't implement \uXXXX-style escape in this patch. That's a FIXME.
2019-06-25 16:58:30 +02:00
Andreas Kling 583606a2b1 StringImpl: Fix possible uninitialized access in StringImpl::create().
If the provided length is 0, there's no need to dereference the const char*.
2019-06-24 14:38:44 +02:00
Andreas Kling 643a43f278 AK: Add JsonValue::to_string(default_value = {}). 2019-06-24 14:25:45 +02:00
Andreas Kling 266fed8c00 AK: Let's put the JSON parsing in a separate class. 2019-06-24 13:39:45 +02:00
Andreas Kling 8392c549a3 JsonValue: Add as_array() and as_object(). 2019-06-24 12:03:31 +02:00
Andreas Kling dd36f797d5 JsonObject: Let the compiler generate a copy constructor.
This was only needed while HashMap was noncopyable. :^)
2019-06-24 12:03:11 +02:00
Andreas Kling 15003245cd JsonArray: Add for_each() helper. 2019-06-24 12:02:31 +02:00
Andreas Kling 2c1c4ab116 AK: Make it possible to move and copy HashMap and HashTable.
Previously it was only possible to move them, but we should allow copying
as well, since it's gonna be useful for many things.
2019-06-24 11:57:54 +02:00
Andreas Kling 009b9bfd10 AK: Implement a naive JSON parser.
This parser assumes that the JSON is well-formed and will choke horribly
on invalid input.

Since we're primarily interested in parsing our own output right now, this
is less of a problem. Longer-term we're gonna need something better. :^)
2019-06-24 11:28:24 +02:00
Andreas Kling bad8ab697b NonnullRefPtr: Simplify copy constructors. 2019-06-24 10:23:59 +02:00
Andreas Kling 2dd54f062a AK: Mark some helper things constexpr. 2019-06-24 10:13:28 +02:00
Andreas Kling bf97b9589d NonnullRefPtr: Some improvements.
- Delete the default constructor instead of just making it private.
  It's never valid to create an empty NonnullRefPtr.

- Add copy assignment operators. I originally omitted these to force use
  of .copy_ref() at call sites, but the hassle/gain ratio is minuscule.

- Allow calling all the assignment operators in all consumable states.
  This codifies that it's okay to overwrite a moved-from NonnullRefPtr.
2019-06-24 09:58:21 +02:00
Andreas Kling 7e1cb86da7 LibHTML: Make it possible to build LibHTML on the host.
- "make" builds the normal Serenity libhtml.a
- "make -f Makefile.host" builds a test program for the host machine.
2019-06-22 21:21:57 +02:00
Andreas Kling 3ed17b0792 printf: Support %zu (the 'z' is really just ignored.) 2019-06-22 16:30:32 +02:00
Andreas Kling 1277d583ef printf: Oops, '-' is the left padding modifier, not ' '.
It's kinda funny how I can make a mistake like this in Serenity and then
get so used to it by spending lots of time using this API that I start to
believe that this is how printf() always worked..
2019-06-22 15:53:52 +02:00
Andreas Kling d343fb2429 AK: Rename Retainable.h => RefCounted.h. 2019-06-21 18:58:45 +02:00
Andreas Kling 550b0b062b AK: Rename RetainPtr.h => RefPtr.h, Retained.h => NonnullRefPtr.h. 2019-06-21 18:45:59 +02:00
Andreas Kling c26e3ce86b Change "retain" to "ref" in various comments. 2019-06-21 18:40:24 +02:00
Andreas Kling 90b1354688 AK: Rename RetainPtr => RefPtr and Retained => NonnullRefPtr. 2019-06-21 18:37:47 +02:00
Andreas Kling 77b9fa89dd AK: Rename Retainable => RefCounted.
(And various related renames that go along with it.)
2019-06-21 15:30:03 +02:00
Andreas Kling a7dc1a7d6b AK: Make StringImpl a bit smaller.
There's no need for a member char* m_characters if we always store them
in the inline buffer. So with this patch, we now do.
After that, rearrange the members a bit for ideal packing. :^)
2019-06-20 13:23:48 +02:00
Andreas Kling 8c0ae711d8 Kernel+LibC: Make page fault crashes a bit more readable.
We'll now try to detect crashes that were due to dereferencing nullptr,
uninitialized malloc() memory, or recently free()'d memory.
It's not perfect but I think it's pretty good. :^)

Also added some color to the most important parts of the crash log,
and added some more modes to /bin/crash for exercising this code.

Fixes #243.
2019-06-19 20:52:12 +02:00
Andreas Kling c5d623e048 AK: Add some convenient functions to JsonValue. 2019-06-19 13:08:07 +02:00
Andreas Kling 9149a519f5 printf: Support printing negative values with %f or %g. 2019-06-18 14:47:52 +02:00
Andreas Kling 203f8e5320 AK: Add IPv4Address(NetworkOrdered<dword>) constructor. 2019-06-18 11:40:39 +02:00
Andreas Kling d9a48b5916 AK: Move IPv4Address from Kernel/Net/ to AK/ since it's quite useful. 2019-06-18 11:28:48 +02:00
Andreas Kling 9f7c11710f printf: Treat %g as %f for now. 2019-06-18 09:46:39 +02:00
Andreas Kling aa3df518e7 AK: Rename JsonObject::to_string() and pals to serialized().
And the variant that serializes into a StringBuilder is called serialize().
2019-06-18 09:37:47 +02:00
Andreas Kling 15fa4f1c55 AK: ScopeGuard.h needs StdLibExtras.h 2019-06-18 09:31:14 +02:00
Andreas Kling 4ee39d6292 AK: Override StringImpl's operator delete to silence valgrind. 2019-06-18 09:26:36 +02:00
Andreas Kling 92cda74724 AK: Fix leak in JsonValue::operator=(JsonValue&&).
Amusingly I introduced this leak while explaining that this type of leak is
a common bug, and saying I'm used to looking for it. :^)
2019-06-18 09:22:19 +02:00
Andreas Kling 4147394dcb AK: Add JsonValue(const char*).
This should obviously become a string, but if we don't have it, constructing
from a string literal ends up creating a boolean value.
2019-06-18 09:11:31 +02:00
Andreas Kling 1a761ea4fd AK: Add JsonValue(unsigned) ctor and as_string(). 2019-06-18 08:55:58 +02:00
Andreas Kling 114768562a AK: Including <AK/kstdio.h> should pull in <stdio.h> etc on host builds. 2019-06-18 08:53:26 +02:00
Andreas Kling 28a4963242 AK: Make ASSERT_NOT_REACHED() work nicely in host builds. 2019-06-18 08:52:21 +02:00
Andreas Kling ee347effac AK: Use a single StringBuilder throughout JSON serialization. 2019-06-17 21:36:54 +02:00
Andreas Kling 04a8fc9bd7 AK: Add some classes for JSON encoding.
This patch adds JsonValue, JsonObject and JsonArray. You can use them to
build up a JsonObject and then serialize it to a string via to_string().

This patch only implements encoding, no decoding yet.
2019-06-17 19:47:35 +02:00
Andreas Kling 01d1aee922 AK: Make RetainPtr and Retained more friendly towards const pointers.
Also add operator T&'s to Retained since it's nice to be able to pass them
to a function that takes a T&.
2019-06-15 18:45:44 +02:00
Andreas Kling bfaa74f076 AK/Tests: Test Queue<String> with large number of elements. 2019-06-15 10:39:19 +02:00
Andreas Kling c699d9d79d AK: Add a simple Queue<T> class.
The underlying data structure is a singly-linked list of Vector<T>.
We never shift any of the vector contents around, but we batch the memory
allocations into 1000-element segments.
2019-06-15 10:35:35 +02:00
Andreas Kling 9443957c14 PaintBrush: Speed up the bucket tool with smarter use of Vector.
Put together a pretty well-performing queue using a Vector and an offset.
By using the new Vector::shift_left(int) instead of Vector::take_first()
we can avoid shifting the vector contents every time and instead only
do it every so often.

Maybe this could be generalized into a separate class, I'm not sure if it's
the best algorithm though, it's just what I came up with right now. :^)
2019-06-14 21:50:28 +02:00
Andreas Kling a12751695e AK/Tests: Add a simple EXPECT_EQ macro and use it for the String test. 2019-06-14 17:52:51 +02:00
Andreas Kling 3557f277f6 AK/Tests: Add some macros for testing. 2019-06-14 17:38:17 +02:00
Andreas Kling 0589ef2886 AK/Tests: Add a couple more String tests. 2019-06-14 07:40:36 +02:00
Andreas Kling 255c7562ba AK: Massage it into building on my host system without breaking Serenity. 2019-06-14 06:43:56 +02:00
Andreas Kling b7cca76ca2 AK: Add an extremely primitive unit test for String.
This builds for the host system rather than for Serenity.
We need to improve on it a *lot*, but at least it's a place to start.
2019-06-14 06:42:21 +02:00
Sergey Bugaev 1a697f70db AK: Add more StringView utilities for making substrings.
These two allow making a new substring view starting from,
or starting after, an existing substring view.

Also make use of one of them in the kernel.
2019-06-14 06:24:02 +02:00
Sergey Bugaev 3e326de8fa AK: Fix nullptr dereference in String::matches().
In case cp and mp were never set, we should not try
to use them.
2019-06-14 06:24:02 +02:00
Sergey Bugaev e585ed48b0 AK: Fix String::matches() with non-null-terminated StringViews.
StringView character buffer is not guaranteed to be null-terminated;
in particular it will not be null-terminated when making a substring.
This means it is not correct to check whether we've reached the end
of a StringView by comparing the next character to null; instead, we
need to do an explicit length (or pointer) comparison.
2019-06-14 06:24:02 +02:00
Conrad Pankoff f7dce4765c AK: Add find_first_{set,unset} and grow methods to Bitmap 2019-06-12 15:38:17 +02:00
Andreas Kling e673bb921e AK: Delete the Badge copy and move constructors. 2019-06-11 23:47:51 -07:00
Andreas Kling cdb44be703 StringView: Store a StringImpl* rather than a String*. 2019-06-08 23:55:13 +02:00
Andreas Kling 6a51093ab1 AK: Add String::operator==(const char*).
Without this function, comparing a String to a const char* will instantiate
a temporary String which is obviously not great.

Also add some missing null checks to StringView::operator==(const char*).
2019-06-08 18:32:09 +02:00
Andreas Kling de65c960e9 Kernel: Tweak some String&& => const String&.
String&& is just not very practical. Also return const String& when the
returned string is a member variable. The call site is free to make a copy
if he wants, but otherwise we can avoid the retain count churn.
2019-06-07 20:58:12 +02:00
Andreas Kling de9edb0169 StringView: operator==(const char*) needs to stop when the view ends.
We were comparing past the end of the view, which was clearly not correct.
2019-06-07 19:22:58 +02:00
Andreas Kling a0bde822ee AK: Add IterationDecision.h. 2019-06-07 17:14:16 +02:00
Andreas Kling 39d1a9ae66 Meta: Tweak .clang-format to not wrap braces after enums. 2019-06-07 17:13:23 +02:00
Andreas Kling 9145917bf0 ELF: Run clang-format on everything. 2019-06-07 17:12:30 +02:00
Andreas Kling e42c3b4fd7 Kernel: Rename LinearAddress => VirtualAddress. 2019-06-07 12:56:50 +02:00
Andreas Kling b34b084619 AK: Run clang-format on everything. 2019-06-07 11:46:22 +02:00
Andreas Kling 7ad8790d80 LibGUI: Run clang-format on everything. 2019-06-07 11:46:02 +02:00
Andreas Kling 98eeb8f22d AK: Rename printf.cpp to PrintfImplementation.h. 2019-06-07 11:41:11 +02:00
Andreas Kling 69a6ce90df AK: Add a ScopeGuard helper that invokes a callback when destroyed.
This is useful when you want to ensure some little thing happens when you
exit a certain scope.

This patch makes use of it in LibC's netdb code to make sure we close the
connection to the LookupServer.
2019-06-07 09:19:15 +02:00
Andreas Kling 29a9430246 AK: Make timeval_add() and timeval_sub() take references. 2019-06-06 18:02:28 +02:00
Conrad Pankoff 419e886497 AK: Add String::starts_with to match String::ends_with 2019-06-04 04:58:35 -07:00
Conrad Pankoff 042895317d AK: Add AKString::split_limit to split strings with a limit
This is a small change to the existing split() functionality to support
the case of splitting a string and stopping at a certain number of
tokens. This is useful for parsing e.g. key/value pairs, where the value
may contain the delimiter you're splitting on.
2019-06-04 10:16:45 +02:00
Andreas Kling ccc6e69a29 LibC: Implement popen() and pclose().
I feel reasonably confident that I might have gotten these right. :^)
2019-06-03 21:17:58 +02:00
Robin Burchell 1024dfa81a StringViewize a bunch of things -- mostly LibGUI 2019-06-03 20:27:05 +02:00
Robin Burchell f9ba7adae2 StringView: Make construction of String from a StringView containing a String cheaper
... at the cost of an additional pointer per view.
2019-06-03 20:27:05 +02:00
Robin Burchell 7bce096afd Take StringView in more places
We should work towards a pattern where we take StringView as function
arguments, and store String as member, to push the String construction
to the last possible moment.
2019-06-02 12:55:51 +02:00
Robin Burchell b55b6cd7fc AK: Add implicit String -> StringView conversion
And tidy up existing view() users.
2019-06-02 12:55:51 +02:00
Andreas Kling e24f18dd83 AK: Add a comment to String about the relationship with StringImpl. 2019-06-02 08:37:01 +02:00
Andreas Kling b8e705da0e LibCore: CObjects without is<T> specialization shouldn't LARP as others. 2019-06-01 14:11:31 +02:00
Christopher Dumas 6a4cb25557 Terminal: Settings windows can be opened multiple times 2019-06-01 00:07:45 +02:00
Christopher Dumas f8a02d4733 Terminal: Audible vs Visible beep option 2019-06-01 00:07:45 +02:00
Andreas Kling 3a1d5fa112 ELFLoader: Fix typo in segment naming.
Executable segments now get an "x" character in their region name.
2019-05-30 16:23:48 +02:00
Andreas Kling baaede1bf9 Kernel: Make the Process allocate_region* API's understand "int prot".
Instead of having to inspect 'prot' at every call site, make the Process
API's take care of that so we can just pass it through.
2019-05-30 16:14:37 +02:00
Andreas Kling 08926e59b3 Kernel: Add InodeFile, a File subclass for regular files.
Finally everything that can be held by a FileDescriptor actually inherits
from the File class.
2019-05-30 13:39:17 +02:00
Robin Burchell 0dc9af5f7e Add clang-format file
Also run it across the whole tree to get everything using the One True Style.
We don't yet run this in an automated fashion as it's a little slow, but
there is a snippet to do so in makeall.sh.
2019-05-28 17:31:20 +02:00
Andreas Kling cbd858544d LibC: Move struct timeval to sys/time.h. #POSIX 2019-05-28 13:48:06 +02:00
Robin Burchell 9947ee9566 Shell: Allow * and ? wildcard expansion in arguments
Should also presumably allow for escaping and such, but this is a start.
Fixes #112.
2019-05-28 00:17:39 +02:00
Andreas Kling 12120167a9 AK: Add ensure_capacity() for HashMap and HashTable.
These functions make sure that the underlying table can accomodate at least
'capacity' entries before needing a rehash.
2019-05-27 13:07:20 +02:00
Andreas Kling 5ba2dba392 FileSystemPath: Add a has_extension() helper.
This code:

    if (path.string().to_lowercase().ends_with(".foo"))

Can now be written as:

    if (path.has_extension(".foo"))
2019-05-27 01:53:42 +02:00
Faissal Bensefia 411cdf067b AK: Implement String::to_int (#99) 2019-05-26 04:08:36 +02:00
Robin Burchell 23a5ce3319 QuickSort: Don't sort a single item, nothing to do 2019-05-26 01:47:41 +02:00
Andreas Kling ad908f1395 WindowServer: Factor out compositing from WSWindowManager into WSCompositor.
This is far from finished and the two classes are awkwardly grabbing at each
other's innards, but here's a first step in the right direction.
2019-05-24 19:32:46 +02:00
Robin Burchell 6917c42140 Kernel/AK: Move ELF loader to AK
This is in preparation for eventually using it in userspace.
LinearAddress.h has not been moved for the time being (as it seems to be
only used by a very small part of the code).
2019-05-23 16:57:34 +02:00
Andreas Kling a8313ae0a3 AK: Always inline convert_between_host_and_network<T>. 2019-05-21 16:14:02 +02:00
Andreas Kling 52f135fe13 AK: Add some more features to Vector iterators. 2019-05-21 01:36:36 +02:00
Andreas Kling 6e305bf838 AK: Simplify quick_sort() and improve Vector iterators a bit. 2019-05-19 01:53:51 +02:00
Robin Burchell df74a9222f Kernel: Fix timeout support in select
The scheduler expects m_select_timeout to act as a deadline. That is, it
should contain the time that a task should wake at -- but we were
directly copying the time from userspace, which meant that it always
returned virtually immediately.

At the same time, fix CEventLoop to not rely on the broken select behavior
by subtracting the current time from the time of the nearest timer.
2019-05-18 02:57:38 +02:00
Robin Burchell 5babcac289 Build: Install most headers to Root (and libcore.a/libgui.a)
This makes out-of-tree linking possible. And at the same time, add a
CMakeToolchain.txt file that can be used to build arbitrary cmake-using
applications on Serenity by pointing to the CMAKE_TOOLCHAIN_FILE when
running cmake:

    -DCMAKE_TOOLCHAIN_FILE=~/code/serenity/Toolchain/CMakeToolchain.txt
2019-05-17 21:59:48 +02:00
Robin Burchell 77dfd419e9 LibCore: Move AK/ArgsParser to LibCore/CArgsParser
Also rename the classes to match LibCore naming style.
This means that it's no longer incorrectly linked into LibC and Kernel.
2019-05-17 15:49:37 +02:00
Robin Burchell bffed9e3cb ArgsParser: Expand to be able to handle multiple single arguments
This is needed for e.g. ln
2019-05-17 15:49:37 +02:00
Robin Burchell 6dd7ee53ea AK/Userland: Add single value to ArgsParser usage, and port tail to use ArgsParser 2019-05-17 15:49:37 +02:00
Robin Burchell c478503581 ArgsParser: Remove prefix from constructor
It makes sense to keep this consistent between applications, and the
purpose of the string is not immediately obvious from an API perspective.

If we need to make it configurable later, that can come from a setter.
2019-05-17 15:49:37 +02:00
Robin Burchell 729507f2bd ArgsParser: Remove boolean trap on add_arg
Rather than requiring a boolean for whether or not the argument is
required, add some new methods to make the purpose of the bool explicit.
2019-05-17 15:49:37 +02:00
Robin Burchell 5cad215919 ArgsParser: Style fixup
Remove tabs, make whitespace lines a little more in fitting with the rest of the codebase.
2019-05-17 15:49:37 +02:00
Andreas Kling cc5ee3bff4 Vector: Add insert() overload that takes a const T&. 2019-05-17 04:59:56 +02:00
Andreas Kling 01ffcdfa31 Kernel: Encapsulate the Region's COW map a bit better. 2019-05-14 17:31:57 +02:00
Andreas Kling 7198e35465 AK: InlineLRUCache was always filling up one short of capacity. 2019-05-14 15:33:21 +02:00
GuillaumeGas 801d6f572a Feature/pidof (#31)
* Added killall command

* Fixed feedbacks of awesomekling

* Implemented pidof program and helper to parse arguments called ArgsParser.

* Fixed feedbacks in pidof implem.

Fixes #26
2019-05-13 14:31:23 +02:00
Andreas Kling 19eeaf807d AK: Add InlineLinkedList::remove_tail(). 2019-05-07 16:06:48 +02:00
Andreas Kling cec16105cc Make sure all GraphicsBitmap scanlines are 16-byte aligned.
This is a prerequisite for some optimizations.
2019-05-06 14:04:54 +02:00
Andreas Kling fafdda8902 AK: Change HashTable and HashMap size/capacity to be ints. 2019-05-06 13:28:52 +02:00
Andreas Kling 71770e000b GTextEditor: Add very basic automatic indentation.
This is off by default, but enabled by TextEditor. It simply inserts the
same number of leading spaces as the previous line when hitting Enter. :^)
2019-04-25 22:56:09 +02:00
Andreas Kling 44673c4f3b Kernel: Add a write cache to DiskBackedFS.
This way you can spam small write()s on a file without the kernel writing
to disk every single time. Flushes are included in the FS::sync() operation
and will get triggered regularly by syncd. :^)
2019-04-25 22:05:53 +02:00
Andreas Kling 58240fdb33 Do a pass of compiler warning fixes.
This is really making me question not using 64-bit integers more.
2019-04-23 13:00:53 +02:00
Andreas Kling 2d7cad6a16 Kernel: Make sure we don't use any FPU/MMX/SSE instructions. 2019-04-22 23:38:33 +02:00
Andreas Kling 6693cfb26a Kernel: Don't use MMX memcpy() in the kernel.
I just discovered the hard way that clobbering FPU/MMX/SSE registers in the
kernel makes things very confusing for userspace (and other kernel threads.)

Let's banish all of those things from the kernel to keep things simple.
2019-04-22 17:13:18 +02:00
Andreas Kling ab94a6be00 AK: Add String::copy(BufferType) helper.
This will create a String from any BufferType that has data() and size().
2019-04-20 14:13:40 +02:00
Andreas Kling 7faf8fabf2 AK: Give Vector the ability to have an inline capacity.
This makes Vector malloc-free as long as you stay within the templated
inline capacity. :^)
2019-04-20 13:34:37 +02:00
Andreas Kling 6d4874cb2e LibC: Get rid of the now-unneeded AK/kmalloc.cpp 2019-04-20 13:00:25 +02:00
Andreas Kling 301a269ca0 Get rid of SERENITY macro since the compiler already defines __serenity__
This makes it a bit easier to use AK templates out-of-tree.
2019-04-20 12:58:49 +02:00
Andreas Kling 09c087177c Snake: Clear the movement queue on game reset. 2019-04-20 03:47:35 +02:00
Andreas Kling b41e95b578 Snake: Use a queue for the movement inputs.
This makes it a lot less finicky to make rapid moves like staircasing and
sudden turns.
2019-04-20 03:44:56 +02:00
Andreas Kling e001954193 AK: And one more RetainPtr::operator==() G++ complains about in LibGUI. 2019-04-19 21:36:11 +02:00
Andreas Kling b985d0ec6e AK: Add RetainPtr::operator==() overload G++ is whining about. 2019-04-19 21:34:47 +02:00
Andreas Kling 3a33b8ea08 VisualBuilder: Hook up everything needed for widget property editing.
It's now possible to edit widget properties inline in the properties window.
We're currently relying on the basic GVariant conversion functions to do
all the "parsing" but that's not gonna be good enough.
2019-04-19 01:05:59 +02:00
Andreas Kling 6f9df89c92 AK: MappedFile should open with O_CLOEXEC. 2019-04-18 22:19:42 +02:00
Andreas Kling 18ef6b111b WindowServer: Mouse switching between system menu and app menu was broken. 2019-04-17 12:06:09 +02:00
Andreas Kling d31b47b371 AK: Add Vector::prepend(). 2019-04-16 03:47:24 +02:00
Andreas Kling 33920df299 AK: Try to use StringViews more for substrings and splitting. 2019-04-16 02:39:16 +02:00
Andreas Kling 30b0e5f82e AK: Make StringBuilder::appendf() pre-allocate the format string length. 2019-04-15 23:56:35 +02:00
Andreas Kling 461aa550eb AK: Add a StringView class. 2019-04-15 14:56:37 +02:00
Andreas Kling bc5148354f LibCore: Add a CConfigFile class, a simple INI file parser.
You open the configuration for an app like so:

    auto config = CConfigFile::get_for_app("MyApp");

This will then open ~/MyApp.ini and parse it for you.
Immediately start using it in Minesweeper to load the field size and mine
count from a config file.
2019-04-15 02:23:20 +02:00
Andreas Kling c2093ad994 WindowServer: Move the CPU monitor thingy to its own class. 2019-04-14 04:33:43 +02:00
Andreas Kling 3f6408919f AK: Improve smart pointer ergonomics a bit. 2019-04-14 02:36:06 +02:00
Andreas Kling 2dbece54f5 AK: Add WeakPtr::operator T*() for ergonomy. 2019-04-14 02:15:43 +02:00
Andreas Kling 8feecf6c77 AK: Fix build. 2019-04-12 16:43:48 +02:00
Andreas Kling 8f4c59c276 GVariant: Don't crash when extracting a null String. 2019-04-12 14:43:44 +02:00
Andreas Kling 60a819c14a Kernel: Yet more work on bringing up POSIX SHM. 2019-04-09 02:37:38 +02:00
Andreas Kling f93b3b7806 AK: Improve StringImpl chomping a bit.
Chomp off any number of trailing [\0\n\r] characters and trim the allocation
to fit instead of keeping the original size.
2019-04-07 20:21:11 +02:00
Andreas Kling 51b4d3fe5a GHttp: Work on bringing this up. 2019-04-07 19:35:48 +02:00
Andreas Kling 47d270b577 WindowServer: Factor out window frame logic into a WSWindowFrame class.
The window frame is an object that contains a window, its title bar and
window border. This way WSWindowManager doesn't have to know about all the
different types of window borders, titlebar rects, etc.
2019-04-05 15:54:56 +02:00
Andreas Kling bcc00857a4 AK: Revert Eternal<T> for now since it doesn't work as intended. 2019-04-05 05:14:20 +02:00
Andreas Kling 9de7a0daaf AK: Fix problem when building i686-pc-serenity toolchain from scratch. 2019-04-05 03:58:40 +02:00
Andreas Kling c02c9880b6 AK: Add Eternal<T> and use it in various places.
This is useful for static locals that never need to be destroyed:

Thing& Thing::the()
{
    static Eternal<Thing> the;
    return the;
}

The object will be allocated in data segment memory and will never have
its destructor invoked.
2019-04-03 16:52:25 +02:00
Andreas Kling c0009e3173 PNGLoader: Use MappedFile. 2019-04-03 14:15:35 +02:00
Andreas Kling 3dc3754cde Font: Clean up AK::MappedFile and use it for mapping font files. 2019-04-03 13:51:49 +02:00
Andreas Kling ab6bd3872b AK: Remove unused TemporaryFile class. 2019-04-03 13:20:08 +02:00
Andreas Kling ac46e45f6e Kernel: Remove unneeded kassert.h. 2019-04-03 12:51:10 +02:00
Andreas Kling beb9c970c9 AK: Remove useless ktime.h 2019-04-03 12:09:27 +02:00
Andreas Kling 60f236b285 AK: Clean up some of the confusion that is AK/kmalloc.{cpp,h} 2019-04-03 12:07:41 +02:00
Andreas Kling 17e02e7450 Move NetworkOrdered.h to AK/ since it's used in both kernel and userspace. 2019-04-02 20:04:54 +02:00
Andreas Kling 6673284b06 LibGUI: Switch to a resizing cursor when hovering or using a GSplitter.
Also expose the various standard cursors on WSWindowManager so they can
be reused by the override mechanism.
2019-04-02 02:34:09 +02:00
Andreas Kling 90b2723e7a AK: Tweak CALLABLE_WHEN macro in Retained. 2019-03-31 22:11:13 +02:00
Andreas Kling 2c6a597d77 FileManager: Make the tree view follow the directory view navigations. 2019-03-30 03:27:25 +01:00
Andreas Kling 56f7b392c1 WindowServer: Move the CPU usage graph updates to a secondary thread.
This avoids blocking the main thread on filesystem access, which created
noticeable stutters during compilation.
2019-03-27 14:59:22 +01:00
Andreas Kling 23bb276fcd LibC: Run constructors on process startup.
Cooperate with the compiler to generate and execute the _init_array list
of constructor functions on userspace program statup. This took two days
to get working, my goodness. :^)
2019-03-27 12:48:21 +01:00
Andreas Kling e2a24e5746 AK: printf() should support %#x and %#o. 2019-03-27 01:29:07 +01:00
Andreas Kling 17b9fb7bfc AK: HashMap::set() didn't save new values for existing keys. 2019-03-25 04:23:17 +01:00
Andreas Kling 86413a6f5a LibGUI+FileManager: Add a GIcon class to support multi-size icons.
A GIcon can contain any number of bitmaps internally, and will give you
the best fitting icon when you call bitmap_for_size().
2019-03-24 04:28:36 +01:00
Andreas Kling b6cd66c3b5 AK: Uh, okay, it seems like we need those 64-bit division helpers after all. 2019-03-24 01:19:51 +01:00
Andreas Kling db6084538f AK: Don't compile the 64-bit division helpers in userland builds. 2019-03-24 00:53:56 +01:00
Andreas Kling 60d25f0f4a Kernel: Introduce threads, and refactor everything in support of it.
The scheduler now operates on threads, rather than on processes.
Each process has a main thread, and can have any number of additional
threads. The process exits when the main thread exits.

This patch doesn't actually spawn any additional threads, it merely
does all the plumbing needed to make it possible. :^)
2019-03-23 22:03:17 +01:00
Andreas Kling 5ca62f356b FileManager: Open PNG files with QuickShow when activated. 2019-03-22 12:43:29 +01:00
Andreas Kling 23fe630057 AK: Allow printing a literal '%' character with the printf family. 2019-03-22 01:50:32 +01:00
Andreas Kling c2a38c86cf AK: Fix busted __udivmoddi4() implementation. 2019-03-21 17:33:06 +01:00
Andreas Kling 9dfcd95cd7 Use 64-bit integers inside Stopwatch to enable longer timings. 2019-03-21 13:41:36 +01:00
Andreas Kling fe2fa4ac80 DNSLookupServer: Start working on a userspace DNS resolver.
This doesn't have any server functionality just yet, but it does post
decent-looking DNS queries and parse the responses.
2019-03-19 16:29:06 +01:00
Andreas Kling 43304d2adf WindowServer: Add special treatment for modal windows.
While a WSClientConnection has a modal window showing, non-modal windows
belonging to that client are not sent any events.
2019-03-19 00:52:39 +01:00
Andreas Kling 214b67defd AK: Add Vector::remove_first_matching(Callback).
This is a nice little helper to remove one item based on a matching
callback without having to do iteration yourself.
2019-03-18 20:51:40 +01:00
Andreas Kling 9ad076178a GIODevice: Add a read_all() that returns a ByteBuffer with all we can read.
Use this to implement file opening in TextEditor.
2019-03-18 14:38:30 +01:00
Andreas Kling ef05d8cbf6 AK: Use an OwnPtr for the VectorImpl.
I don't know why it wasn't implemented this way already. This fixes a leak
in operator=(Vector&&) that we were hitting on Ext2FS write.
2019-03-17 15:53:03 +01:00
Andreas Kling 1c6dfc3282 AK: Make ByteBuffer's copy() and wrap() take void*.
This way we don't have to cast whatever we're passing to copy()/wrap().
2019-03-17 00:36:41 +01:00
Andreas Kling dd5ca1940a AK: Hoist the assertion in Retainable::release() to RetainableBase.
This means we don't have to generate a __PRETTY_FUNCTION__ symbol there
for each and every specialization.
2019-03-16 13:48:56 +01:00
Andreas Kling 3ebb5fbb87 AK: Remove custom allocator feature from Vector.
This wasn't really used and generated a whole bunch of template bloat.
2019-03-16 13:24:39 +01:00
Andreas Kling 313ee8dd19 Move Lock from AK to Kernel, since it only works inside the kernel. 2019-03-16 13:18:22 +01:00
Andreas Kling 15657f0916 AK: Remove Buffer<T> since it was only ever instantiated with T=byte.
Instead make a specialized AK::ByteBufferImpl class for the backing store
of AK::ByteBuffer. This reduces template bloat.
2019-03-16 13:12:13 +01:00
Andreas Kling 955a0ff477 AK: Reduce template bloat by hoisting non-typed parts of Retainable.
This is a bit of an old school hack, but it does remove a whole bunch of
generated symbols.
2019-03-16 12:47:19 +01:00
Andreas Kling f87dec1cbf AK: Add CircularQueue::at(). 2019-03-15 12:13:51 +01:00
Andreas Kling 209a16bb7f IPv4: Dynamically allocate the UDP source port if needed. 2019-03-13 16:05:56 +01:00
Andreas Kling 60db082fdd AK: Fix node leak in SinglyLinkedList::take_first(). 2019-03-13 13:11:23 +01:00
Andreas Kling 87ecf290f4 Kernel: More work on the ICMP and IPv4 support. 2019-03-12 12:43:30 +01:00
Andreas Kling 90f60d2f65 Kernel: Cache MAC<->IP mappings (from ARP responses) seen on the wire. 2019-03-12 00:56:33 +01:00
Andreas Kling 35098cbde1 Kernel: Add a NetworkTask and a received network packet queue.
It will be easier to deal with incoming packets in a separate task.
2019-03-11 12:43:45 +01:00
Andreas Kling 0d5e6593b2 AK: Add a basic QuickSort template implementation.
It was depressing not being able to capture anything when passing a lambda
to qsort_r() so let's just have our own QuickSort. I was gonna have to do
this eventually anyway. :^)
2019-03-09 16:20:12 +01:00
Andreas Kling 46caa2663b LibGUI: Use a separate data role for the table model sorting order.
This allows data to be displayed nicely while sorting happens based on some
underlying raw data. :^)
2019-03-09 14:24:34 +01:00
Andreas Kling 7d1142c7d9 Make it possible to sort a GTableModel by column+order.
This is accomplished by putting a GSortingProxyTableModel between the model
and the view. It's pretty simplistic but it works for this use case. :^)
2019-03-09 13:33:52 +01:00
Andreas Kling 48d48679b0 GTextEditor: Work on cut/copy/paste operations. 2019-03-08 14:08:15 +01:00
Andreas Kling 43d56b6f3a GTextEditor: Support splitting lines at the cursor with the Return key. 2019-03-07 16:49:21 +01:00
Andreas Kling 8425ea971a GTextEditor: Start working on editing, starting with inserting newlines. 2019-03-07 15:52:11 +01:00
Andreas Kling 75fabef57b LibGUI: Add GVariant class and use it for table model data. 2019-02-28 16:20:29 +01:00
Andreas Kling 711e2b2651 AK: Accept any number of l's as printf format qualifiers.
This isn't entirely correct and will catch a bunch of things it's not
supposed to, but it works for now.
2019-02-27 08:39:19 +01:00
Andreas Kling 2fb3fa7f69 WindowServer: Add a simple CPU usage graph to the global menu bar.
This is pretty cute and helps me spot when something's chewing up CPU.
2019-02-26 02:17:25 +01:00
Andreas Kling 9624b54703 More moving towards using signed types.
I'm still feeling this out, but I am starting to like the general idea.
2019-02-25 22:06:55 +01:00
Andreas Kling 901b7d5d91 Fix a bunch of compiler warnings. Not all, but a lot. 2019-02-25 19:05:51 +01:00
Andreas Kling 15fb917f28 Convert more RetainPtr use to Retained. 2019-02-25 16:04:08 +01:00
Andreas Kling 2cfcbdc735 AK: Add Retained<T>, like RetainPtr, but never null.
Also use some Clang attribute wizardry to get a warning for use-after-move.
2019-02-25 12:43:52 +01:00
Andreas Kling d7753c7c8d Move over to building all of userspace with i686-pc-serenity-g++. 2019-02-22 14:45:14 +01:00
Andreas Kling 6788dcdb58 Start fixing things up to build with a proper cross-compiler. 2019-02-22 10:23:28 +01:00
Andreas Kling 3df4a902df Ext2FS: Lock a lot. Go way overkill with locking for now. 2019-02-20 13:09:59 +01:00
Andreas Kling 809ffa56d7 Kernel: Reduce code duplication in exception handlers. 2019-02-20 12:28:41 +01:00
Andreas Kling e74c833af3 AK: Fix broken instrumentation code for StringImpl. 2019-02-17 10:35:48 +01:00
Andreas Kling 022f7790db Use modern C++ attributes instead of __attribute__ voodoo.
This is quite nice, although I wish [[gnu::always_inline]] implied inline.
Also "gnu::" is kind of a wart, but whatcha gonna do.
2019-02-15 12:30:48 +01:00
Andreas Kling 27df572381 AK: Fix bug in MMX memcpy() unaligned prologue handling. 2019-02-12 12:39:04 +01:00
Andreas Kling fd5136a1ab AK: Oops, the optimization in Vector::append(Vector&&) was broken.
It forgot to clear out the moved-from vector. It's easy to see where this bug
came from: I assumed m_impl was an OwnPtr. It would be comfy if move() on some
arbitrary T* would also null it out but alas that's not how things work.
2019-02-11 12:44:59 +01:00
Andreas Kling 7014daa235 Kernel: Add an LRU block cache.
This papers over some of the incredibly inefficient access patterns in the
Ext2FS implementation for a while longer. :^)
2019-02-10 20:07:14 +01:00
Andreas Kling 33d34d9b26 Kernel: Use a Lockable<bool> for sysctl booleans as well. 2019-02-08 16:18:24 +01:00
Andreas Kling dabb3c902a AK: Add a Lockable wrapping container. 2019-02-08 09:46:13 +01:00
Andreas Kling 5582a0a254 Kernel: When a lock is busy, donate remaining process ticks to lock holder.
Since we know who's holding the lock, and we're gonna have to yield anyway,
we can just ask the scheduler to donate any remaining ticks to that process.
2019-02-07 11:14:58 +01:00
Andreas Kling 44e1a45b2a AK: Optimize Vector::append(Vector&&) for case where this->m_impl is null. 2019-02-07 09:09:30 +01:00
Andreas Kling 1f159eaab0 Add a fast memcpy() using MMX when we're moving >= 1KB.
This is a nice speedup for WindowServer. I'll eventually have to do this
with SSE but the kernel doesn't support SSE yet so this is it for now.
2019-02-07 08:46:52 +01:00
Andreas Kling d0b2949b4d AK: Lock should ASSERT_INTERRUPTS_ENABLED().
Trying to take a Lock while interrupts are disabled is always a bug.
2019-02-06 17:34:24 +01:00
Andreas Kling a1b63bb6d4 Bootloader: Locate the kernel's data segment and clear it.
This was a constant source of stupid bugs and I kept postponing it because
I wasn't in the mood to write assembly code. Until now! :^)
2019-02-06 16:02:10 +01:00
Andreas Kling 781f216676 AK: Add a TemporaryChange helper class. 2019-02-06 16:01:59 +01:00
Andreas Kling 8cc6e304ca Kernel: Clean up around Scheduler::yield() a bit.
Also add assertion in Lock that the scheduler isn't currently active.
I've been seeing occasional fuckups that I suspect might be someone called
by the scheduler trying to take a busy lock.
2019-02-06 15:06:48 +01:00
Andreas Kling e9f6508ada Remove some unused files. 2019-02-05 15:36:26 +01:00
Andreas Kling d459525725 AK: Vector::data() shouldn't crash if the vector is empty.
It's up to the caller to check size() and stay within the bounds.
2019-02-05 07:12:45 +01:00
Andreas Kling 612c02307e AK: Add bounds assertions in Vector::operator[].
I was sure I had this already.
2019-02-05 06:37:03 +01:00
Andreas Kling e88c8eae6a AK: Fix leak in HashTable move assignment operator. 2019-02-04 08:53:12 +01:00
Andreas Kling dddd0e7b03 Get nyancat nyanning in Serenity.
I found a cute program that renders an animated nyancat in the terminal.
This patch adds enough hackery to get it working correctly. :^)
2019-02-03 16:11:28 +01:00
Andreas Kling 7f91aec25c Support font files.
This only works with the userspace build of SharedGraphics so far.
It's also very slow at loading fonts, but that's easy to fix.

Let's put fonts in /res/fonts/.
2019-02-02 23:13:12 +01:00
Andreas Kling 5e0b7f1a56 Add basic automatic dependency management to Makefiles. 2019-02-02 04:41:59 +01:00
Andreas Kling 95c3442d59 Implement event loop timers.
GObjects can now register a timer with the GEventLoop. This will eventually
cause GTimerEvents to be dispatched to the GObject.

This needed a few supporting changes in the kernel:

- The PIT now ticks 1000 times/sec.
- select() now supports an arbitrary timeout.
- gettimeofday() now returns something in the tv_usec field.

With these changes, the clock window in guitest2 finally ticks on its own.
2019-02-01 03:50:06 +01:00
Andreas Kling ffab6897aa Big, possibly complete sweep of naming changes. 2019-01-31 17:31:23 +01:00
Andreas Kling 3a4207b863 Fix dumb bug in HashTable::clear().
We forgot to clear the m_buckets pointer. This meant that multiple calls to
clear() would cause trouble.
2019-01-30 19:32:54 +01:00
Andreas Kling b4e478aa50 Deallocate PTY's when they close.
This required a fair bit of plumbing. The CharacterDevice::close() virtual
will now be closed by ~FileDescriptor(), allowing device implementations to
do custom cleanup at that point.

One big problem remains: if the master PTY is closed before the slave PTY,
we go into crashy land.
2019-01-30 18:47:18 +01:00
Andreas Kling 027d26cd5d Add a String::format() and use that in place of ksprintf() in the Kernel.
You're never gonna be right 100% of the time when guessing how much buffer
space you need. This avoids having to make that type of decision in a bunch
of cases. :^)
2019-01-30 16:28:51 +01:00
Andreas Kling c30e2c8d44 Implement basic chmod() syscall and /bin/chmod helper.
Only raw octal modes are supported right now.
This patch also changes mode_t from 32-bit to 16-bit to match the on-disk
type used by Ext2FS.

I also ran into EPERM being errno=0 which was confusing, so I inserted an
ESUCCESS in its place.
2019-01-29 04:55:08 +01:00
Andreas Kling cc906a2897 VFS: Resolve FIXME in Inode::read_entire() about using dynamic allocation. 2019-01-28 22:55:55 +01:00
Andreas Kling 7455f5ea42 Expose the kernel log buffer through /proc/dmesg.
Also add a /bin/dmesg program for convenience.
2019-01-28 22:40:55 +01:00
Andreas Kling c7221b7dee Painter: Tell the compiler to flatten Font::draw_glyph().
I think that concludes the Terminal stress test optimizations for now.
2019-01-27 05:23:04 +01:00
Andreas Kling 29dfb4ae13 Ext2FS: Factor out block list generation and writing into functions. 2019-01-23 03:03:44 +01:00
Andreas Kling b75ee4aacb Coding style fixes in AK. 2019-01-19 22:53:05 +01:00
Andreas Kling 7e044cf293 Add a simple /bin/sysctl that wraps the files in /proc/sys. 2019-01-18 15:35:38 +01:00
Andreas Kling 9d7da26b4e StringBuilder: Use a ByteBuffer internally instead of a Vector<String>. 2019-01-18 03:27:51 +01:00
Andreas Kling 074edffc44 Add a simple StringBuilder::appendf() and use it for ProcFS.
Okay, now ProcFS doesn't crash due to the crappy buffer size estimates
not really working out. This thing has dogshit performance and I will
fix that separately.
2019-01-18 02:46:39 +01:00
Andreas Kling e9e57c5f65 Rename SpinLock to Lock. It hasn't been a SpinLock for some time.
I'm pretty happy with the mechanism of AK::Lock for now.
2019-01-17 16:25:02 +01:00
Andreas Kling b5c76d7559 Get rid of #ifdef SERENITY. We're past that phase of bootstrapping. 2019-01-17 01:41:36 +01:00
Andreas Kling f651405694 Optimize the Painter::blit() loop a bit. ~3% fewer cycles, I'll take it. 2019-01-16 19:50:25 +01:00
Andreas Kling f7ca6d254d Tear out or duplicate what's unique for WindowServer from Widgets.
This turned into a huge refactoring that somehow also includes
making locks recursive/reentrant.
2019-01-16 16:03:50 +01:00
Andreas Kling b4da4e8fbd Always inline the locks. 2019-01-14 14:14:30 +01:00
Andreas Kling 11331e9639 Add Vector::take_first(). 2019-01-14 02:49:30 +01:00
Andreas Kling b2d86b7597 Add basic GUI API for creating labels and buttons. 2019-01-13 05:03:17 +01:00
Andreas Kling 17c7bf01a5 Fix Userland build. 2019-01-13 04:31:16 +01:00
Andreas Kling edc827077e Optimize WindowManager::flush() with fast_dword_copy(). 2019-01-12 21:45:45 +01:00
Andreas Kling 8068b8e09e Add a Vector::clear_with_capacity() that doesn't release the backing store.
Use this for WindowManager's dirty rects to avoid kmalloc traffic.
2019-01-12 07:22:25 +01:00
Andreas Kling ceb373cf71 More window manager hacking. FocusIn/FocusOut events. 2019-01-09 05:40:04 +01:00
Andreas Kling 9963da9005 Start refactoring graphics system to have per-window backing stores.
It was fun for everyone to share a single framebuffer but it was also
kinda really awful. Let's move towards having a "GraphicsBitmap" as the
backing store for each Window.

This is going to need a lot of refactoring so let's get started.
2019-01-09 02:06:04 +01:00
Andreas Kling 741349502f Ext2FS: Free Ext2FSInodes when the last user releases them.
The inode cache was keeping these alive forever. Added a cute little magic
trick to Retainable that calls T::one_retain_left() when the retain count
is decremented to 1.
2019-01-01 02:38:09 +01:00
Andreas Kling edac1d6748 Make PageDirectory store physical pages in a HashMap.
This container is really just there to keep a retain on the individual
PhysicalPages for each page table. A HashMap does the job with far greater
space efficiency.
2018-12-31 15:10:12 +01:00
Andreas Kling ab72666f48 Plug leaks in SynthFS::remove_file().
The process spawn stress test can now run forever. :^)
2018-12-28 03:09:45 +01:00
Andreas Kling 3f3535213b Fix some issues uncovered by the spawn stress test. 2018-12-26 22:02:24 +01:00
Andreas Kling 7bc41532be Remove FS::read_entire_inode() in favor of Inode::read_entire(). 2018-12-21 17:45:42 +01:00
Andreas Kling ec1c487dcd Yet another pass of style fixes. 2018-12-21 02:10:45 +01:00
Andreas Kling d0f06e5f3f Automatically call Inode::flush_metadata() before an Inode is destroyed.
Use a little template magic to have Retainable::release() call out to
T::will_be_destroyed() if such a function exists before actually calling
the destructor. This gives us full access to virtual functions in the
pre-destruction code.
2018-12-19 22:28:09 +01:00
Andreas Kling d2bb139c46 Support inserting a newline. 2018-12-05 01:43:07 +01:00
Andreas Kling ca6847b5bb Import a simple text editor I started working on. 2018-12-04 00:27:16 +01:00
Andreas Kling aff89d2fd7 Yet more coding style fixes. 2018-12-03 01:38:22 +01:00
Andreas Kling f31e1ceab0 Move InlineLinkedList to AK. 2018-12-03 01:18:54 +01:00
Andreas Kling e7cc08226f Implement basic support for times().
The kernel now bills processes for time spent in kernelspace and userspace
separately. The accounting is forwarded to the parent process in reap().

This makes the "time" builtin in bash work.
2018-12-03 01:14:19 +01:00
Andreas Kling f6e27c2abe More coding style changes. 2018-12-03 00:39:25 +01:00
Andreas Kling fb8a1186f6 Use decltype(sizeof(void*)) as a facsimile for std::size_t.
Clang demands that the size argument to the various operator new()'s
to be exactly whatever it thinks std::size_t is.

Since we can't include STL headers, this little trick will do.
2018-12-02 23:48:19 +01:00
Andreas Kling 85b886c2e0 Make it possible to build the Kernel on a macOS host.
It still requires an ELF compiler and linker, but at least it builds.
I need to get rid of the "Unix" namespace. This does a lot of that.
2018-12-02 23:34:50 +01:00
Andreas Kling d90104f9e0 Let reap() communicate the dead process's exit status to the caller.
This way the scheduler doesn't need to plumb the exit status into the waiter.
We still plumb the waitee pid though, I don't love it but it can be fixed.
2018-11-28 22:01:24 +01:00
Andreas Kling f5a0b6961c Fix mkdir with relative paths. 2018-11-18 23:28:43 +01:00
Andreas Kling de4604ac95 Finally hook up the mkdir code to a syscall.
Added a /bin/mkdir that makes directories. How very neat :^)
There are various limitations because of missing functionality.
2018-11-18 15:02:16 +01:00
Andreas Kling d2046e79cf Add a DoubleBuffer thingy to allow TTY read/write to be interleaved.
I feel like this concept might be useful in more places. It's very naive
right now and uses dynamically growing buffers. It should really use static
size buffers and never kmalloc().
2018-11-16 17:57:00 +01:00
Andreas Kling 10c470e95f Make page_in_from_vnode 2x faster.
...by adding a new class called Ext2Inode that inherits CoreInode.
The idea is that a vnode will wrap a CoreInode rather than InodeIdentifier.
Each CoreInode subclass can keep whatever caches they like.

Right now, Ext2Inode caches the list of block indices since it can be very
expensive to retrieve.
2018-11-13 13:02:39 +01:00
Andreas Kling 97c799576a Add close-on-exec flag for file descriptors.
I was surprised to find that dup()'ed fds don't share the close-on-exec flag.
That means it has to be stored separately from the FileDescriptor object.
2018-11-13 01:36:31 +01:00
Andreas Kling 19b9401487 Reduce kmalloc() traffic in directory iteration.
Pass the file name in a stack-allocated buffer instead of using an AK::String
when iterating directories. This dramatically reduces the amount of cycles
spent traversing the filesystem.
2018-11-13 00:17:30 +01:00
Andreas Kling f1404aa948 Add primitive FIFO and hook it up to sys$pipe().
It's now possible to do this in bash:

cat kernel.map | fgrep List

This is very cool! :^)
2018-11-12 01:28:46 +01:00
Andreas Kling d5d45d1088 Rage hacking to get bash to run. It finally runs. So cool! :^) 2018-11-11 15:38:07 +01:00
Andreas Kling c653bb09b3 Don't include empty segments in canonicalized paths.
This makes "/foo/" and "/foo" both resolve to "/foo".
2018-11-10 15:46:39 +01:00
Andreas Kling b8264e7d47 Merge Disk namespace into the IDEDiskDevice class. 2018-11-10 15:15:31 +01:00
Andreas Kling 4914f3b837 Build LibC and Userland with clang as well. 2018-11-09 14:29:00 +01:00
Andreas Kling ebf308d413 Make kernel build with clang.
It's a bit faster than g++ and seems to generate perfectly fine code.
The kernel is also roughly 10% smaller(!)
2018-11-09 12:22:31 +01:00
Andreas Kling e9cdb6bb9b Fix all current build warnings in LibC. 2018-11-09 10:09:46 +01:00
Andreas Kling e71cb1c56b Fix some paging related bugs exposed by the spawn stress test.
- Process::exec() needs to restore the original paging scope when called
  on a non-current process.
- Add missing InterruptDisabler guards around g_processes access.
- Only flush the TLB when modifying the active page tables.
2018-11-09 01:25:31 +01:00
Andreas Kling 3b2dcd5929 Add a VMO pointer to VNode.
This way, if anyone tries to map an already mapped file, we share the VMO.
2018-11-08 15:39:26 +01:00
Andreas Kling fdbd9f1e27 Start working on memory-mapped files.
First of all, change sys$mmap to take a struct SC_mmap_params since our
sycsall calling convention can't handle more than 3 arguments.

This exposed a bug in Syscall::invoke() needing to use clobber lists.
It was a bit confusing to debug. :^)
2018-11-08 11:40:58 +01:00
Andreas Kling 71bffa9864 Fix whiny build. 2018-11-07 16:38:45 +01:00
Andreas Kling 981a3ae4b3 Make VFS test environment build again. 2018-11-07 12:05:51 +01:00
Andreas Kling a7f1d892a9 Add some basic setgroups(), getgroups() and initgroups().
Also teach /bin/id to print the user's supplemental groups.
2018-11-07 01:38:51 +01:00
Andreas Kling 8135952832 Add a Chomp feature to String construction that removes a trailing newline.
This will be useful in many situations.
2018-11-07 00:19:35 +01:00
Andreas Kling 2d045d2a64 Implement COW pages! :^)
sys$fork() now clones all writable regions with per-page COW bits.
The pages are then mapped read-only and we handle a PF by COWing the pages.

This is quite delightful. Obviously there's lots of work to do still,
and it needs better data structures, but the general concept works.
2018-11-05 13:48:07 +01:00
Andreas Kling 72cdc62155 Replace zones with individually tracked physical pages.
It's just a simple struct { ref_count, paddr }.
This will allow me to implement lazy zeroing and COW pages.
2018-11-05 10:23:00 +01:00
Andreas Kling b59ce22fc5 Fix dumb-but-hard-to-find bug in paging.
This was the fix:

-process.m_page_directory[0] = m_kernel_page_directory[0];
-process.m_page_directory[1] = m_kernel_page_directory[1];
+process.m_page_directory->entries[0] = m_kernel_page_directory->entries[0];
+process.m_page_directory->entries[1] = m_kernel_page_directory->entries[1];

I spent a good two hours scratching my head, not being able to figure out why
user process page directories felt they had ownership of page tables in the
kernel page directory.

It was because I was copying the entire damn kernel page directory into
the process instead of only sharing the two first PDE's. Dang!
2018-11-03 00:35:57 +01:00
Andreas Kling 065f0aee35 Preallocate the maximum number of FileHandle pointers (fds) in every process.
This could even use a more specific data structure since it doesn't need the
grow/shrink capabilities of a vector.
2018-11-01 13:39:28 +01:00
Andreas Kling 9a086b2d35 Add a kmalloc_eternal() for things that will never be destroyed. 2018-10-31 23:19:15 +01:00
Andreas Kling a8f36f72a8 printfing a number or string bigger than the field width should not crash. 2018-10-31 22:40:10 +01:00
Andreas Kling 9886b27d9c Add getpwent() family of functions to LibC.
Also add a little /etc/passwd database. There's just me in there.
2018-10-31 19:54:25 +01:00
Andreas Kling 8e640539ef Add an inode metadata cache to the ext2fs implementation. 2018-10-29 23:45:34 +01:00
Andreas Kling e6284a8774 Fix broken SpinLock.
The SpinLock was all backwards and didn't actually work. Fixing it exposed
how wrong most of the locking here is.

I need to come up with a better granularity here.
2018-10-29 22:04:26 +01:00
Andreas Kling c76dc9a047 Add /proc/mm and a /bin/mm utility that just dumps it.
This shows some info about the MM. Right now it's just the zone count
and the number of free physical pages. Lots more can be added.

Also added "exit" to sh so we can nest shells and exit from them.

I also noticed that we were leaking all the physical pages, so fixed that.
2018-10-28 10:28:21 +01:00
Andreas Kling e904f193c1 Canonicalize the path used by sh.
With a bunch of LibC work to support the feature. LibC now initializes
AK::StringImpl by default. It's now fine to use AK in LibC/Userland! :^)
2018-10-28 09:36:21 +01:00
Andreas Kling 88ad59bfb1 Add a simple FileSystemPath class that can canonicalize paths.
Also a simple StringBuilder to help him out.
2018-10-28 08:54:20 +01:00
Andreas Kling 8289a5c93c Implement 'H' and 'J' escape sequences. 2018-10-27 23:42:20 +02:00
Andreas Kling cc7e3519a6 Add a /bin/clear that prints the clear terminal escape sequence.
It doesn't work yet, but it will!
2018-10-27 17:39:08 +02:00
Andreas Kling 8f91a47aeb Add some basic field width support to printf().
Use it to make "ls" output a bit better. Also sys$spawn now fails with EACCES
if the path is not a file that's executable by the current uid/gid.
2018-10-27 16:43:03 +02:00
Andreas Kling 601d0d1739 Better int hashing. This was going to bite me sooner or later. 2018-10-27 09:33:24 +02:00
Andreas Kling 2716a9e2d7 Greatly improve /proc/PID/stack by tracing the ebp frame chain.
I also added a generator cache to FileHandle. This way, multiple
reads to a generated file (i.e in a synthfs) can transparently
handle multiple calls to read() without the contents changing
between calls.

The cache is discarded at EOF (or when the FileHandle is destroyed.)
2018-10-27 00:14:24 +02:00
Andreas Kling a32b3a3ddf Implement /proc/PID/vm.
Refactored SyntheticFileSystem to maintain an arbitrary directory structure.
ProcFileSystem creates a directory entry in /proc for each new process.
2018-10-26 17:44:19 +02:00
Andreas Kling 53abfa7ea1 Add sys$gethostname and /bin/hostname 2018-10-26 09:54:29 +02:00
Andreas Kling fdc782c1d1 Add a very naive block cache to the DiskBackedFileSystem.
This would be a lot better as an LRU. Right now it's a 32-slot
hash table with random eviction.
2018-10-25 12:36:50 +02:00
Andreas Kling 16f318408d ELFLoader should fail with an error message for unresolved symbols. 2018-10-25 10:02:04 +02:00
Andreas Kling ec1d16b307 Add a "pwd" utility to userland.
It's implemented as a separate process. How cute is that.
Tasks now have a current working directory. Spawned tasks inherit their
parent task's working directory.
Currently everyone just uses "/" as there's no way to chdir().
2018-10-24 14:28:22 +02:00
Andreas Kling bca4b71bfa Lots of hacking to make a very simple "ls" utility.
I added a dead-simple malloc that only allows allocations < 4096 bytes.
It just forwards the request to mmap() every time.

I also added simplified versions of opendir() and readdir().
2018-10-24 12:50:07 +02:00
Andreas Kling 82dae8fc90 Add a kmalloc lock. This definitely reduces flakiness. 2018-10-24 00:51:19 +02:00
Andreas Kling 018da1be11 Generalize the SpinLock and move it to AK.
Add a separate lock to protect the VFS. I think this might be a good idea.
I'm not sure it's a good approach though. I'll fiddle with it as I go along.

It's really fun to figure out all these things on my own.
2018-10-23 23:34:05 +02:00
Andreas Kling ed2422d7af Start adding a basic /proc filesystem and a "ps" utility. 2018-10-23 12:04:03 +02:00
Andreas Kling fe237ee215 Lots of hacking:
- Turn Keyboard into a CharacterDevice (85,1) at /dev/keyboard.
- Implement MM::unmapRegionsForTask() and MM::unmapRegion()
- Save SS correctly on interrupt.
- Add a simple Spawn syscall for launching another process.
- Move a bunch of IO syscall debug output behind DEBUG_IO.
- Have ASSERT do a "cli" immediately when failing.
  This makes the output look proper every time.
- Implement a bunch of syscalls in LibC.
- Add a simple shell ("sh"). All it can do now is read a line
  of text from /dev/keyboard and then try launching the specified
  executable by calling spawn().

There are definitely bugs in here, but we're moving on forward.
2018-10-23 10:12:50 +02:00
Andreas Kling c8b7173aa8 Add a CircularQueue template class to AK. 2018-10-22 22:46:02 +02:00
Andreas Kling b824f15619 Launching an arbitrary ELF executable from disk works! :^)
This is so cool! It's a bit messy now with two Task constructors,
but eventually they should fold into a single constructor somehow.
2018-10-22 15:43:02 +02:00
Andreas Kling 63764b3a65 Import very modest Userland. 2018-10-22 14:06:22 +02:00
Andreas Kling 85bcf2ed0f Add getgid() and getpid() syscalls. Prep for LibC. 2018-10-22 13:55:11 +02:00
Andreas Kling 702d308e67 Oops, StringImpl's "the empty string" global was not always initialized.
These "oops forgot to initialize" bugs are getting annoying...
2018-10-22 13:10:08 +02:00
Andreas Kling c149d2a8f0 Build ELFLoader into Kernel. 2018-10-18 15:03:10 +02:00
Andreas Kling 347e202f7f Add size_t and ssize_t to kernel builds. 2018-10-17 16:47:19 +02:00
Andreas Kling 7580ac576f Make VFS host build work again. 2018-10-17 12:23:19 +02:00
Andreas Kling d2425495ca VirtualFileSystem class builds inside Kernel. 2018-10-17 11:40:58 +02:00
Andreas Kling 9171521752 Integrate ext2 from VFS into Kernel. 2018-10-17 10:57:23 +02:00
Andreas Kling aec8ab0a60 Add the basic character devices to kernel. 2018-10-16 14:33:16 +02:00
Andreas Kling 5d465582a3 Start fixing up AK to work inside the kernel. 2018-10-16 13:59:28 +02:00
Andreas Kling 1203c327c7 Merge some features from gerbert into OwnPtr and RetainPtr. 2018-10-16 12:21:06 +02:00
Andreas Kling fd708a4cb1 Reduce dependence on STL. 2018-10-16 12:11:27 +02:00
Andreas Kling 0c1a4e8de3 Add String::substring(). 2018-10-16 12:07:17 +02:00
Andreas Kling 39444c5916 Fix HashTable::find() return iterator for items found in non-0 buckets. 2018-10-14 22:08:36 +02:00
Andreas Kling 560405667e Start using WeakPtr for some of the WindowManager window pointers. 2018-10-13 17:00:45 +02:00
Andreas Kling 3e9a45d7f4 Add WeakPtr/Weakable templates. 2018-10-13 15:41:24 +02:00
Andreas Kling b7efd92937 Make SinglyLinkedList destruction actually work. 2018-10-13 14:29:00 +02:00
Andreas Kling 969334505d Add HashMap::remove(). 2018-10-13 14:23:47 +02:00
Andreas Kling c2ef54c044 Add HashTable::remove() and fix a bug where ConstIterator would skip the first. 2018-10-13 14:22:09 +02:00
Andreas Kling f794190de0 Add a DoublyLinkedList template and start using it for HashTable. 2018-10-13 13:50:44 +02:00
Andreas Kling 7777c8844b Add Vector::remove(). 2018-10-13 01:17:36 +02:00
Andreas Kling 750b27cb07 Ext2FileSystem::readInode() should return an empty buffer for 0-length files. 2018-10-13 00:50:35 +02:00
Andreas Kling c37ded0ae4 Support arbitrary pointer traits. 2018-10-11 16:52:30 +02:00
Andreas Kling f282df6617 AK::Buffer should not free unowned backing stores, duh. 2018-10-11 12:30:35 +02:00
Andreas Kling a181a8f6e7 Run without SimpleMalloc locally for now. 2018-10-10 15:11:43 +02:00
Andreas Kling 5a30055157 Import all this stuff into a single repo called Serenity. 2018-10-10 11:53:07 +02:00