Commit graph

638 commits

Author SHA1 Message Date
Andreas Kling
43075e5878 Add a simple /bin/df which gathers its info from /proc/df. 2019-02-21 14:48:00 +01:00
Andreas Kling
7d288aafb2 Kernel: Add link() syscall to create hard links.
This accidentally grew into a little bit of VFS cleanup as well.

Also add a simple /bin/ln implementation to exercise it.
2019-02-21 13:26:40 +01:00
Andreas Kling
0aaec6b19a Support resizing the Terminal app.
I set it up so that TIOCSWINSZ on a master PTY gets forwarded to the slave.
This feels intuitively right. Terminal can then use that to inform the shell
or whoever is inside the slave that the window size has changed.

TIOCSWINSZ also triggers the generation of a SIGWINCH signal. :^)
2019-02-20 23:38:20 +01:00
Andreas Kling
e0b81ee4c9 Ext2FS: Remove the inode cache lock in favor of one big lock instead. 2019-02-20 21:58:55 +01:00
Andreas Kling
266e77259e Kernel: If someone else zero-fills a shared VMO page, don't freak out.
Just map the new page and move on.
2019-02-20 21:33:07 +01:00
Andreas Kling
6158f456fa Kernel: Don't remove from SharedBuffer map while iterating it.
This was causing a finalizer crash when handling a process that co-owned
multiple shared buffers.
2019-02-20 21:31:52 +01:00
Andreas Kling
59b8183c4b WindowServer: Support resizing windows.
This is pretty limited and not entirely stable, but it does work! :^)
2019-02-20 15:34:55 +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
b704d3d295 LibGUI: Add a GToolBar class that can be populated with GActions.
The same action can be added to both a menu and a toolbar.
Use this to put a toolbar into FileManager. This is pretty neat. :^)
2019-02-20 02:39:46 +01:00
Andreas Kling
fad69464f6 Kernel: Fix wrong calculation of current Unix timestamp. 2019-02-19 02:39:18 +01:00
Andreas Kling
d4973842c9 Kernel: Run the sync daemon once every second.
This is obviously not a final design, but 10 seconds was way too long.
2019-02-17 15:18:35 +01:00
Andreas Kling
8eedbbc9ca Prune compiler flags a bit. Let's go with -march=i686 for now. 2019-02-17 15:17:21 +01:00
Andreas Kling
e241f3a801 Kernel: Shrink kmalloc() chunk size from 128 to 64.
This sacrifices some speed for more space. I don't want to work on a new
allocator right this moment, so this buys me some time.
2019-02-17 13:41:15 +01:00
Andreas Kling
0730b3c15f Add ability to switch video modes from the system menu.
I had to change PhysicalPage around a bit for this. Physical pages can now
be instantiated for any arbitrary physical address without worrying that
such pages end up in the kernel page allocator when released.

