Commit Graph

104 Commits

Author SHA1 Message Date
Andreas Kling
5c68929aa1 Kernel: Add a systrace() syscall and implement /bin/strace using it.
Calling systrace(pid) gives you a file descriptor with a stream of the
syscalls made by a peer process. The process must be owned by the same
UID who calls systrace(). :^)
2019-04-22 18:44:45 +02:00
Andreas Kling
57da00b731 Include Makefile.common in all other Makefiles. 2019-04-21 04:09:39 +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
3817f5f619 Kernel+LibC: Add a DebugLogDevice that forwards everything to I/O port 0xe9.
This is then used to implement the userspace dbgprintf() in a far more
efficient way than what we had before. :^)
2019-04-18 16:08:52 +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
26a06f3fcd Kernel: More work towards POSIX SHM, also add ftruncate(). 2019-04-09 01:10:00 +02:00
Andreas Kling
ddba6c1b7f Kernel: Oops, also moved FileDescriptor into FileSystem/, fix Makefile. 2019-04-06 20:34:59 +02:00
Andreas Kling
644c887594 Kernel: Move FIFO into FileSystem/ and Socket+LocalSocket into Net/. 2019-04-06 20:29:48 +02:00
Andreas Kling
6df5e3f51a Kernel: Build with i686-pc-serenity-g++.
This works just fine, and now we only need one cross-compiler. :^)
2019-04-05 02:56:23 +02:00
Andreas Kling
b9738fa8ac Kernel: Move VM-related files into Kernel/VM/.
Also break MemoryManager.{cpp,h} into one file per class.
2019-04-03 15:13:07 +02:00
Andreas Kling
ab43658c55 Kernel: Move devices into Kernel/Devices/. 2019-04-03 12:36:40 +02:00
Andreas Kling
072ea7eece Kernel: Move ELF-related files into Kernel/ELF/. 2019-04-03 12:30:04 +02:00
Andreas Kling
9fca94269e Kernel: Move TTY-related files into Kernel/TTY/. 2019-04-03 12:28:45 +02:00
Andreas Kling
f9864940eb Kernel: Move FS-related files into Kernel/FileSystem/ 2019-04-03 12:25:24 +02:00
Andreas Kling
649c81a714 Kernel: Move networking related files into Kernel/Net/. 2019-04-02 19:54:38 +02:00
Andreas Kling
718bea73b3 Kernel: Add a LoopbackAdapter for talking to yourself via 127.0.0.1.
Choosing adapter for transmit is done by adapter_for_route_to(IPv4Address).
This is just hard-coded logic right now but can be expanded to support a
proper routing table.

Also start moving kernel networking code into Kernel/Net/.
2019-04-02 15:46:44 +02:00
Andreas Kling
ee4d7c18c8 Kernel: Use a multiboot header instead of a convoluted two-part bootloader.
The old bootloader was hilariously complicated, requiring a floppy disk with
the kernel on it, and a hard drive with the file system. This patch removes
the floppy disk from the equation and replaces it with a multiboot header.
This means the kernel can now be booted with qemu-system-i386 -kernel kernel
2019-04-01 21:43:07 +02: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
edb986c276 IPv4: Factor out UDP parts of IPv4Socket into a UDPSocket class. 2019-03-14 12:43:18 +01:00
Andreas Kling
d2176eddfc Kernel: Factor out TCP parts of IPv4Socket into a TCPSocket class. 2019-03-14 12:20:38 +01:00
Andreas Kling
a017a77442 Kernel+LibC+Userland: Start working on an IPv4 socket backend.
The first userland networking program will be "ping" :^)
2019-03-12 15:51:42 +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
405413c354 Kernel: Start adding support for E1000 network adapters. 2019-03-10 15:25:33 +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
75b100673f Switch over to building everything with i686-elf-g++. 2019-02-22 10:45:32 +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
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
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
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
df6aaaeeef Enable -Wimplicit-fallthrough. 2019-02-15 12:39:16 +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
2f35e54f80 Kernel: Begin implementing UNIX domain sockets. 2019-02-14 14:17:38 +01:00
Andreas Kling
8d5ba56cf9 Kernel: Remove ProcessGUI.cpp, merging remainders into Process.cpp. 2019-02-14 10:39:26 +01:00
Andreas Kling
aa7947c889 WindowServer: Add WSClientConnection class to manage an individual client.
This makes both object lifetimes and object ID's a lot easier to understand.
2019-02-14 08:22:47 +01:00
Andreas Kling
443b043b49 WindowServer: Start implementing a menu system.
I'm going with a global top-of-the-screen menu instead of per-window menus.
The basic idea is that menus will live in the WindowServer and clients can
create menus via WindowServer requests.
2019-02-11 09:47:10 +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
27263b6172 Clean up LDFLAGS a bit.
While working on the ELF loader I was trying to keep binaries as simple as
possible so I could understand them easily. Now that the ELF loader is mature
and working fine, we can move closer towards ld defaults.
2019-02-06 14:48:09 +01:00
Andreas Kling
731fc5a7c8 Kernel: Much improved BochsVGA (BXVGA) support.
Instead of cowboy-calling the VESA BIOS in the bootloader, find the emulator
VGA adapter by scanning the PCI bus. Then set up the desired video mode by
sending device commands.
2019-02-06 10:17:26 +01:00
Andreas Kling
5e9ba2ac84 Kernel: Rewrite ProcFS.
Now the filesystem is generated on-the-fly instead of manually adding and
removing inodes as processes spawn and die.

The code is convoluted and bloated as I wrote it while sleepless. However,
it's still vastly better than the old ProcFS, so I'm committing it.

I also added /proc/PID/fd/N symlinks for each of a process's open fd's.
2019-02-03 12:33:11 +01:00
Andreas Kling
5e0b7f1a56 Add basic automatic dependency management to Makefiles. 2019-02-02 04:41:59 +01:00
Andreas Kling
e9b948103d Add a /dev/pts filesystem and make PTY allocation dynamic.
You can now open as many PTY pairs as you like. Well, it's actually capped
at 8 for now, but it's just a constant and trivial to change.

Unregistering a PTY pair is untested because I didn't want to start
mucking with that in Terminal right now.
2019-01-30 00:49:20 +01:00
Andreas Kling
bba21adae3 WindowServer: Rename WSEvent to WSMessage.
Also do the same for WSMessageLoop and WSMessageReceiver. More to come.
2019-01-26 05:28:02 +01:00
Andreas Kling
8bb18fdc56 Kernel: Get rid of Unix namespace.
This is no longer needed as the Kernel can stand on its own legs now
and there won't be any conflict with host system data types.
2019-01-23 06:57:00 +01:00
Andreas Kling
754037874c Move VFS sources into Kernel/. 2019-01-23 05:14:00 +01:00
Andreas Kling
7e5b81fe48 Make a SharedGraphics directory for classes shared between Kernel and LibGUI. 2019-01-19 23:22:46 +01:00
Andreas Kling
9454c5dd52 WindowServer: Merge WSFrameBuffer into WSScreen. 2019-01-18 05:41:15 +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
9dd29f9aa9 Add a PTY multiplexer (/dev/ptmx) device.
When you open /dev/ptmx, you get a file descriptor pointing to one of the
available MasterPTY's. If none are available, you get an EBUSY.

This makes it possible to open multiple (up to 4) Terminals. :^)

To support this, I also added a CharacterDevice::open() that gets control
when VFS is opening a CharacterDevice. This is useful when we want to return
a custom FileDescriptor like we do here.
2019-01-16 13:39:32 +01:00