feat(storage): scoped grants (subtree, ro/rw), narrow-only, release revokes all holders; IPC KEEP_DELEGATE opt-in; shell cd/pwd, programs get ro cwd

This commit is contained in:
2026-10-27 20:20:34 +01:00
parent c603a578c0
commit 1fc5a54f06
38 changed files with 1237 additions and 170 deletions

View File

@@ -2,6 +2,7 @@
mod tests;
use crate::codec::{Decode, Encode};
use libkos::syscall::Give;
use types::bounded::CapSlot;
/// The reply to a request that does not decode. No protocol uses this
@@ -27,7 +28,7 @@ pub trait Server {
_badge: usize,
words: [usize; 4],
_cap: Option<CapSlot>,
) -> ([usize; 4], Option<CapSlot>) {
) -> ([usize; 4], Option<Give>) {
match Self::Request::decode(words) {
Some(request) => (self.handle(request).encode(), None),
None => ([MALFORMED, 0, 0, 0], None),
@@ -68,6 +69,10 @@ pub trait Server {
/// has nobody left to serve, so it says why and exits.
pub fn serve<S: Server>(server: &mut S, endpoint: CapSlot) -> ! {
let error = server.run(endpoint);
libkos::println!("server: endpoint {} unusable ({:?}), exiting", endpoint.value(), error);
libkos::println!(
"server: endpoint {} unusable ({:?}), exiting",
endpoint.value(),
error
);
libkos::syscall::exit()
}