Implement domain and endpoint modules with capability management, message passing, and scheduling features

This commit is contained in:
2026-10-17 23:09:21 +02:00
parent 667bc7f7f7
commit 06b51b6712
25 changed files with 1064 additions and 24 deletions

View File

@@ -3,3 +3,12 @@ pub struct EntryPoint(usize);
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct StackPointer(usize);
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct VirtualAddress(usize);
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct DataRef {
addr: VirtualAddress,
len: usize,
}

View File

@@ -2,3 +2,4 @@ use crate::macros::bounded;
bounded!(CapSlot, u8, 0, 63);
bounded!(Priority, u8, 0, 31);
bounded!(PageCount, u16, 1, 1024);

View File

@@ -9,3 +9,27 @@ impl Ticks {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct TimerDuration(u32);
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct TimeSlice {
remaining: u32,
quantum: u32,
}
impl TimeSlice {
pub fn new(quantum: u32) -> Self {
Self {
remaining: quantum,
quantum,
}
}
pub fn tick(&mut self) -> bool {
self.remaining = self.remaining.saturating_sub(1);
self.remaining == 0
}
pub fn reset(&mut self) {
self.remaining = self.quantum;
}
}