feat: proper IPC-based boot — init loads servers from storage via IPC, VirtIO GPU driver
Complete microkernel boot pipeline: adapter loads only init + storage + display from disk. Init bootstraps all other servers by reading binaries from the storage server via IPC, parsing ELF, creating processes, mapping pages, and spawning threads. New syscalls: - CreateEndpoint: userspace endpoint creation with full capability grant - DebugPutchar: debug output to UART from userspace - MapPage: cross-process page mapping (init loads binaries into children) - SpawnThreadIn: spawn thread in another process via capability Key fixes: - Per-process L1 page tables for VPN[2]=0 (prevents cross-process corruption) - Separate kernel_pt from page_tables[0] (init pid=0 overwrote kernel PT ref) - Thread Running state set in switch_to_next (syscalls rejected without it) - Pending IPC results applied during context switch - SIE disabled during boot (timer can't preempt into unready processes) - User heap VA starts at 0x40000 (avoids shared buffer at 0x30000) - RequestPages maps at user VAs via per-process heap allocator VirtIO GPU: - Adapter probes for GPU device, initializes resource/scanout/backing - Display server writes to mapped framebuffer, flushes via GPU virtqueue - 640x480 BGRA framebuffer with transfer-to-host and resource-flush Storage server: - Userspace VirtIO block driver using pre-mapped MMIO and DMA pages - FAT16 filesystem reader serving file-read requests via IPC - Shared buffer protocol: init writes filename, storage writes file data Echo app for IPC testing (adapter-loaded echo proved the pipeline end-to-end).
This commit is contained in:
@@ -1,112 +0,0 @@
|
||||
use types::address::PhysicalAddress;
|
||||
use types::bounded::Priority;
|
||||
use types::id::IrqId;
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum HardwareCap {
|
||||
Framebuffer { base: PhysicalAddress, pages: usize },
|
||||
Irq { irq: IrqId },
|
||||
Memory { base: PhysicalAddress, pages: usize },
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum EndpointBinding {
|
||||
Own { name: &'static str },
|
||||
ConnectTo { server: &'static str, endpoint: &'static str },
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum BinarySource {
|
||||
Ram { base: PhysicalAddress, size: usize },
|
||||
Storage { path: &'static str },
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct ServerEntry {
|
||||
pub name: &'static str,
|
||||
pub priority: Priority,
|
||||
pub memory_pages: usize,
|
||||
pub hardware_caps: &'static [HardwareCap],
|
||||
pub endpoints: &'static [EndpointBinding],
|
||||
pub restartable: bool,
|
||||
pub binary: BinarySource,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct BootManifest {
|
||||
pub servers: &'static [ServerEntry],
|
||||
}
|
||||
|
||||
pub static SNAKE_MANIFEST: BootManifest = BootManifest {
|
||||
servers: &[
|
||||
ServerEntry {
|
||||
name: "log",
|
||||
priority: Priority::DEFAULT,
|
||||
memory_pages: 64,
|
||||
hardware_caps: &[],
|
||||
endpoints: &[EndpointBinding::Own { name: "log" }],
|
||||
restartable: true,
|
||||
binary: BinarySource::Storage { path: "/servers/log.elf" },
|
||||
},
|
||||
ServerEntry {
|
||||
name: "permission",
|
||||
priority: Priority::DEFAULT,
|
||||
memory_pages: 32,
|
||||
hardware_caps: &[],
|
||||
endpoints: &[EndpointBinding::Own { name: "permission" }],
|
||||
restartable: true,
|
||||
binary: BinarySource::Storage { path: "/servers/permission.elf" },
|
||||
},
|
||||
ServerEntry {
|
||||
name: "storage",
|
||||
priority: Priority::DEFAULT,
|
||||
memory_pages: 128,
|
||||
hardware_caps: &[],
|
||||
endpoints: &[EndpointBinding::Own { name: "storage" }],
|
||||
restartable: true,
|
||||
binary: BinarySource::Ram {
|
||||
base: PhysicalAddress::from_raw(0),
|
||||
size: 0,
|
||||
},
|
||||
},
|
||||
ServerEntry {
|
||||
name: "display",
|
||||
priority: Priority::DEFAULT,
|
||||
memory_pages: 256,
|
||||
hardware_caps: &[
|
||||
HardwareCap::Framebuffer {
|
||||
base: PhysicalAddress::from_raw(0x10008000),
|
||||
pages: 75,
|
||||
},
|
||||
],
|
||||
endpoints: &[EndpointBinding::Own { name: "display" }],
|
||||
restartable: true,
|
||||
binary: BinarySource::Storage { path: "/servers/display.elf" },
|
||||
},
|
||||
ServerEntry {
|
||||
name: "input",
|
||||
priority: Priority::DEFAULT,
|
||||
memory_pages: 32,
|
||||
hardware_caps: &[
|
||||
HardwareCap::Irq { irq: IrqId::from_raw(10) },
|
||||
],
|
||||
endpoints: &[EndpointBinding::Own { name: "input" }],
|
||||
restartable: true,
|
||||
binary: BinarySource::Storage { path: "/servers/input.elf" },
|
||||
},
|
||||
ServerEntry {
|
||||
name: "session",
|
||||
priority: Priority::DEFAULT,
|
||||
memory_pages: 64,
|
||||
hardware_caps: &[],
|
||||
endpoints: &[
|
||||
EndpointBinding::Own { name: "session" },
|
||||
EndpointBinding::ConnectTo { server: "display", endpoint: "display" },
|
||||
EndpointBinding::ConnectTo { server: "input", endpoint: "input" },
|
||||
EndpointBinding::ConnectTo { server: "storage", endpoint: "storage" },
|
||||
],
|
||||
restartable: true,
|
||||
binary: BinarySource::Storage { path: "/servers/session.elf" },
|
||||
},
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user