feat: add run() and binary entry points for all servers and init
Every server now has lib.rs (testable) + main.rs (deployable binary). Binary is 3 lines: extern crate userspace_rt + call run(). Hardware servers use feature flags for adapter selection. 9 RISC-V binaries ready for the disk image.
This commit is contained in:
@@ -5,3 +5,12 @@ pub mod manifest;
|
||||
pub mod protocol_helpers;
|
||||
pub mod shutdown;
|
||||
pub mod supervisor;
|
||||
|
||||
pub fn run() -> ! {
|
||||
let create_cap = types::bounded::CapSlot::new(0)
|
||||
.unwrap_or_else(|| unreachable!());
|
||||
|
||||
let result = boot::boot(&manifest::SNAKE_MANIFEST, create_cap);
|
||||
let mut sup = boot::create_supervisor(&manifest::SNAKE_MANIFEST, &result);
|
||||
sup.run(create_cap);
|
||||
}
|
||||
|
||||
9
crates/init/src/main.rs
Normal file
9
crates/init/src/main.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
extern crate userspace_rt;
|
||||
|
||||
#[unsafe(no_mangle)]
|
||||
extern "C" fn main() {
|
||||
init::run();
|
||||
}
|
||||
Reference in New Issue
Block a user