A toy x86_64 OS in Rust.
- 08 Mar 2021: A functional syscall that prints a string to VGA. syscall.s is compiled to a freestanding Windows PE, which is embedded in the kernel binary (no filesystem!). It is loaded and executed in usermode in its own address space.
- 20 Feb 2021: A basic kernel heap
- 20 Feb 2021: Manual stack walking and resolution of symbols on panic. Involves packing the linker map into a binary format and patching it into the binary after build
- 20 Feb 2021: Startup in QEMU (it doesn't do anything yet)
-
x64 long mode
-
Basic interrupt handling (exceptions and clock IRQ)
-
Logging through serial port and VGA
-
Properly resolved backtraces on panic
-
Memory management
- Physical frame allocation
- Mapping regions of virtual memory into current address space
- Kernel heap
- Demand paging - physical pages only allocated when accessed
- Guard pages
- CoW pages
-
mmap
ped files
-
Processes
- Simple PE binary loader
- Process creation and execution from hardcoded .exe blob
- Userspace process
- Growable userspace stacks with guard pages
- Userspace heap
- Basic syscall with SYSCALL/SYSRET
- Actually useful syscalls
- Linux/Windows syscall compatibility
- Process lifecycle
- Creation of address space and threads
- Jump to executing thread in kernel/userspace
- Scheduling/preemption
- Exiting
- Basic Rust
std
userspace implementation
-
Devices
- Keyboard/mouse
- Filesystem
- Networking
-
...everything else...
Only tested on Linux with the Rust nightly specified in rust-toolchain
.
Dependencies:
- mtools
- grub
- xorriso
- qemu
- ld
$ scons # builds only
$ scons run # builds and runs in qemu
$ scons run headless=1 # builds and runs in qemu with no graphical window
$ scons -c # cleans build, might be needed before multiple consecutive `scons run` without code changes