feat(session-server): add session server for app launching, remove apps from init manifest
Init now only starts servers. The session server holds ProcessCreate cap and launches apps on demand. Snake is no longer in the boot manifest.
This commit is contained in:
@@ -94,14 +94,6 @@ pub fn boot(manifest: &BootManifest, create_cap: CapSlot) -> BootResult {
|
||||
}
|
||||
}
|
||||
|
||||
for app in manifest.apps {
|
||||
let _pid = syscall::create_process(create_cap.value() as usize);
|
||||
|
||||
for (_server_name, endpoint_name) in app.connects_to {
|
||||
let _ep = endpoints.find(endpoint_name);
|
||||
}
|
||||
}
|
||||
|
||||
BootResult {
|
||||
storage_endpoint,
|
||||
create_cap,
|
||||
|
||||
@@ -32,19 +32,9 @@ pub struct ServerEntry {
|
||||
pub binary: BinarySource,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct AppEntry {
|
||||
pub name: &'static str,
|
||||
pub priority: Priority,
|
||||
pub memory_pages: usize,
|
||||
pub connects_to: &'static [(&'static str, &'static str)],
|
||||
pub binary: BinarySource,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct BootManifest {
|
||||
pub servers: &'static [ServerEntry],
|
||||
pub apps: &'static [AppEntry],
|
||||
}
|
||||
|
||||
pub static SNAKE_MANIFEST: BootManifest = BootManifest {
|
||||
@@ -104,14 +94,19 @@ pub static SNAKE_MANIFEST: BootManifest = BootManifest {
|
||||
restartable: true,
|
||||
binary: BinarySource::Storage { path: "/servers/input.elf" },
|
||||
},
|
||||
],
|
||||
apps: &[
|
||||
AppEntry {
|
||||
name: "snake",
|
||||
ServerEntry {
|
||||
name: "session",
|
||||
priority: Priority::DEFAULT,
|
||||
memory_pages: 64,
|
||||
connects_to: &[("display", "display"), ("input", "input")],
|
||||
binary: BinarySource::Storage { path: "/apps/snake.elf" },
|
||||
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