Strat9 Docs

This website is generated from:

  • mdBook pages for architecture and usage guides
  • rustdoc API pages for ABI and syscall crates

API reference

Local generation

bash tools/scripts/build-docs-site.sh
python3 -m http.server --directory build/docs-site 8000

ABI Overview

The canonical ABI definitions live in workspace/abi (strat9-abi crate).

Focus modules:

  • strat9_abi::syscall for syscall numbers
  • strat9_abi::data for shared wire/data structs
  • strat9_abi::flag for ABI-level flags
  • strat9_abi::errno for error codes
  • strat9_abi::boot for boot handoff ABI

API reference:

ABI Changelog

This page tracks ABI evolution for strat9-abi.

Versioning policy

  • Major (ABI_VERSION_MAJOR) changes only for incompatible wire/layout changes.
  • Minor (ABI_VERSION_MINOR) changes for backward-compatible additions.
  • No silent renumbering of existing syscall IDs.
  • repr(C) and explicit size checks are mandatory for exported ABI structs.

Current version

  • ABI_VERSION_MAJOR = 0
  • ABI_VERSION_MINOR = 1
  • Packed: 0.1

See:

Recent ABI updates (auto-generated)

  • 2026-03-09 ff0a36b Refactor memory management to use IRQ-disabled tokens
  • 2026-03-07 c3e8969 Fix race condition and lock
  • 2026-03-07 6191656 cargo fmt
  • 2026-03-07 8cd1410 Refactor memory allocation and deallocation in the kernel : per-CPU frame cach and a CPU-local BuddySet avoids the global lock in the common case.
  • 2026-03-04 04b384e fix(build): improve stage assembly error handling and warnings
  • 2026-03-03 2eb44c0 feat(task): replace FpuState with ExtendedState, support xsave/xrstor
  • 2026-03-03 ae5480a feat(silo): add silo attach for live debug output monitoring
  • 2026-03-03 8c0056a feat: expand and reorganize shell commands with new utilities for hardware, process, and VFS, and update boot ABI structures.
  • 2026-03-03 e9cce98 feat: Implement POSIX-compatible clock_gettime syscall and add call::open with POSIX O_* flag conversion.
  • 2026-03-03 04cbe05 feat: Add comprehensive VFS operation self-tests, refine VFS error handling, and improve IPC port cleanup.
  • 2026-03-03 2642cf8 docs: Add /// Implements doc comments to various functions across components for improved clarity.
  • 2026-03-03 ef0f1d7 docs: Add documentation comments to ABI and syscall components and enhance error handling in the documentation build script.
  • 2026-03-03 f314904 feat: Expand FileStat with additional POSIX fields and update kernel VFS schemes, and add a nonce to IpcHandshake.
  • 2026-03-03 769f3eb feat: Update syscall ABI with struct layout adjustments, error encoding clarification, and versioning.
  • 2026-03-03 c23a68a feat: Ensure Limine bootloader directories exist, use a real time source for setitimer, and add itimerval value validation.
  • 2026-03-03 ea80816 fix: Correct O_NOFOLLOW flag value and add length bounds checks to DirentIter initialization and name length assignment.
  • 2026-03-03 748f98c feat: Add pread and pwrite syscalls, enhance WASM proc_exit handling, and implement IPC port cleanup on task termination.
  • 2026-03-03 aa38e26 refactor: Change network syscall error for missing device, add user page fault trace budget, and zero demand-paged memory after mapping.
  • 2026-03-03 326613a feat: Add PCI and handle ABI types, improve user page fault error reporting, ensure identity mapping for demand-paged frames, and update the build target triplet.
  • 2026-03-03 52f3586 Enhance error handling by adding new error variants to the Error enum
  • 2026-03-03 6cf254d Refactor IPC message handling and update memory management logging
  • 2026-03-03 50d7f2f Enhance ABI structures and improve syscall error handling
  • 2026-03-03 607abac Enhance ABI introspection and improve syscall handling
  • 2026-03-03 deabb18 Enhance Strat9 ABI integration and update OpenFlags implementation
  • 2026-03-03 92ba1c6 Add strat9-abi as a workspace dependency and refactor bootloader integration
  • 2026-03-03 eb5de02 Refactor variable names in BuddyAllocator and sys_sigtimedwait for clarity
  • 2026-03-03 259bb9d Enhance PCI support and update related components
  • 2026-03-02 c57b44d Add strate-bus component and related build tasks.
  • 2026-03-01 8c7a98d Enhance QEMU GUI support and update related scripts
  • 2026-03-01 84fdb29 Update zerocopy dependency and refactor related code

Changelog entries

