feat(init): implement supervisor with storage-backed restart, binary source tracking, and back-off delays
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use types::address::PhysicalAddress;
|
||||
use types::bounded::{CapSlot, Priority};
|
||||
use types::bounded::Priority;
|
||||
use types::id::IrqId;
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
@@ -15,6 +15,12 @@ pub enum EndpointBinding {
|
||||
ConnectTo { server: &'static str, endpoint: &'static str },
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum BinarySource {
|
||||
Ram { addr: usize, len: usize },
|
||||
Storage { path: &'static str },
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct ServerEntry {
|
||||
pub name: &'static str,
|
||||
@@ -23,6 +29,7 @@ pub struct ServerEntry {
|
||||
pub hardware_caps: &'static [HardwareCap],
|
||||
pub endpoints: &'static [EndpointBinding],
|
||||
pub restartable: bool,
|
||||
pub binary: BinarySource,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -31,6 +38,7 @@ pub struct AppEntry {
|
||||
pub priority: Priority,
|
||||
pub memory_pages: usize,
|
||||
pub connects_to: &'static [(&'static str, &'static str)],
|
||||
pub binary: BinarySource,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -48,6 +56,7 @@ pub static SNAKE_MANIFEST: BootManifest = BootManifest {
|
||||
hardware_caps: &[],
|
||||
endpoints: &[EndpointBinding::Own { name: "log" }],
|
||||
restartable: true,
|
||||
binary: BinarySource::Storage { path: "/servers/log.elf" },
|
||||
},
|
||||
ServerEntry {
|
||||
name: "permission",
|
||||
@@ -56,6 +65,16 @@ pub static SNAKE_MANIFEST: BootManifest = BootManifest {
|
||||
hardware_caps: &[],
|
||||
endpoints: &[EndpointBinding::Own { name: "permission" }],
|
||||
restartable: true,
|
||||
binary: BinarySource::Storage { path: "/servers/permission.elf" },
|
||||
},
|
||||
ServerEntry {
|
||||
name: "storage",
|
||||
priority: Priority::DEFAULT,
|
||||
memory_pages: 128,
|
||||
hardware_caps: &[],
|
||||
endpoints: &[EndpointBinding::Own { name: "storage" }],
|
||||
restartable: true,
|
||||
binary: BinarySource::Ram { addr: 0, len: 0 },
|
||||
},
|
||||
ServerEntry {
|
||||
name: "display",
|
||||
@@ -69,6 +88,7 @@ pub static SNAKE_MANIFEST: BootManifest = BootManifest {
|
||||
],
|
||||
endpoints: &[EndpointBinding::Own { name: "display" }],
|
||||
restartable: true,
|
||||
binary: BinarySource::Storage { path: "/servers/display.elf" },
|
||||
},
|
||||
ServerEntry {
|
||||
name: "input",
|
||||
@@ -79,6 +99,7 @@ pub static SNAKE_MANIFEST: BootManifest = BootManifest {
|
||||
],
|
||||
endpoints: &[EndpointBinding::Own { name: "input" }],
|
||||
restartable: true,
|
||||
binary: BinarySource::Storage { path: "/servers/input.elf" },
|
||||
},
|
||||
],
|
||||
apps: &[
|
||||
@@ -87,6 +108,7 @@ pub static SNAKE_MANIFEST: BootManifest = BootManifest {
|
||||
priority: Priority::DEFAULT,
|
||||
memory_pages: 64,
|
||||
connects_to: &[("display", "display"), ("input", "input")],
|
||||
binary: BinarySource::Storage { path: "/apps/snake.elf" },
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user