zig-kernel is the hyperion kernel rewritten as a microkernel in pure Zig
the name is very temporary
zig build run # thats it
zig build # generates the os.iso in zig-out/os.iso
Despite the name, this repo holds more than just the kernel
- kernel: src/kernel
- bootstrap process: src/bootstrap
- kernel/user interface: src/abi
The plan is to have the kernel be just a scheduler, IPC relay, vfs protocol "loadbalancer" and a virtual memory manager.
Every path is a URI, where the protocol part (proto://) tells the kernel, which service handles that path. This is kind of like how Redox os does things.
-
kernel
- PMM
- VMM
- GDT, TSS, IDT
- ACPI, APIC
- user space
- HPET
- scheduler
- binary loader
- message IPC, shared memory IPC
- figure out userland interrupts (ps2 keyboard, ..)
- syscalls:
- syscall to exec a binary (based on a provided mem map)
- syscall to create a vfs proto
- syscall to accept a vfs proto cmd
- syscall to return a vfs proto cmd result
- syscalls for unix sockets
-
bootstrap/initfsd process
- decompress initfs.tar.gz
- create initfs:// vfs proto
- exec initfs:///sbin/initd
- rename to initfsd
- start processing vfs proto cmds
-
initfs:///sbin/initd process
- launch initfs:///sbin/rngd
- launch initfs:///sbin/vfsd
- launch services from initfs://
-
initfs:///sbin/rngd process
- create rng:// vfs proto
- start processing vfs proto cmds
-
/sbin/inputd process
-
/sbin/outputd process
-
/sbin/kbd process
-
/sbin/moused process
-
/sbin/timed process
-
/sbin/fbd process
-
/sbin/pcid process
-
/sbin/usbd process
-
initfs:///sbin/vfsd process
- create fs:// vfs proto
- get the root device with syscall (either device or fstab for initfs:///etc/fstab)
- exec required root filesystem drivers
- mount root (root= kernel cli arg) to /
- remount root using /etc/fstab
- exec other filesystem drivers lazily
- mount everything according to /etc/fstab
- start processing vfs proto cmds
-
initfs:///sbin/fsd.fat32
- connect to the /sbin/vfsd process using a unix socket
- register a fat32 filesystem
- start processing cmds