diff options
| author | Natasha Moongrave <natasha@256phi.eu> | 2026-04-08 16:45:40 +0200 |
|---|---|---|
| committer | Natasha Moongrave <natasha@256phi.eu> | 2026-04-08 16:45:40 +0200 |
| commit | c683e9ba28583c4650992394067422bb6cff75f6 (patch) | |
| tree | 19d7205b61d4fdcaecbbd67b4474675860676360 /flake.lock | |
| parent | af1089a4262414b64714b87180f2223c8a40918f (diff) | |
[Phase 2.2/2.3] SYSCALL/SYSRET MSR setup + syscall dispatcher
syscall/mod.rs:
- Configure STAR (kernel CS=0x08, user base=0x10), LSTAR, SFMASK (clear IF),
EFER.SCE to enable the SYSCALL/SYSRET instruction pair
- Naked assembly entry stub: swapgs, save/restore user RSP via per-CPU static,
remap r10→rcx for Linux arg4 convention, call Rust syscall_handler, sysretq
- validate_user_ptr(): bounds check for all user pointers (0..USER_ADDR_MAX)
- set_syscall_kernel_stack(): for scheduler to update per-CPU kernel RSP
syscall/dispatch.rs:
- dispatch(): routes syscall numbers; unknown → -ENOSYS (never panics)
- sys_write(fd, buf, count): fd 1/2 → serial; validates user ptr; read_volatile
loop avoids Rust aliasing assumptions on untrusted memory
- sys_exit(): serial log + hlt_loop() placeholder; Phase 2.5 adds scheduling
lib.rs: register syscall::init() + syscall::init_kernel_stack() in strix_os::init()
All existing integration tests pass.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'flake.lock')
0 files changed, 0 insertions, 0 deletions
