feat: add Halt syscall, fault notification to fault handler, supervisor with back-off, shutdown with timeout

- Halt syscall: only pid 0 (init) can halt, adapter uses SBI SRST
- Fault notification: kernel delivers fault info to process fault handler endpoint before killing
- Supervisor: tracks restart counts, back-off up to 5 restarts
- Shutdown: notifies servers, waits with timeout, calls halt
- Trap handler: faults now call kernel.handle_fault instead of halting
This commit is contained in:
2026-10-18 03:29:05 +02:00
parent a83b53d962
commit b7bc223a79
13 changed files with 232 additions and 6 deletions

View File

@@ -8,3 +8,23 @@ pub enum Fault {
MemoryFault { address: VirtualAddress },
IllegalInstruction,
}
impl Fault {
pub fn code(&self) -> usize {
match self {
Fault::CapabilityViolation { .. } => 0,
Fault::InvalidCapability { .. } => 1,
Fault::RevokedCapability { .. } => 2,
Fault::InvalidSyscall => 3,
Fault::MemoryFault { .. } => 4,
Fault::IllegalInstruction => 5,
}
}
pub fn address(&self) -> usize {
match self {
Fault::MemoryFault { address } => address.raw(),
_ => 0,
}
}
}

View File

@@ -86,4 +86,5 @@ pub enum Syscall {
GetProcessId,
Yield,
Exit,
Halt,
}