From eab576b7ed439a91dfc49be04c82cd5caf633752 Mon Sep 17 00:00:00 2001 From: vasilito Date: Thu, 9 Jul 2026 15:08:26 +0300 Subject: [PATCH] kernel: log unknown syscall numbers before returning ENOSYS Added println! to the syscall dispatch catch-all to log the unknown syscall number and arguments when returning ENOSYS. Previously any unrecognized syscall number silently returned ENOSYS with no diagnostic, making it impossible to discover missing syscall implementations without application-level debugging. Found by comprehensive disguised-stub audit (47 patterns, 37 actionable). This is the most impactful remaining fix from that audit. --- src/syscall/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/syscall/mod.rs b/src/syscall/mod.rs index 7233c8d8a0..b2f93d8e4f 100644 --- a/src/syscall/mod.rs +++ b/src/syscall/mod.rs @@ -276,7 +276,10 @@ pub fn syscall( SYS_MPROTECT => mprotect(b, c, MapFlags::from_bits_truncate(d), token).map(|()| 0), SYS_MREMAP => mremap(b, c, d, e, f, token), - _ => Err(Error::new(ENOSYS)), + _ => { + println!("KERNEL: unimplemented syscall a={:#x} b={:#x} c={:#x} d={:#x}", a, b, c, d); + Err(Error::new(ENOSYS)) + } } }