Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MINIX 3 Source Mapping

This chapter maps MINIX 3 source files and concepts to their minix.rs equivalents — a navigation aid if you are coming from the MINIX 3 codebase or Tanenbaum’s Operating Systems: Design and Implementation. Only paths that exist in the tree today are listed as real; everything else is grouped under Planned so the table never points at a file that isn’t there.

Some rows cite 64-bit paths in the MINIX 3 tree (e.g. lib/libc/arch/x86_64/). MINIX 3 shipped only as a 32-bit OS; a working 64-bit MINIX 3 was a personal prototype by this project’s author, not an upstream release. These are cited as an ABI/source reference only — see the note in IPC.

Kernel

MINIX 3minix.rs
kernel/proc.cmini_sendkernel/src/ipc/send.rs
kernel/proc.cmini_receivekernel/src/ipc/receive.rs
kernel/proc.cmini_notifykernel/src/ipc/notify.rs
kernel/proc.cmini_sendakernel/src/ipc/senda.rs (stub)
kernel/proc.cdeadlockkernel/src/ipc/deadlock.rs
kernel/proc.cdo_ipckernel/src/ipc/mod.rs
kernel/proc.hstruct prockernel/src/proc/proc_struct.rs (static tables in table.rs)
kernel/priv.hstruct privkernel/src/proc/priv_struct.rs
kernel/system.ckernel/src/system/mod.rs
kernel/system/do_fork.ckernel/src/system/do_fork.rs
kernel/system/do_exec.ckernel/src/system/do_exec.rs
kernel/system/do_vmctl.ckernel/src/system/do_vmctl.rs
kernel/system/do_copy.c, do_irqctl.ckernel/src/system/stubs.rs (stub handlers)
kernel/clock.ckernel/src/clock.rs
kernel/interrupt.ckernel/src/arch/aarch64/irq.rs, gic.rs
kernel/main.ckmainkernel/src/main.rs
kernel/table.c — boot tablekernel/src/boot_image/mod.rs
kernel/arch/i386/head.Skernel/src/arch/aarch64/entry.S
kernel/arch/i386/mpx.S — context switchkernel/src/arch/aarch64/context.rs
kernel/arch/i386/protect.c — vectorskernel/src/arch/aarch64/exception.rs
kernel/arch/i386/memory.c — page tableskernel/src/arch/aarch64/mmu.rs, addrspace.rs

Shared headers

MINIX 3minix.rs
include/minix/ipc.hkernel-shared/src/message.rs
include/minix/ipcconst.hkernel-shared/src/ipc_const.rs
include/minix/com.hkernel-shared/src/com.rs
include/minix/callnr.hkernel-shared/src/callnr.rs
include/minix/type.hendpoint_tkernel-shared/src/endpoint.rs
error codeskernel-shared/src/error.rs
signal numberskernel-shared/src/signal.rs

The arrow runs both ways for the first four rows: tools/gen-c-headers generates minix/{ipc,com,callnr,errno}.h back out of those Rust modules for the musl fork to include, so C never gets a hand-maintained copy of the ABI.

Errno numbering is minix.rs’s own policy rather than a port of either reference tree (phase-5 decision D7): the POSIX block 1..=40 uses classic book-era MINIX values — identical to Linux/musl, which is what lets musl’s stock bits/errno.h work unmodified — while the MINIX-specific IPC errnos take modern MINIX 3’s 200-band values, clear of Linux’s entire range. Both are stored negated in Rust. EBADSRCDST is the one name modern MINIX lacks; it takes the value of that tree’s EBADEPT (216).

Runtime and libraries

MINIX 3minix.rs
lib/libsys/sef.cserver-rt/src/sef.rs
lib/libsys/sef_init.cserver-rt/src/init.rs
lib/libsys/sef_signal.cserver-rt/src/signal.rs
SEF message classifierserver-rt/src/classify.rs
DS publish glueserver-rt/src/ds.rs
lib/libsys/kernel_call.cminix-ipc/src/lib.rs

Servers

MINIX 3minix.rs
servers/pm/main.c, forkexit.c, exec.c, signal.cservers/pm/src/main.rs
servers/pm/ — process tableservers/pm/src/mproc.rs
servers/vfs/main.cservers/vfs/src/main.rs (skeletal)
servers/vm/main.cservers/vm/src/main.rs
servers/vm/region.cservers/vm/src/region.rs
servers/rs/main.cservers/rs/src/main.rs
servers/rs/manager.c — monitoringservers/rs/src/monitor.rs
servers/ds/main.cservers/ds/src/main.rs
servers/ds/store.cservers/ds/src/registry.rs
servers/sched/main.cservers/sched/src/main.rs
servers/sched/schedule.c — policyservers/sched/src/policy.rs

Build system

MINIX 3minix.rs
build.sh, NetBSD Makefilesroot Cargo.toml workspace + .cargo/config.toml
releasetools/tools/qemu-run.sh, tools/check-boot-log.sh

Planned

These MINIX 3 areas have no minix.rs counterpart in the tree yet; the paths below are the intended destinations (see Roadmap):

MINIX 3minix.rs (planned)
include/minix/safecopies.h — grantsgrant table + SYS_SAFECOPY (Phase 5)
lib/libc/sys/syscall.c, _ipc.S, open.c, …the musl fork (musl/src/minix/*)
lib/libblockdriver/, lib/libchardriver/drivers/driver-rt traits
servers/vfs/{open,read,path,mount}.cVFS I/O (VFS is one main.rs today)
servers/mfs/, servers/pfs/fs/mfs, fs/pfs (stubs)
drivers/storage/*, drivers/net/*, drivers/tty/drivers/virtio-*, drivers/memory (stubs)
disk-image tooling(no root disk yet — see Boot)

Concepts unchanged

These MINIX 3 concepts carry over directly and are live today:

  • Message-passing IPC with fixed-size (104-byte) messages.
  • Five live IPC primitives — SEND, RECEIVE, SENDREC, NOTIFY, SENDNB (SENDA is stubbed).
  • Endpoint-based process identification with generation numbers.
  • Privilege bitmaps (trap_mask, ipc_to, k_call_mask).
  • SEF server lifecycle (init, ping, signal).
  • An embedded boot image (MXBI). Startup is not hand-ordered, though — servers rendezvous at run time through DS.
  • RS heartbeat monitoring (restart-on-crash is detect-only so far).
  • DS as the name → endpoint registry.

Carried over in design but not yet realized: grant-based safe copy, the BDEV/CDEV driver protocols, and the REQ_* VFS ↔ FS protocol.

Concepts changed

MINIX 3minix.rsWhy
raw C pointers in IPC queuesOption<ProcNr> indicesmemory safety
m1i1 / m2l1 message fieldsnamed typed structsreadability
EXTERN macro globalsmodule-scoped staticsRust idiom
RTS_SET / RTS_UNSET macrosrts_set / rts_unset fnstype safety
volatile flagsAtomicU32Rust atomics
integer error returnsResult<T, E>Rust error handling
#ifdef arch selectioncfg(target_arch)Rust conditional compilation
NetBSD libc / userlandmusl fork / Rust userland (planned)BSD license, minimal