M8: initrd handoff + multi-binary shipping
Ship more than one user binary: the bootloader now ferries an initrd bundle
(the VFS server + future drivers) alongside sbin/init, and the kernel unpacks
and spawns each program.
- src/user/proto/initrd.zig: the container format (Header{magic,count} +
Entry{name[32],offset,len} + blobs) with a validating Reader, shared by the
kernel and the packer.
- tools/mkinitrd.py: host-side packer (Python — trivial format, and sidesteps
the reworked Zig 0.16 std fs/args API). build.zig runs it on the built user
binaries via addSystemCommand and installs initrd.img to zig-out/bin + the
ESP root.
- BootInfo gains initrd_base/initrd_len; efi.zig loadInit refactored into a
shared loadFile, and loadInitrd ferries \initrd.img into surviving
LoaderData like init.
- main.zig startInitrdBinaries(): parse the image, spawn every entry (kernel-
spawns-all for now; init takes over via sys_spawn later).
- sbin/vfs.zig: a heartbeat stub (the real VFS server is M9), packed into the
initrd to prove the pipeline.
- New `initrd` test: parse + spawn + confirm the vfs stub reaches ring 3 and
heartbeats. Harness ships initrd.img on the ESP. Suite 30/30.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
//! /sbin/vfs — the user-space VFS server. Shipped in the initrd and spawned as a
|
||||
//! ring-3 process. This is a placeholder that only heartbeats, proving the initrd
|
||||
//! pipeline ships and spawns it; the real path namespace + IPC dispatch loop
|
||||
//! (open/read/write/stat forwarded to driver processes) is built in M9.
|
||||
|
||||
const rt = @import("rt");
|
||||
|
||||
pub fn main() void {
|
||||
while (true) {
|
||||
_ = rt.sys.write("vfs: alive\n");
|
||||
rt.sys.sleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
pub const panic = rt.panic;
|
||||
comptime {
|
||||
_ = &rt.start._start;
|
||||
}
|
||||
Reference in New Issue
Block a user