All documentation
Start here
Kernel parameters
docs/kernel-parameters.mdView on GitHubSpace-separated key=value pairs. Set them on the GRUB command line on
x86-64 (build/grub.cfg, the multiboot2 line) or with QEMU -append on
arm64 (scripts/qemu-arm64.sh). Parsing lives in
src/base/kernel/parameters.cpp.
Nothing on the command line stops the boot. An unknown key, a known key with
a value it does not recognise, and a parameter that cannot be parsed at all
— no =, nothing before or after it, a bare word other than ro, longer
than 48 characters — are each logged and skipped, and the rest of the line
is still read, as Linux does. The whole line is capped at 255 characters; a
longer one is read up to its last whole parameter, since half of one is a
different one. The warnings land in dmesg, which the
netconsole replays from the start of the boot.
The defaults the shipped configs use are dhcp=auto dns=on root=auto fstest=on on the x86-64 ISO, console=serial dhcp=auto dns=on root=auto on
the disk image, dhcp=auto dns=on root=auto on arm64 (scripts/qemu-arm64.sh),
and root=UUID=<partition> dhcp=auto dns=on on a server the system image is
poured onto (Install) -- where the interfaces' settings are its root's
/etc/net.toml and not those words (Networking, below). None of them starts the UDP shell: it
runs any command for anyone who can send the machine a datagram, so it is on
only where udpshell= is given -- nos-install --udpshell,
NOS_UDPSHELL=9000 ./scripts/qemu-arm64.sh, a test's own command line.
CPUs
smp=off— disable SMP, run on BSP onlymaxcpus=N— bring up at most N CPUs, the BSP included (maxcpus=2= BSP + one AP); the rest stay parked. Bisects an SMP bring-up failure without giving up SMP entirelyhwp=off— x86-64: leave every CPU's clock where firmware left it, rather than turning on hardware P-states (HWP) and letting the CPU pick its own up to its turbo. Firmware's is usually the base clock: the EX44's cores ran at 2.5 GHz with it, their turbo being 4.8. See Boothwp_epp=N— x86-64, with HWP: the energy/performance preference each CPU's clock is picked by, 0 (performance) to 255 (energy), 128 -- intel_pstate'sbalance_performance-- by defaultc1e=firmware— x86-64: leave C1E auto-promotion as firmware set it. By default nos turns it off on an Intel CPU it idles by MWAIT on bare metal (with HWP, which says the part has the register): with it on, every C1 the idle asks for -- and it asks for C1 whenever its idles are short, which a CPU running a guest's vCPU or its disk always is -- becomes C1E, the core's voltage and clock dropped while it waits, which it takes microseconds to climb back from at each wake. Linux'sintel_idlemakes the same choice (itsc1e_promotion). The boot says what firmware had (cpu: C1E auto-promotion on by firmware, now off)idle=halt— x86-64: an idle CPU halts (HLT), and nothing else. By default an idle CPU sleeps by MWAIT with interrupts masked, so that how long each idle lasted is known exactly, and in the deepest C-state MWAIT offers (CPUID leaf 5) once its last four idles each lasted 2 ms or more and its next timer is as far off; short of that, in MWAIT's C3 -- a core's C6, its wake a hundred or two microseconds -- once its next timer is 1 ms off or more, unless a guest's vCPU or disk holds the CPU (kernel_cpu_performance,kernel_cpu_latency); in C1, as a halt, otherwise: a CPU woken often by what no timer predicts -- a disk's completions, a vCPU's IPIs -- so stays where a wake is quick, rather than pay a deep C-state's exit, hundreds of microseconds on a desktop part's C10, at every one. With only the deepest state and C1, the EX44's busy vCPU core ran at 4.55 GHz while idle P-cores' threads spent 36-99% of the window in C1, where under Linux the same core ran at 4.8 (round 23'scpufreq): a core that is not deep counts among the busy ones a busy core's turbo is figured from. That is on bare metal, where the CPU has MONITOR/MWAIT with an interrupt ending it though masked, C-states in leaf 5 and an APIC timer that runs in every C-state (ARAT); anywhere else -- under a hypervisor, on AMD's parts, which list no C-state there -- it halts anyway. A busy core then runs at the turbo of few busy cores: the EX44's P-cores ran at 4.46 GHz with every idle core halted and at 4.46-4.72 with them asleep deep, where Linux's ran at 4.77 -- CPU-bound work 2-3% faster, nothing measured slower (plans/vm-performance.md).idle=mwaitsays the defaultucode=off— x86-64: load no microcode from the module GRUB put beside the kernel (module2 /boot/ucode ucode, which Install sets up); every CPU runs the revision firmware loaded. See Bootsplitlock=off— x86-64: leave split lock detection off. By default every CPU that has it turns it on (IA32_CORE_CAPABILITIESbit 5, behind CPUID leaf 7's EDX bit 30: Intel's parts since Ice Lake's servers and Tremont -- of the machines here the EX44's and Hertz's), and a split lock -- a locked access across two cache lines, which takes the bus from every core while it runs -- then raises #AC: in the kernel a panic that names it, in a guest ofhv's a line in/logs/hv.log, one a VM every five seconds at most, the guest stepped past it with the detection off for that instruction alone. The boot says how many CPUs detect them (cpu: split lock detection on N of M cpus);panic splitlockmakes one. See Boot
Memory
-
hugepages=N%/hugepages=NG/hugepages=NM— reserve that share of RAM, or that much of it, at boot as the huge pool: 2 MiB blocks, physically contiguous and aligned, taken off the free list right after it is built -- before anything has fragmented it -- the highest first, and kept for guests' memory alone (e.g.hugepages=50%,hugepages=32G). With a pool, every guest's memory is the pool's, each block one entry of its nested page table -- 2 MiB of TLB where a frame gives 4 KiB -- and a guest the pool has not room for does not start, saying how many blocks it wanted and how many are free; without one, a guest's memory is 4 KiB frames, as it always was. What is asked is cut down to leave twice the kernel's reserve free (a sixteenth of RAM, and no less than 64 MiB, twice over), and the boot says what it took:mm: hugepages: N 2MiB blocks reserved (M MiB) of K asked.meminfo,memusageandhv infoshow the pool. A block is the pool's for as long as the machine is up, guest or no guest. See The hypervisor -
zerofree=on|off|verify— the zeroing of free pages ahead of their allocation.on, the default: two tasks of the lowest priority zero free pages -- 4 KiB ones and the huge pool's free blocks -- while nothing else wants the CPU they are on, so that what a guest leaves in its memory is gone from RAM within seconds of its end, and a guest's memory is taken from pages known zero first.off: no task; every page is zeroed as it is handed out, as it always was.verify: ason, and every page and block an allocation takes as zeroed is read first, a word that is not zero a panic naming the page -- a free page written to, a use after free, caught before it reaches a guest.memusagesays how much of what is free is zeroed. See Paging -
heapcheck=on— a debugging mode for a use after free in the heap: every block the page allocator hands the heap (an allocation of half a page and more) is unmapped the moment it is freed, nothing is kept for reuse, and its address is held back from the next allocations of its size for 1024 frees of that size -- or for fewer where the size has fewer addresses than that to spare: no more than half of them are held back at once. A read or a write through a freed block -- which otherwise lands in whoever has the memory next, silently -- is then a page fault whose backtrace is the culprit's. Off by default: every such free is a TLB shootdown. Smaller allocations, from the pools, are not covered -
memsites=on— the allocation-site tracker on from the first of Rust's allocations: every block Rust's allocator takes is given the stack that asked for it, formemsitesto read the heap by -- which code holds what, to the file and the line withscripts/memsites.py(memsites). Off by default: on, an allocation pays a walk of its frames and a look in the table of stacks.memsites onstarts it later, the blocks from before then without a site
Console and logging
console=serial— shell input and output on the serial port onlyconsole=vga— shell input and output on the screen only (VGA text or framebuffer)console=both— both (the default); listed for completenesstrace=vga— x86-64 only: mirror the boot trace on the screen as well as the serial port. Off by default because redrawing glyphs costs a full repaint per scrolled row; on a machine with no UART the mirror is the default anyway, since there is nowhere else to put ittracepoints=<list>— events to record from the boot on (kernel/tracepoint.h): their names, their groups orall, comma-separated -- turned on as the boot ends, once every CPU has its ring, and said so in the log; a name it does not know is said too.tracein the shell changes them afterwards. See Tracepointsloglevel=N— log level to boot with (0-5, default 1). Theloglevelshell command moves it afterwards, but only a boot parameter can make the boot chatty; the task lifecycle and the multitasking self-test are at level 3netconsole=ip:port— stream the kernel log over UDP to that collector (e.g.netconsole=10.0.2.2:6666); needs an address -- a lease's (dhcp=auto), or a static one,/etc/net.toml's orip='s (Networking, below), put on eth0 before the netconsole sends a line. See Netconsolenctail=N— ship only the newest N KiB of the log buffered before the link came up (e.g.nctail=16); the rest is dropped. For a machine that wedges shortly after the network appears, this spends the little airtime it has on the lines around the wedge instead of on the head of the boot logdisklog=on— write the kernel log, from its first line, to a disk area laid down withscripts/disklog.py format: for a machine with no serial port whose boot stops before its network is up. The boot so far is written when the area is found and every line after by a task of its own, so nothing that traces waits on the disk; a panic report goes down too. Off by default, since every burst of lines is a forced disk write. It takes both, the parameter and a prepared area: without the parameter no disk is so much as read, and with it but no area found the boot logsdisk_log: disklog=on, but no prepared area on any diskand carries on without.disklogin the shell says which. It works on both architectures;tests/disklog-test.pyis its test. While the log runs the area is its own: a mount of it, or of the disk it is on, and ablkloadwrite test are refused. See Real hardwarepanic=vga— parsed and currently has no effect: the panic report already goes to the screen whenever one is ready, on both architecturespanic=N— reset the machine N seconds (1–3600) after a panic's report has gone out: to the screen and the serial port, and flushed to the netconsole and the disk log. Timed on the cycle counter; a panic before it is calibrated resets at once. 0, the default, keeps the machine stopped with the report on its screen. For a machine whose only console is the network: the system image's GRUB entries passpanic=10, so a server whose one-shot nos boot dies is back on its own OS by itself (Install)deadman=N— a boot on trial: N seconds (10–86400) into the boot the kernel panics, its report saying why, unless the shell'sdeadman offcame first -- and withpanic=Mthe machine resets M seconds later. For a server whose only console is its network, booted into nos once to try something: a nos that panics resets bypanic=alone, but one that never reaches the network, or wedges where no watchdog looks -- its disks gone,/etc/rcstuck -- would sit there until somebody reset it by hand; withdeadman=it is back on its own OS by itself, and netconsole and the disk log say what became of it. Not for a machine that boots nos every time: unless its/etc/rcsaysdeadman off, that is a reset every N seconds.deadman Nsets the deadline N seconds from now,deadmansays where it stands (Shell commands)
Networking
The interfaces' settings -- static addresses or DHCP, the default route,
additional routes and the resolver -- are /etc/net.toml's on the root
where there is one: what nos-install writes on a server (The
network), read once the root is mounted and before
anything sends. ip=, gw=, dns= and dhcp= are what a boot with no
such file goes by -- an ISO's, QEMU's, a test's, a root that was not found,
a kernel from before the file -- and one whose file is refused, which the
boot says with the file's line. They configure eth0 alone. Where the file
is taken they are not used, and the boot names them (net: the command line's ... not used). The network layer reads both
(layers/net/src/settings.rs), through the same checks; net says which
it took.
dhcp=auto— start DHCP oneth0automatically at bootdhcp=off— disable DHCP entirely (even via shell command)dhcp=on— enable DHCP only via shell command (default)dns=on— enable DNS resolver (uses DHCP-provided DNS server; requiresdhcp=auto)ip=A.B.C.D/N— a static address oneth0and its prefix length, for a network with no DHCP server. It is put oneth0as the network's services start, before the netconsole sends a line, anddhcp=autothen leaveseth0alone. Refused, with a line in the log, without a prefix, with one past 32, for the subnet's own network or broadcast address (up to /30), and for 0.0.0.0/8, loopback, multicast and class Egw=A.B.C.D— the default gateway forip=: another address of its subnet. One off the subnet, or given withoutip=, is named in the log and droppeddns=A.B.C.D— a resolver on that server from the start, on the default route's interface, whether the address is static or a lease's to come (whose own server then does not replace it).dns=onkeeps taking the lease'sudpshell=PORT— start UDP remote shell on the given port (e.g.udpshell=9000). Off unless given: it has no authentication. See UDP remote shellnetframes=N— frames in the network frame pool (64–65536); watchnetpoolfor missesrxpoll=on— have the tick look at the receive path as well as the NIC's interrupt (off by default, seeDeviceTable::poll_rxinsrc/crates/layers/net/src/device.rs)
Devices and filesystems
usb=off— x86-64 only: skip xHCI bring-up (no USB keyboard; the 8042 keyboard is unaffected)iommu=on— x86-64 only: take over the Intel VT-d units the ACPI DMAR names (arch/x86_64/vtd.cpp): translation on with every device passed through, so that no driver changes, and every DMA a unit blocks said with its address, its requester and the reason (iommushows the units and their faults); and, where every unit taken over has it, interrupt remapping: every MSI, MSI-X vector and IO-APIC pin an entry of its unit's table, verified to come from its own requester, compatibility-format interrupts blocked -- what makes giving a device to a guest (hv ... pci=) safe from its DMA to the interrupt range. Off by default; the units are then left as the firmware left them, except that translation, protected memory regions or interrupt remapping it left on are turned off and said. A unit whose devices are all display devices is left be either wayguestpci=bb:dd.f[,bb:dd.f...]— PCI functions kept for guests (drivers/pci.cpp,Pci::scan): no driver of the host's is shown them -- a driver's lookups by ids or by index pass over them -- so that a VM can be given one whole (hv ... pci=), which refuses a function a driver of the host's has taken: a disk's or a NIC's needs this. Given more than once, the lists add up, 16 functions at most; a list with one not writtenbus:device.functionin hex, or one past the 16, keeps none of it and is said.pcimarks eachkept for guests, and each a driver has takena driver'sits=off— arm64 only: disable the GICv3 ITS and degrade PCIe MSI gracefully (defaultits=on; virtio-mmio devices don't need it)hwrng=off— ignore the CPU's random instruction (RDRAND/RDSEED, RNDR), leaving the entropy pool with virtio-rng and timing jitter. How the fallback path gets exercised on a machine that has one;entropythen reports whether anything else reached the pool. See Randomnessrc=off— do not run/etc/rc, the shell commands the shell's task runs once the network is up (therccommand edits it). The way past a line in it that keeps the machine from coming up. See sshdroot=auto— mount the ext4 (or ext2) filesystem labellednosread-write on/; without one, a ramfs on/, and the first of the ext family found read-only on/boot. Withoutroot=the VFS starts empty and filesystems are mounted from the shellroot=<device>/root=LABEL=<label>/root=UUID=<uuid>— the root by block device name (vda1,nvme01), ext4 or ext2 volume label or UUID. A root that is not found falls back to theautolayout, so the shell is always there; so does a label or a UUID two devices carry --auto'snosamong them -- which names neither, the boot saying which two, since one may be a guest's (hv devices). See Filesystemsro— mount the root read-onlyfstest=on— run the filesystem self-test on/once it is mounted (printsfstest: passedorfstest: FAILED); the smoke tests boot with it
Diagnostics
wxprobe=text(alsowxprobe=on) — after the kernel image has been split into text RX / rodata RO+NX / data RW+NX, deliberately write to.text. The machine should die with a page fault (x86-64) or a data abort (arm64); aW^X probe: text write SUCCEEDEDline means the protection is not doing its job. See Pagingwxprobe=heap— once the page allocator is up, call into a page it just handed out. Every runtime mapping is non-executable, so the machine should die on the instruction fetch; aW^X probe: heap execute SUCCEEDEDline means W^X covers the kernel image and nothing elseubsan=warn— in aUBSAN=1build, print every undefined-behaviour report (each site once, with a backtrace, to the serial port and the disk log) and go on, instead of panicking on the first; see Build. Checks that fail before the command line is read still panic
Bisecting a boot failure
Try in this order: smp=off, then maxcpus=2, then loglevel=4, then take
subsystems out of the path with usb=off / its=off / console=. On a
machine with no serial port, add netconsole=ip:port (with nctail=64) so
there is a log to read at all; one that stops before its network is up
needs disklog=on and a prepared area instead — see Debug,
Boot and Real hardware.