Most of the pieces were already in place, I just glued everything together.
2019-02-17 13:12:59 +01:00
Andreas Kling
ff786aa38a Spawn Launcher and FileManager on startup by default again.
I disabled this while debugging WindowServer-in-userspace, and now that it
works fine we can bring these back up.
2019-02-17 11:31:52 +01:00
Andreas Kling
d5f515cf6c Kernel: Give each FileDescriptor a chance to co-open sockets.
Track how many fds are open for a socket's Accepted and Connected roles.
This allows fork() to clone a socket fd without a subsequent close() walking
all over the parent process's fd.
2019-02-17 11:00:35 +01:00
Andreas Kling
7bb00ea1e3 Kernel: socket() with SOCK_CLOEXEC was setting the wrong fd flag.
Turns out FD_CLOEXEC and O_CLOEXEC are different values. Silly mistake.
I noticed that Terminal's shell process still had the Terminal's window
server connection open, albeit in a broken state.
2019-02-17 10:41:37 +01:00
Andreas Kling
b6bf26430d Kernel: Have devices automagically register themselves with the VFS. 2019-02-17 10:38:07 +01:00
Andreas Kling
cf8dd312ab Kernel: Fix String leaks in exec().
When the kernel performs a successful exec(), whatever was on the kernel
stack for that process before goes away. For this reason, we need to make
sure we don't have any stack objects holding onto kmalloc memory.
2019-02-17 10:18:25 +01:00
Andreas Kling
df2d46d5dc Kernel: Add SocketRole::Listener and report the role nicely in /proc/PID/fds. 2019-02-17 09:40:52 +01:00
Andreas Kling
a0b55987d3 Kernel: Report the correct name for NullDevice. 2019-02-17 09:40:19 +01:00
Andreas Kling
459cc23441 Kernel: Remove Process::gui_client_id(). 2019-02-17 09:05:49 +01:00
Andreas Kling
bd2fdcbbaa Kernel: Rename BochsVGADevice to BXVGADevice. 2019-02-17 08:41:05 +01:00
Andreas Kling
10b43f3d1d Kernel: Rename Keyboard to KeyboardDevice. 2019-02-17 08:39:09 +01:00
Andreas Kling
2dc0ef8813 Kernel: munmap() should round up to nearest page size, just like mmap().
The mismatch between the two was causing some trouble if you'd mmap e.g 1KB
and then try to munmap() it. The kernel would whine that it couldn't find
any such mapping (because mmap() actually rounded the 1KB to a 4KB page.)
2019-02-17 08:33:13 +01:00
Andreas Kling
809266a9fb Kernel: Remove tracking of bitmap memory.
There are no more kernel bitmaps. It's much better this way.
2019-02-17 01:16:38 +01:00
Andreas Kling
cc9ff96a98 Kernel: FileDescriptor::absolute_path() should "support" sockets. 2019-02-17 01:11:37 +01:00
Andreas Kling
53c69dbade Start the WindowServer process with high priority. 2019-02-17 00:21:26 +01:00
Andreas Kling
640360e958 Move WindowServer to userspace.
This is a monster patch that required changing a whole bunch of things.
There are performance and stability issues all over the place, but it works.
Pretty cool, I have to admit :^)
2019-02-17 00:13:47 +01:00
Andreas Kling
4ea28bf0a5 Kernel: Add a simple shared memory API for two processes only.
And use this to implement shared bitmaps between WindowServer and clients.
2019-02-16 12:13:43 +01:00
Andreas Kling
4db78dabd3 Kernel: Rename create_framebuffer_wrapper() to create_for_physical_range().
Maybe there will be other types of physical ranges to map in the future.
This API doesn't seem at all specific to framebuffers.
Also tidy up a bit in BochsVGADevice.
2019-02-16 10:58:15 +01:00
Andreas Kling
7210d2ade5 Kernel: Remove knowledge about BochsVGADevice from Process. 2019-02-16 10:40:47 +01:00
Andreas Kling
468113422f Kernel: Add ioctls to BochsVGADevice for mode setting and page flipping.
Use these in WindowServer instead of poking at the BochsVGADevice directly.
2019-02-16 10:26:01 +01:00
Andreas Kling
799177feda Kernel: Make BochsVGADevice a BlockDevice and support mmapping it.
Currently you can only mmap the entire framebuffer.
Using this when starting up the WindowServer gets us yet another step
closer towards it moving into userspace. :^)
2019-02-16 09:57:42 +01:00
Andreas Kling
2dc7c5a7b0 Kernel: Add empty BlockDevice class. 2019-02-16 00:52:58 +01:00
Andreas Kling
994279d56c Kernel: Add Device base class for CharacterDevice.
..to prepare for adding a BlockDevice class.
2019-02-16 00:47:20 +01:00
Andreas Kling
c6ca6522fc Kernel: Sending a signal to another process needs to disable interrupts. 2019-02-15 23:45:01 +01:00
Andreas Kling
749db8237c Ext2FS: Fix various bugs in inode and block allocation.
I had the wrong idea about how group indices work, so using a larger fs
with more than one group caused all kinds of mess.
2019-02-15 23:28:20 +01:00
Andreas Kling
df6aaaeeef Enable -Wimplicit-fallthrough. 2019-02-15 12:39:16 +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
fbcc8ab840 WindowServer: Slurp all available client messages when checking them.
We were reading one client message per client per event loop iteration.
That was not very snappy. Make the sockets non-blocking and read() until
there are no messages left.

It would be even better to make as few calls to read() as possible to
reduce context switching, but this is already a huge improvement.
2019-02-15 11:43:43 +01:00
Andreas Kling
a54cd84c59 Move WindowServer API types header into WindowServer/. 2019-02-15 09:14:21 +01:00
Andreas Kling
0d23cd73e6 VFS: Add two assertions to resolve_path() to catch corrupted file systems. 2019-02-15 09:07:29 +01:00
Andreas Kling
18210c606d Kernel: Remove GUIEventDevice.
It's no longer used since all communication now happens across sockets. :^)
2019-02-15 08:59:55 +01:00
Andreas Kling
e9d6fbfb47 Kernel: Fix some broken debug log statements. 2019-02-14 17:43:47 +01:00
Andreas Kling
bf58241c11 Port the WindowServer and LibGUI to communicate through local sockets.
This is really cool! :^)

Apps currently refuse to start if the WindowServer isn't listening on the
socket in /wsportal. This makes sense, but I guess it would also be nice
to have some sort of "wait for server on startup" mode.

This has performance issues, and I'll work on those, but this stuff seems
to actually work and I'm very happy with that.
2019-02-14 17:18:35 +01:00
Andreas Kling
00319c248c Kernel: Let's say that listening+bound sockets "can read."
This will make it easy-peasy to select() on a socket file descriptor to wait
for incoming connections together with other activities.
2019-02-14 16:03:37 +01:00
Andreas Kling
eb1c721ef3 Kernel: Actually send things between the socket endpoints. 2019-02-14 16:01:45 +01:00
Andreas Kling
b20a7aca61 Kernel: More work on sockets. Fleshing out connect(). 2019-02-14 15:55:19 +01:00