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

@@ -4,3 +4,5 @@ version = "0.1.0"
edition = "2024"
[dependencies]
types = { workspace = true }
domain = { workspace = true }

View File

@@ -1,14 +1,23 @@
pub fn add(left: u64, right: u64) -> u64 {
left + right
}
#![no_std]
#[cfg(test)]
mod tests {
use super::*;
use domain::{resource::MemoryRegion, thread::SavedContext};
use types::{
address::{EntryPoint, StackPointer},
id::{CoreId, IrqId, ProcessId},
time::{Ticks, TimerDuration},
};
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
pub trait PlatformContext: Copy + Default {}
pub trait Platform {
fn configure_protection(&mut self, process: ProcessId, regions: &[MemoryRegion]);
fn context_switch(&mut self, from: &mut SavedContext, to: &SavedContext);
fn enable_user_mode(&mut self, entry: EntryPoint, stack: StackPointer) -> !;
fn set_timer(&mut self, duration: TimerDuration);
fn current_ticks(&self) -> Ticks;
fn mask_irq(&mut self, irq: IrqId);
fn unmask_irq(&mut self, irq: IrqId);
fn send_ipi(&mut self, target: CoreId);
fn core_id(&self) -> CoreId;
fn num_cores(&self) -> u8;
}