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:
@@ -10,3 +10,17 @@ pub mod server;
|
||||
#[cfg(test)]
|
||||
#[path = "tests/mod.rs"]
|
||||
mod tests;
|
||||
|
||||
pub fn run() -> ! {
|
||||
#[cfg(feature = "qemu-virt")]
|
||||
{
|
||||
let device = adapters::mock_block::MockBlockDevice::new(64);
|
||||
let filesystem = fs::fat16::Fat16::mount(device);
|
||||
if let Some(mut fs) = filesystem {
|
||||
let mut srv = server::StorageServer::new(fs);
|
||||
server_framework::serve(&mut srv, 0);
|
||||
}
|
||||
}
|
||||
|
||||
loop { userspace::syscall::yield_now(); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user