Commit Graph

75 Commits

Author SHA1 Message Date
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
Andreas Kling
46181cf023 Oops, finish WindowServer rename. 2019-01-15 21:46:15 +01:00
Andreas Kling
e42f090ed3 Rename WindowComposer -> WindowServer.
I keep referring to it as the windowing server anyway.
2019-01-15 21:16:04 +01:00
Andreas Kling
2f74c2f430 Add basic PTY support.
For now, there are four hard-coded PTYs: /dev/pt{m,s}[0123]
Use this in the Terminal to open a pty pair and spawn a shell.
2019-01-15 06:30:19 +01:00
Andreas Kling
b0e3f73375 Start refactoring the windowing system to use an event loop.
Userspace programs can now open /dev/gui_events and read a stream of GUI_Event
structs one at a time.

I was stuck on a stupid problem where we'd reenter Scheduler::yield() due to
having one of the has_data_available_for_reading() implementations using locks.
2019-01-14 14:42:49 +01:00
Andreas Kling
8f8c8d1ca3 Start working on a GUI kernel API. 2019-01-13 02:02:34 +01:00
Andreas Kling
bb28c31531 Get rid of the "root widget" concept in WindowManager.
Instead just create a GraphicsBitmap wrapper around the display framebuffer
and teach Painter how to draw directly into a GraphicsBitmap.
2019-01-12 03:42:50 +01:00
Andreas Kling
a3c39ea9d6 Throw up some widgets on screen so we can see what they look like. 2019-01-11 04:10:07 +01:00
Andreas Kling
e740f1195a Add a simple PS/2 mouse device.
It's not hooked up to anything just yet, but it does read movement deltas.
2019-01-11 02:28:53 +01:00
Andreas Kling
f6d2c3ed87 Hook everything up to run the GUI on top of the kernel.
Okay things kinda sorta work. Both Bochs and QEMU now boot into GUI mode.
There's a ton of stuff that doesn't make sense and so many things to rework.

Still it's quite cool to have made it this far. :^)
2019-01-10 23:19:29 +01:00
Andreas Kling
659c54e32b Switch into 1024x768x32bpp VESA LFB mode at boot.
This is going to be pretty cool once I can hook up the Widgets/ code to it.
2019-01-09 02:29:11 +01:00
Andreas Kling
ba91ab1038 Don't omit frame pointers. Duh. This fixes /proc/PID/stack listings. 2019-01-04 19:02:21 +01:00
Andreas Kling
503e32552c Move kernel symbolication code out of init.cpp and into its own KSym files.
Also use a simple array of { dword, const char* } for the KSyms and put the
whole shebang in kmalloc_eternal() memory. This was a fugly source of
kmalloc perma-frag.
2018-12-24 23:01:09 +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
bbfae19238 Move DoubleBuffer to its own files. 2018-12-03 01:51:44 +01:00
Andreas Kling
44036f32bc Move ELFLoader code into Kernel/. 2018-12-02 20:27:08 +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
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
2ac5e14c08 Merge VGA into VirtualConsole. 2018-11-10 16:26:18 +01:00
Andreas Kling
b8264e7d47 Merge Disk namespace into the IDEDiskDevice class. 2018-11-10 15:15:31 +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
47b7eeda44 Fix all current build warnings in the kernel. 2018-11-09 10:03:21 +01:00
Andreas Kling
71a2942a0a Make it run in QEMU.
Looks like the problem was the weirdly-sized floppy image file.
I guess QEMU was inferring the floppy disk geometry from the image size.
2018-11-08 02:03:19 +01:00
Andreas Kling
39d2fcbbee Move the scheduler code to its own class.
This is very mechanical.
2018-11-07 22:15:02 +01:00
Andreas Kling
83172e6a4b Rename FileHandle to FileDescriptor. 2018-11-07 11:37:54 +01:00
Andreas Kling
e088121b3a Fix sys$sigaction() to return the old action metadata if requested. 2018-11-07 10:48:44 +01:00
Andreas Kling
d7a41579e5 Miscellaneous compat work while seeing if GNU coreutils would build. 2018-11-07 10:23:16 +01:00
Andreas Kling
422b5403e5 Merge ExecSpace into ELFLoader. 2018-11-04 13:52:53 +01:00
Andreas Kling
05565bad58 Make IO helpers inline and use immediate-encoded ports when possible. 2018-11-02 10:14:26 +01:00
Andreas Kling
3e532ac7b6 Process now maps regions immediately when they are allocated.
This avoids having to do a separate MM.mapRegionsForTask() pass.

Also, more Task => Process renaming that I apparently hadn't saved yet.
2018-11-01 13:15:46 +01:00