feat(kernel): SystemControl cap for halt, board device table + boot caps to init, RegionAddress syscall, idle loop services irqs

This commit is contained in:
2026-10-26 23:59:57 +01:00
parent 130a82f50d
commit bafc18a5f8
21 changed files with 626 additions and 53 deletions

View File

@@ -30,6 +30,11 @@ impl IrqRoutingTable {
}
}
/// Whether `irq` is a line this table can route.
pub fn is_valid(&self, irq: IrqId) -> bool {
(irq.raw() as usize) < MAX_IRQS
}
/// Routes `irq`, replacing any previous route. Fails for lines beyond
/// the table.
pub fn set(&mut self, irq: IrqId, route: IrqRoute) -> bool {

View File

@@ -8,4 +8,6 @@ pub enum Resource {
Process(ProcessId),
Interrupt(IrqId),
ProcessCreate,
/// Machine-wide controls such as halting; given only to init at boot.
SystemControl,
}

View File

@@ -84,6 +84,11 @@ pub enum Syscall {
va: VirtualAddress,
perms: PagePerms,
},
/// The physical base of the region named by `region`, so a driver can
/// point a device's DMA at memory it has mapped.
RegionAddress {
region: CapSlot,
},
/// Removes a capability from the caller's own table.
DropCap {
slot: CapSlot,
@@ -104,7 +109,10 @@ pub enum Syscall {
GetProcessId,
Yield,
Exit,
Halt,
/// Stops the machine; needs a SystemControl capability.
Halt {
control: CapSlot,
},
CreateEndpoint,
DebugPutchar {
byte: u8,