This also outlines a rough API for the checking and execution of syscalls. My only hesitation was that (as I've implemented it) the procedure table is assumed to be an always present part of the environment rather that passed around. Given that this is true (the storage is always there) and it allows us to write a very clean API, I think it's ok. As it stands the code in the kernel for handling syscalls is literally:
let syscall: SysCall = SysCall::deserialize(&mut input).unwrap();
let cap_ok = syscall.check_cap();
if cap_ok {
syscall.execute();
}
Which I think is decent. The implementation of each capability check (which is inherently different) is handled under the SysCall type.
This also outlines a rough API for the checking and execution of syscalls. My only hesitation was that (as I've implemented it) the procedure table is assumed to be an always present part of the environment rather that passed around. Given that this is true (the storage is always there) and it allows us to write a very clean API, I think it's ok. As it stands the code in the kernel for handling syscalls is literally:
Which I think is decent. The implementation of each capability check (which is inherently different) is handled under the
SysCall
type.