Commit Graph

322 Commits

Author SHA1 Message Date
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