BOOT(9)
π BOOT(9) β Kernel Developer's Manual π
okay bestie, welcome to boot(9) β the group chat where the kernel says its final goodbyes π«Ά
β¨ NAME β¨
boot β halt or reboot the system. like, the ultimate "ok im logging off" move π
πΈ SYNOPSIS πΈ
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/reboot.h>
void
boot(int howto);
π DESCRIPTION π
so boot() is the function that handles the final system shutdown, and then either halts or reboots the whole system. periodt. the exact action it takes is decided by the flags you pass in howto β and also by whether or not the system has finished autoconfiguration. two variables, one vibe check π
π¦ if the system HAS finished autoconfiguration
then boot() does all of this, in order, no skipping:
- if this is the first invocation of
boot()and theRB_NOSYNCflag is not set inhowto, it syncs and unmounts the system disks by callingvfs_unmountall(9). like, tidying up before you leave the party, iconic behaviour π - disables interrupts. no more chaos, we're done here β
- if it's rebooting after a crash β that means
RB_DUMPis set inhowto, butRB_HALTis not β it saves a system crash dump. yes bestie we're preserving the evidence π΅οΈ - runs any shutdown hooks that were previously registered. all the little scheduled goodbyes π
- prints a message telling everyone the system is about to be halted or rebooted. a lil announcement, very main character π£
- if
RB_HALTis set inhowto, it halts the system. otherwise, it reboots it. that's the whole plot twist π₯
π§ if the system has NOT finished autoconfiguration
then boot() just runs any shutdown hooks previously registered, prints a message, and halts the system. no disk syncing, no dump, no reboot β we're going straight to bed π΄
fr fr, the autoconfiguration status completely changes what happens. don't sleep on that detail, iykyk.
π SEE ALSO π
and that's the whole page bestie, slay π this one's from Debian, dated February 14, 1997 β yes, Valentine's Day, because the kernel loves you enough to shut down gracefully πβ¨ bye!!
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1997 Mike Pritchard. All rights reserved
- Copyright (c) 1994 Christopher G. Demetriou
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms