syscall: add sleep_ms; std getcwd returns root #28

Open
nonos-sync wants to merge 1 commit from nonos-sync/gh-220 into main AGit
Member

Adds a sleep_ms syscall that parks the caller until a deadline and yields, instead of forcing capsules to busy-spin the scheduler. Exposed through libc as mk_sleep_ms.

The std PAL getcwd previously returned an error, so unmodified crates.io tools that query the current directory at startup failed to initialize. It now returns "/".

Real boot evidence (verbatim serial output):

[SYSCALL-PROOF] PASS time-loop invalid-number invalid-pointer invalid-size retired-enosys
[SYSCALL-FUZZ] survived randomized syscall sweep
NONOS ran crates.io serde_json+regex+base64: os=nonos, nums sum=200, ok=true, regex hits=4, base64=bm9ub3M=

The syscall boundary survived 200k randomized calls with zero panics; the std stack (serde_json, regex, base64) runs unmodified once getcwd succeeds.

Verified: cargo check, microkernel-core, clean.


Opened on GitHub by eKisNonos as pull request 220. Review and merge happen there while this repository is kept in step from GitHub; this copy follows it, and is marked merged or closed when it is.

Adds a sleep_ms syscall that parks the caller until a deadline and yields, instead of forcing capsules to busy-spin the scheduler. Exposed through libc as mk_sleep_ms. The std PAL getcwd previously returned an error, so unmodified crates.io tools that query the current directory at startup failed to initialize. It now returns "/". Real boot evidence (verbatim serial output): [SYSCALL-PROOF] PASS time-loop invalid-number invalid-pointer invalid-size retired-enosys [SYSCALL-FUZZ] survived randomized syscall sweep NONOS ran crates.io serde_json+regex+base64: os=nonos, nums sum=200, ok=true, regex hits=4, base64=bm9ub3M= The syscall boundary survived 200k randomized calls with zero panics; the std stack (serde_json, regex, base64) runs unmodified once getcwd succeeds. Verified: cargo check, microkernel-core, clean. --- Opened on GitHub by eKisNonos as [pull request 220](https://github.com/NON-OS/nonos-micro-kernel/pull/220). Review and merge happen there while this repository is kept in step from GitHub; this copy follows it, and is marked merged or closed when it is.
Capsules had no way to wait without busy-spinning the scheduler. Add a
sleep_ms syscall that parks the caller until a deadline then yields, with
a libc mk_sleep_ms binding.

The std PAL getcwd returned an error, so unmodified crates.io tools that
query the working directory at startup bailed out. Return "/" so they
initialize.
This pull request has changes conflicting with the target branch.
  • src/syscall/abi/registry/mk.rs
  • src/syscall/contract/cap_table/mk.rs
  • src/syscall/microkernel/dispatch/process.rs
  • src/syscall/microkernel/numbers.rs
  • src/syscall/numbers/defs.rs
  • toolchain/nonos-std/sys/pal/nonos/os.rs
  • userland/libc/src/lib.rs
  • userland/libc/src/syscall/mod.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin +refs/pull/28/head:nonos-sync/gh-220
git switch nonos-sync/gh-220
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
NON-OS/nonos-micro-kernel!28
No description provided.