Proceeds to bootstrap the system after a number of seconds, if not interrupted by the user. Displays a countdown prompt warning the user the system is about to be booted, unless interrupted by a key press. The kernel will be loaded first if necessary. Defaults to 10 seconds.
bcachestat
Displays statistics about disk cache usage. For depuration only.
boot boot kernelname [...] boot-flag ...
Immediately proceeds to bootstrap the system, loading the kernel if necessary. Any flags or arguments are passed to the kernel, but they must precede the kernel name, if a kernel name is provided.
WARNING: The behavior of this builtin is changed if loader.4th(8) is loaded.
echo Xo
[-n] [<message>]
Displays text on the screen. A new line will be printed unless -n is specified.
heap
Displays memory usage statistics. For debugging purposes only.
help [topic [subtopic]]
Shows help messages read from /boot/loader.help. The special topic index will list the topics available.
include file []
Process script files. Each file, in turn, is completely read into memory, and then each of its lines is passed to the command line interpreter. If any error is returned by the interpreter, the include command aborts immediately, without reading any other files, and returns an error itself (see ERRORS).
load Xo
[-t type] file ...
Loads a kernel, kernel loadable module (kld), or file of opaque contents tagged as being of the type type. Kernel and modules can be either in a.out or ELF format. Any arguments passed after the name of the file to be loaded will be passed as arguments to that file. Currently, argument passing does not work for the kernel.
ls Xo
[-l] [path]
Displays a listing of files in the directory path, or the root directory if path is not specified. If -l is specified, file sizes will be shown too.
lsdev [-v]
Lists all of the devices from which it may be possible to load modules. If -v is specified, more details are printed.
lsmod [-v]
Displays loaded modules. If -v is specified, more details are shown.
more file []
Display the files specified, with a pause at each LINES displayed.
pnpscan [-v]
Scans for Plug-and-Play devices. This is not functional at present.
read Xo
[-t seconds] [-p prompt] [variable]
Reads a line of input from the terminal, storing it in variable if specified. A timeout can be specified with -t , though it will be canceled at the first key pressed. A prompt may also be displayed through the -p flag.
reboot
Immediately reboots the system.
set variable set variable = value
Set loaders environment variables.
show [variable]
Displays the specified variables value, or all variables and their values if variable is not specified.
Unset this to disable automatic loading of the ACPI module. See also hint.acpi.0.disabled in device.hints(5).
autoboot_delay
Number of seconds autoboot will wait before booting. If this variable is not defined, autoboot will default to 10 seconds.
If set to "NO", no autoboot will be automatically attempted after processing /boot/loader.rc, though explicit autoboot s will be processed normally, defaulting to 10 seconds delay.
If set to "0", no delay will be inserted, but user still will be able to interrupt autoboot process and escape into the interactive mode by pressing some key on the console while kernel and modules are being loaded.
If set to "-1", no delay will be inserted and loader will engage interactive mode only if autoboot has failed for some reason.
boot_askname
Instructs the kernel to prompt the user for the name of the root device when the kernel is booted.
boot_cdrom
Instructs the kernel to try to mount the root file system from CD-ROM.
boot_ddb
Instructs the kernel to start in the DDB debugger, rather than proceeding to initialize when booted.
boot_gdb
Selects gdb-remote mode for the kernel debugger by default.
boot_multicons
Enables multiple console support in the kernel early on boot. In a running system, console configuration can be manipulated by the conscontrol(8) utility.
boot_serial
Force the use of a serial console even when an internal console is present.
boot_single
Prevents the kernel from initiating a multi-user startup; instead, a single-user mode will be entered when the kernel has finished device probing.
boot_verbose
Setting this variable causes extra debugging information to be printed by the kernel during the boot phase.
bootfile
List of semicolon-separated search path for bootable kernels. The default is "kernel".
console
Defines the current console or consoles. Multiple consoles may be specified. In that case, the first listed console will become the default console for userland output (e.g. from init(8)).
currdev
Selects the default device. Syntax for devices is odd.
init_path
Sets the list of binaries which the kernel will try to run as the initial process. The first matching binary is used. The default list is "/sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init:/stand/sysinstall".
interpret
Has the value "OK" if the Forths current state is interpreting.
LINES
Define the number of lines on the screen, to be used by the pager.
module_path
Sets the list of directories which will be searched for modules named in a load command or implicitly required by a dependency. The default value for this variable is "/boot/kernel;/boot/modules".
num_ide_disks
Sets the number of IDE disks as a workaround for some problems in finding the root disk at boot. This has been deprecated in favor of root_disk_unit.
prompt
Value of s prompt. Defaults to ""${interpret}"". If variable prompt is unset, the default prompt is >.
root_disk_unit
If the code which detects the disk unit number for the root disk is confused, e.g. by a mix of SCSI and IDE disks, or IDE disks with gaps in the sequence (e.g. no primary slave), the unit number can be forced by setting this variable.
rootdev
By default the value of currdev is used to set the root file system when the kernel is booted. This can be overridden by setting rootdev explicitly.
Other variables are used to override kernel tunable parameters. The following tunables are available:
hw.physmem
Limit the amount of physical memory the system will use. By default the size is in bytes, but the k, K, m, M, g and G suffixes are also accepted and indicate kilobytes, megabytes and gigabytes respectively. An invalid suffix will result in the variable being ignored by the kernel.
hw.pci.host_start_mem, hw.acpi.host_start_mem
When not otherwise constrained, this limits the memory start address. The default is 0x80000000 and should be set to at least size of the memory and not conflict with other resources. Typically, only systems without PCI bridges need to set this variable since PCI bridges typically constrain the memory starting address (and the variable is only used when bridges do not constrain this address).
hw.pci.enable_io_modes
Enable PCI resources which are left off by some BIOSes or are not enabled correctly by the device driver. Tunable value set to ON (1) by default, but this may cause problems with some peripherals.
kern.maxusers
Set the size of a number of statically allocated system tables; see tuning(7) for a description of how to select an appropriate value for this tunable. When set, this tunable replaces the value declared in the kernel compile-time configuration file.
kern.ipc.nmbclusters
Set the number of mbuf clusters to be allocated. The value cannot be set below the default determined when the kernel was compiled. Modifies NMBCLUSTERS.
kern.ipc.nsfbufs
Set the number of sendfile(2) buffers to be allocated. Overrides NSFBUFS.
kern.maxswzone
Limits the amount of KVM to be used to hold swap meta information, which directly governs the maximum amount of swap the system can support. This value is specified in bytes of KVA space and defaults to around 70MBytes. Care should be taken to not reduce this value such that the actual amount of configured swap exceeds 1/2 the kernel-supported swap. The default 70MB allows the kernel to support a maximum of (approximately) 14GB of configured swap. Only mess around with this parameter if you need to greatly extend the KVM reservation for other resources such as the buffer cache or NMBCLUSTERS. Modifies VM_SWZONE_SIZE_MAX.
kern.maxbcache
Limits the amount of KVM reserved for use by the buffer cache, specified in bytes. The default maximum is 200MB. This parameter is used to prevent the buffer cache from eating too much KVM in large-memory machine configurations. Only mess around with this parameter if you need to greatly extend the KVM reservation for other resources such as the swap zone or NMBCLUSTERS. Note that the NBUF parameter will override this limit. Modifies VM_BCACHE_SIZE_MAX.
machdep.disable_mtrrs
Disable the use of i686 MTRRs (x86 only).
net.inet.tcp.tcbhashsize
Overrides the compile-time set value of TCBHASHSIZE or the preset default of 512. Must be a power of 2.
vm.kmem_size
Sets the size of kernel memory (bytes). This overrides the value determined when the kernel was compiled. Modifies VM_KMEM_SIZE.
Evaluates the remainder of the input buffer, after having printed it first.
%(--)
Evaluates the remainder of the input buffer under a catch exception guard.
.#
Works like . but without outputting a trailing space.
fclose(fd --)
Closes a file.
fkey(fd -- char)
Reads a single character from a file.
fload(fd --)
Processes a file fd.
fopen(addr len mode -- fd)
Opens a file. Returns a file descriptor, or -1 in case of failure. The mode parameter selects whether the file is to be opened for read access, write access, or both. The constants O_RDONLY, O_WRONLY, and O_RDWR are defined in /boot/support.4th, indicating read only, write only, and read-write access, respectively.
fread (fd addr len -- len)
Tries to read len bytes from file fd into buffer addr. Returns the actual number of bytes read, or -1 in case of error or end of file.
heap?(-- cells)
Return the space remaining in the dictionary heap, in cells. This is not related to the heap used by dynamic memory allocation words.
inb(port -- char)
Reads a byte from a port.
key(-- char)
Reads a single character from the console.
key?(-- flag)
Returns true if there is a character available to be read from the console.
ms(u --)
Waits u microseconds.
outb(port char --)
Writes a byte to a port.
seconds(-- u)
Returns the number of seconds since midnight.
tib>(-- addr len)
Returns the remainder of the input buffer as a string on the stack.
trace!(flag --)
Activates or deactivates tracing. Does not work with catch.