feat(storage): full file protocol over per-client shared region (badged clients, owned handles, clamped lengths, ReadOnly on unwritable disk); init loads via libkos::fs; drop boot shared buffer
This commit is contained in:
@@ -106,9 +106,6 @@ boot_page_table:
|
||||
"#
|
||||
);
|
||||
|
||||
const SHARED_BUF_VA: usize = 0x30000;
|
||||
const SHARED_BUF_PAGES: usize = 16;
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
extern "C" fn kmain(hart: usize) -> ! {
|
||||
let uart = Uart::new();
|
||||
@@ -121,10 +118,7 @@ extern "C" fn kmain(hart: usize) -> ! {
|
||||
let mut blk =
|
||||
boot::hardware::probe_block_device(&uart).unwrap_or_else(|| halt(&uart, "no block device"));
|
||||
|
||||
let (init, init_thread) = boot::loader::load_init(&uart, &mut blk);
|
||||
if let Some(ctx) = kern_mut().thread_context_mut(init_thread) {
|
||||
ctx.registers_mut()[10] = SHARED_BUF_VA;
|
||||
}
|
||||
let (init, _) = boot::loader::load_init(&uart, &mut blk);
|
||||
let storage = boot::loader::load_server(&uart, &mut blk, b"storage.elf", "storage");
|
||||
let display = boot::loader::load_server(&uart, &mut blk, b"display.elf", "display");
|
||||
let input = boot::loader::load_server(&uart, &mut blk, b"input.elf", "input");
|
||||
@@ -133,13 +127,6 @@ extern "C" fn kmain(hart: usize) -> ! {
|
||||
kern_mut()
|
||||
.register_board(init.pid, &board)
|
||||
.unwrap_or_else(|_| halt(&uart, "board registration failed"));
|
||||
devices::shared_buffer(
|
||||
&uart,
|
||||
init.pid,
|
||||
storage.pid,
|
||||
SHARED_BUF_VA,
|
||||
SHARED_BUF_PAGES,
|
||||
);
|
||||
devices::display_quota(&uart, display.pid);
|
||||
boot::caps::grant_all(&uart, init.pid, storage.pid, display.pid, input.pid);
|
||||
// After grant_all, so the slots init already relies on stay put.
|
||||
|
||||
Reference in New Issue
Block a user