ahrightos-process 0.1.0

Portable process and scheduler primitives for the AhRightOS teaching kernel.
Documentation
  • Coverage
  • 0%
    0 out of 95 items documented0 out of 69 items with examples
  • Size
  • Source code size: 24.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 739.0 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • nullptr4

ahrightos-process

ahrightos-process contains the portable process-management primitives used by the AhRightOS teaching kernel: PID allocation, saved contexts, process control blocks, process states, and the round-robin scheduler.

The crate is no_std outside tests and intentionally avoids QEMU-specific entry code, so students can unit-test process behavior on the host before booting the full kernel.

ProcessContext publishes layout constants used by the RISC-V context-switch assembly, and the crate tests assert that the ABI offsets stay stable.

Lifecycle contracts

  • Parent child lists are de-duplicated so repeated bookkeeping cannot create phantom children.
  • RoundRobinScheduler::find_zombie_child is the reap path used by wait.
  • has_living_children intentionally excludes zombies: a zombie is reapable state, not a runnable/blocking child. This prevents wait from blocking after all remaining children have exited.
  • Kernel ELF loading now rejects non-ET_EXEC files and entry points outside PT_LOAD segments; AhRightOS does not claim a full Linux execve model yet.
flowchart LR
    Kernel[ahrightos-kernel] --> Process[ahrightos-process]
    Process --> PID[ProcessId]
    Process --> PCB[ProcessControlBlock]
    Process --> Context[ProcessContext]
    Process --> Scheduler[RoundRobinScheduler]