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:
2026-10-18 04:26:42 +02:00
parent d43c6a7e74
commit 7649cb0b18
21 changed files with 188 additions and 0 deletions

View File

@@ -8,3 +8,15 @@ pub mod server;
#[cfg(test)]
#[path = "tests/mod.rs"]
mod tests;
pub fn run() -> ! {
#[cfg(feature = "qemu-virt")]
let fb = adapters::qemu_virtio::VirtioFramebuffer::new(0x10008000);
#[cfg(not(feature = "qemu-virt"))]
let fb = adapters::mock::MockFramebuffer::new(320, 240);
let mut srv = server::DisplayServer::new(fb);
server_framework::serve(&mut srv, 0);
loop { userspace::syscall::yield_now(); }
}

View File

@@ -0,0 +1,9 @@
#![no_std]
#![no_main]
extern crate userspace_rt;
#[unsafe(no_mangle)]
extern "C" fn main() {
display_server::run();
}