0.1

  • Introduced canonical strat9-abi crate as single source of truth.
  • Unified syscall numbers in strat9_abi::syscall.
  • Unified shared structs (TimeSpec, IpcMessage, FileStat, PCI types).
  • Added boot handoff ABI (KernelArgs, MemoryRegion, MemoryKind) with magic/version checks.
  • Added ABI introspection syscall SYS_ABI_VERSION.

Entry template

Use this template for future ABI entries:

### X.Y
- Added:
  - <new syscalls/types/flags>
- Changed (compatible):
  - <field additions, new constants, optional semantics>
- Changed (breaking):
  - <layout/numbering/semantic breaks>
- Migration notes:
  - <what userspace/kernel must update>

ABI Support Matrix

Status of relibc platform APIs on x86_64-unknown-strat9.

Legend: OK = implemented, Stub = returns ENOSYS, Partial = limited.

POSIX File I/O

APIStatusNotes
open / openatOKVia SYS_OPEN
readOKVia SYS_READ
writeOKVia SYS_WRITE
closeOKVia SYS_CLOSE
lseekOKVia SYS_LSEEK
preadOKVia SYS_PREAD
pwriteOKVia SYS_PWRITE
fstat / fstatatOKVia SYS_FSTAT / SYS_STAT
dup / dup2OKVia SYS_DUP / SYS_DUP2
pipe / pipe2OKVia SYS_PIPE
fcntlOKVia SYS_FCNTL
mkdir / mkdiratOKVia SYS_MKDIR
unlinkOKVia SYS_UNLINK
rmdirOKVia SYS_RMDIR
rename / renameatOKVia SYS_RENAME
linkOKVia SYS_LINK
symlinkOKVia SYS_SYMLINK
readlinkOKVia SYS_READLINK
chmod / fchmodOKVia SYS_CHMOD / SYS_FCHMOD
truncate / ftruncateOKVia SYS_TRUNCATE / SYS_FTRUNCATE
chdir / fchdirOKVia SYS_CHDIR / SYS_FCHDIR
getcwdOKVia SYS_GETCWD
getdentsOKVia SYS_GETDENTS
accessOKOpen + close probe
umaskOKVia SYS_UMASK
fsync / fdatasyncStubENOSYS
flockStubENOSYS
chown / fchown / lchownStubENOSYS
statvfs / fstatvfsStubENOSYS
mknod / mknodat / mkfifoatStubENOSYS

Process Management

APIStatusNotes
exitOKVia SYS_PROC_EXIT
forkOKVia SYS_PROC_FORK
execveOKVia SYS_PROC_EXEC
waitpidOKVia SYS_PROC_WAITPID
getpid / getppid / gettidOK
setsid / setpgid / getpgid / getsidOK
sched_yieldOKVia SYS_PROC_YIELD
nanosleepOKVia SYS_NANOSLEEP
clock_gettimeOKVia SYS_CLOCK_GETTIME
brkOKVia SYS_BRK
mmap / munmapOKVia SYS_MMAP / SYS_MUNMAP
unameOKVia SYS_PROC_UNAME
getuid / geteuid / getgid / getegidPartialReturns 0 (no UID model)
mprotect / mlock / munlockStubENOSYS
getrandomStubENOSYS

Signals

APIStatusNotes
killOKVia SYS_KILL
sigactionOKVia SYS_SIGACTION
sigprocmaskOKVia SYS_SIGPROCMASK
sigsuspendOKVia SYS_SIGSUSPEND
sigtimedwaitOKVia SYS_SIGTIMEDWAIT
getitimer / setitimerOKVia SYS_GETITIMER / SYS_SETITIMER
sigaltstackOKVia SYS_SIGALTSTACK

Network / Sockets

APIStatusNotes
socketpair (AF_UNIX)PartialBacked by pipe (unidirectional)
recvfrom / sendtoPartialDelegates to read/write
socket / bind / listen / accept / connectStubENOSYS
setsockopt / getsockoptStubENOSYS
shutdownStubENOSYS

Epoll

APIStatusNotes
epoll_create1PartialBacked by pipe fd
epoll_ctlStubNo-op
epoll_pwaitPartialSleeps, no real multiplexing

Syscall Layer

The userspace syscall crate is workspace/components/syscall (strat9-syscall).

Useful entry points:

  • strat9_syscall::call for high-level wrappers
  • strat9_syscall::number for syscall constants
  • strat9_syscall::error for userspace error mapping
  • strat9_syscall::data for shared data structs

API reference:

Publishing

One-command publication script

At repository root:

./publish-doc.sh

This script:

  1. builds docs (cargo make docs-site)
  2. regenerates ABI changelog auto section from git history
  3. commits/pushes current branch changes
  4. uploads built website to ggielly.github.io/strat9-os-docs

The docs builder publishes:

  1. mdBook pages under docs-site/
  2. rustdoc for all workspace crates (cargo doc --workspace --no-deps)
  3. a combined static site in build/docs-site