1bbf21555SRichard Lowe.\" Copyright (c) 1999 Daniel C. Sobral 2bbf21555SRichard Lowe.\" Copyright 2019 OmniOS Community Edition (OmniOSce) Association. 3bbf21555SRichard Lowe.\" All rights reserved. 4bbf21555SRichard Lowe.\" 5bbf21555SRichard Lowe.\" Redistribution and use in source and binary forms, with or without 6bbf21555SRichard Lowe.\" modification, are permitted provided that the following conditions 7bbf21555SRichard Lowe.\" are met: 8bbf21555SRichard Lowe.\" 1. Redistributions of source code must retain the above copyright 9bbf21555SRichard Lowe.\" notice, this list of conditions and the following disclaimer. 10bbf21555SRichard Lowe.\" 2. Redistributions in binary form must reproduce the above copyright 11bbf21555SRichard Lowe.\" notice, this list of conditions and the following disclaimer in the 12bbf21555SRichard Lowe.\" documentation and/or other materials provided with the distribution. 13bbf21555SRichard Lowe.\" 14bbf21555SRichard Lowe.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15bbf21555SRichard Lowe.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16bbf21555SRichard Lowe.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17bbf21555SRichard Lowe.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18bbf21555SRichard Lowe.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19bbf21555SRichard Lowe.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20bbf21555SRichard Lowe.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21bbf21555SRichard Lowe.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22bbf21555SRichard Lowe.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23bbf21555SRichard Lowe.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24bbf21555SRichard Lowe.\" SUCH DAMAGE. 25bbf21555SRichard Lowe.\" 266312020eSToomas Soome.Dd March 30, 2023 27bbf21555SRichard Lowe.Dt LOADER 7 28bbf21555SRichard Lowe.Os 29bbf21555SRichard Lowe.Sh NAME 30bbf21555SRichard Lowe.Nm loader 31bbf21555SRichard Lowe.Nd kernel bootstrapping final stage 32bbf21555SRichard Lowe.Sh DESCRIPTION 33bbf21555SRichard LoweThe 34bbf21555SRichard Lowe.Nm 35bbf21555SRichard Loweis the final stage of 36bbf21555SRichard Lowe.Nm illumos Ns 's 37bbf21555SRichard Lowekernel bootstrapping process. 38bbf21555SRichard LoweThe actual name for the stage depends on the platform. 39bbf21555SRichard LoweOn IA32 (i386) architectures with BIOS firmware, it is a 40bbf21555SRichard Lowe.Pa BTX 41bbf21555SRichard Loweclient and named 42bbf21555SRichard Lowe.Nm loader . 43bbf21555SRichard LoweIt is linked statically to libstand and usually located in the directory 44bbf21555SRichard Lowe.Pa /boot . 45bbf21555SRichard Lowe.Pp 46bbf21555SRichard Lowe.Nm 47bbf21555SRichard Lowesupports booting from 48bbf21555SRichard Lowe.Cm ZFS , 49bbf21555SRichard Lowe.Cm UFS , 50bbf21555SRichard Lowe.Cm PCFS , 51bbf21555SRichard Lowe.Cm HSFS 52bbf21555SRichard Loweand 53bbf21555SRichard Lowe.Cm NFS 54bbf21555SRichard Lowefile systems. 55bbf21555SRichard LoweAdditionally, 56bbf21555SRichard Lowe.Nm 57bbf21555SRichard Lowecan load files from the 58bbf21555SRichard Lowe.Cm TFTP 59bbf21555SRichard Lowefile service. 60bbf21555SRichard LoweThe NFS and TFTP based boot is enabled via 61bbf21555SRichard Lowe.Xr pxeboot 7 . 62bbf21555SRichard LoweThe 63bbf21555SRichard Lowe.Nm 64bbf21555SRichard Lowealso does support uncompressing gzip files while reading. 65bbf21555SRichard LoweThe uncompression will happen automatically if the compressed file is stored 66bbf21555SRichard Lowewithout .gz suffix or if the file is accessed by leaving out the .gz suffix from 67bbf21555SRichard Lowethe name. 68bbf21555SRichard LoweIf the file is referred by full name, including .gz suffix, then the file 69bbf21555SRichard Lowecontent is read as is and the uncompression is not performed. 70bbf21555SRichard Lowe.Pp 71bbf21555SRichard Lowe.Nm 72bbf21555SRichard Loweprovides a scripting language that can be used to 73bbf21555SRichard Loweautomate tasks, do pre-configuration or assist in recovery 74bbf21555SRichard Loweprocedures. 75bbf21555SRichard LoweThis scripting language is roughly divided in 76bbf21555SRichard Lowetwo main components. 77bbf21555SRichard LoweThe smaller one is a set of commands 78bbf21555SRichard Lowedesigned for direct use by the casual user, called "builtin 79bbf21555SRichard Lowecommands" for historical reasons. 80bbf21555SRichard LoweThe main drive behind these commands is user-friendliness. 81bbf21555SRichard LoweThe bigger component is an 82bbf21555SRichard Lowe.Tn ANS 83bbf21555SRichard LoweForth compatible Forth interpreter based on FICL, by 84bbf21555SRichard Lowe.An John Sadler . 85bbf21555SRichard Lowe.Pp 86bbf21555SRichard LoweDuring initialization, 87bbf21555SRichard Lowe.Nm 88bbf21555SRichard Lowewill probe for a console and set the 89bbf21555SRichard Lowe.Va console 90bbf21555SRichard Lowevariable, or set it to serial console 91bbf21555SRichard Lowe.Pq Do Li ttya Dc - Dq Li ttyd 92bbf21555SRichard Loweif the previous boot stage used that. 93bbf21555SRichard LoweIf multiple consoles are selected, they will be listed separated by commas. 94bbf21555SRichard LoweThen, devices are probed, 95bbf21555SRichard Lowe.Va currdev 96bbf21555SRichard Loweand 97bbf21555SRichard Lowe.Va loaddev 98bbf21555SRichard Loweare set, and 99bbf21555SRichard Lowe.Va screen-#cols , 100bbf21555SRichard Lowe.Va screen-#rows , 101bbf21555SRichard Loweand 102bbf21555SRichard Lowe.Va ISADIR 103bbf21555SRichard Loweare set. 104bbf21555SRichard LoweNext, 105bbf21555SRichard Lowe.Tn FICL 106bbf21555SRichard Loweis initialized, the builtin words are added to its vocabulary. 107bbf21555SRichard LoweThe inner interpreter 108bbf21555SRichard Lowe.Nm 109bbf21555SRichard Lowewill use with 110bbf21555SRichard Lowe.Tn FICL 111bbf21555SRichard Loweis then set to 112bbf21555SRichard Lowe.Ic interpret , 113bbf21555SRichard Lowewhich is 114bbf21555SRichard Lowe.Tn FICL Ns 's 115bbf21555SRichard Lowedefault. 116bbf21555SRichard LoweAfter that, 117bbf21555SRichard Lowe.Pa /boot/loader.rc 118bbf21555SRichard Loweis processed if available. 119bbf21555SRichard LoweThese files are processed through the 120bbf21555SRichard Lowe.Ic include 121bbf21555SRichard Lowecommand, which reads all of them into memory before processing them, 122bbf21555SRichard Lowemaking disk changes possible. 123bbf21555SRichard Lowe.Pp 124bbf21555SRichard LoweAt this point, if an 125bbf21555SRichard Lowe.Ic autoboot 126bbf21555SRichard Lowehas not been tried, and if 127bbf21555SRichard Lowe.Va autoboot_delay 128bbf21555SRichard Loweis not set to 129bbf21555SRichard Lowe.Dq Li NO 130bbf21555SRichard Lowe(not case sensitive), then an 131bbf21555SRichard Lowe.Ic autoboot 132bbf21555SRichard Lowewill be tried. 133bbf21555SRichard LoweIf the system gets past this point, 134bbf21555SRichard Lowe.Va prompt 135bbf21555SRichard Lowewill be set and 136bbf21555SRichard Lowe.Nm 137bbf21555SRichard Lowewill engage interactive mode. 138bbf21555SRichard LowePlease note that historically even when 139bbf21555SRichard Lowe.Va autoboot_delay 140bbf21555SRichard Loweis set to 141bbf21555SRichard Lowe.Dq Li 0 142bbf21555SRichard Loweuser will be able to interrupt autoboot process by pressing some key 143bbf21555SRichard Loweon the console while kernel and modules are being loaded. 144bbf21555SRichard LoweIn some 145bbf21555SRichard Lowecases such behaviour may be undesirable, to prevent it set 146bbf21555SRichard Lowe.Va autoboot_delay 147bbf21555SRichard Loweto 148bbf21555SRichard Lowe.Dq Li -1 , 149bbf21555SRichard Lowein this case 150bbf21555SRichard Lowe.Nm 151bbf21555SRichard Lowewill engage interactive mode only if 152bbf21555SRichard Lowe.Ic autoboot 153bbf21555SRichard Lowehas failed. 154bbf21555SRichard Lowe.Ss Builtin Commands 155bbf21555SRichard LoweIn 156bbf21555SRichard Lowe.Nm , 157bbf21555SRichard Lowebuiltin commands take parameters from the command line. 158bbf21555SRichard LoweIf an error condition occurs, an exception will be generated, 159bbf21555SRichard Lowewhich can be intercepted using 160bbf21555SRichard Lowe.Tn ANS 161bbf21555SRichard LoweForth exception handling 162bbf21555SRichard Lowewords. 163bbf21555SRichard LoweIf not intercepted, an error message will be displayed and 164bbf21555SRichard Lowethe interpreter's state will be reset, emptying the stack and restoring 165bbf21555SRichard Loweinterpreting mode. 166bbf21555SRichard Lowe.Pp 167bbf21555SRichard LoweThe builtin commands available are: 168bbf21555SRichard Lowe.Pp 169bbf21555SRichard Lowe.Bl -tag -width Ds -compact 170bbf21555SRichard Lowe.It Ic autoboot Op Ar seconds Op Ar prompt 171bbf21555SRichard LoweProceeds to bootstrap the system after a number of seconds, if not 172bbf21555SRichard Loweinterrupted by the user. 173bbf21555SRichard LoweDisplays a countdown prompt 174bbf21555SRichard Lowewarning the user the system is about to be booted, 175bbf21555SRichard Loweunless interrupted by a key press. 176bbf21555SRichard LoweThe kernel will be loaded first if necessary. 177bbf21555SRichard LoweDefaults to 10 seconds. 178bbf21555SRichard Lowe.Pp 179bbf21555SRichard Lowe.It Ic bcachestat 180bbf21555SRichard LoweDisplays statistics about disk cache usage. 181bbf21555SRichard LoweFor debugging only. 182bbf21555SRichard Lowe.Pp 183bbf21555SRichard Lowe.It Ic boot 184bbf21555SRichard Lowe.It Ic boot Ar kernelname Op Cm ... 185bbf21555SRichard Lowe.It Ic boot Fl flag Cm ... 186bbf21555SRichard LoweImmediately proceeds to bootstrap the system, loading the kernel 187bbf21555SRichard Loweif necessary. 188bbf21555SRichard LoweAny flags or arguments are passed to the kernel, but they 189bbf21555SRichard Lowemust precede the kernel name, if a kernel name is provided. 190bbf21555SRichard Lowe.Pp 191bbf21555SRichard Lowe.Em WARNING : 192bbf21555SRichard LoweThe behavior of this builtin is changed if 193bbf21555SRichard Lowe.Xr loader.4th 7 194bbf21555SRichard Loweis loaded. 195bbf21555SRichard Lowe.Pp 196bbf21555SRichard Lowe.It Ic chain Ar device 197bbf21555SRichard LoweChain load another boot loader from the specified device. 1986312020eSToomas SoomeDevice can be either disk name, partition or file name. 1996312020eSToomas SoomeIn case of x86 BIOS boot, the file must be copy of MBR or PBR. 2006312020eSToomas SoomeFor UEFI boot, the file is efi application. 201bbf21555SRichard Lowe.Pp 202bbf21555SRichard Lowe.It Ic echo Xo 203bbf21555SRichard Lowe.Op Fl n 204bbf21555SRichard Lowe.Op Aq message 205bbf21555SRichard Lowe.Xc 206bbf21555SRichard LoweDisplays text on the screen. 207bbf21555SRichard LoweA new line will be printed unless 208bbf21555SRichard Lowe.Fl n 209bbf21555SRichard Loweis specified. 210bbf21555SRichard Lowe.Pp 211bbf21555SRichard Lowe.It Ic heap 212bbf21555SRichard LoweDisplays memory usage statistics. 213bbf21555SRichard LoweFor debugging purposes only. 214bbf21555SRichard Lowe.Pp 215bbf21555SRichard Lowe.It Ic help Op topic Op subtopic 216bbf21555SRichard LoweShows help messages read from 217bbf21555SRichard Lowe.Pa /boot/loader.help . 218bbf21555SRichard LoweThe special topic 219bbf21555SRichard Lowe.Em index 220bbf21555SRichard Lowewill list the topics available. 221bbf21555SRichard Lowe.Pp 222bbf21555SRichard Lowe.It Ic include Ar file Op Ar 223bbf21555SRichard LoweProcess script files. 224bbf21555SRichard LoweEach file, in turn, is completely read into memory, 225bbf21555SRichard Loweand then each of its lines is passed to the command line interpreter. 226bbf21555SRichard LoweIf any error is returned by the interpreter, the include 227bbf21555SRichard Lowecommand aborts immediately, without reading any other files, and 228bbf21555SRichard Lowereturns an error itself (see 229bbf21555SRichard Lowe.Sx ERRORS ) . 230bbf21555SRichard Lowe.Pp 231bbf21555SRichard Lowe.It Ic load Xo 232bbf21555SRichard Lowe.Op Fl t Ar type 233bbf21555SRichard Lowe.Ar file Cm ... 234bbf21555SRichard Lowe.Xc 235bbf21555SRichard LoweLoads a kernel or file of opaque contents tagged as being of the type 236bbf21555SRichard Lowe.Ar type . 237bbf21555SRichard LoweKernel and modules can be either in a.out or ELF format. 238bbf21555SRichard LoweAny arguments passed after the name of the file to be loaded 239bbf21555SRichard Lowewill be passed as arguments to that file. 240bbf21555SRichard Lowe.Pp 241bbf21555SRichard Lowe.It Ic ls Xo 242bbf21555SRichard Lowe.Op Fl l 243bbf21555SRichard Lowe.Op Ar path 244bbf21555SRichard Lowe.Xc 245bbf21555SRichard LoweDisplays a listing of files in the directory 246bbf21555SRichard Lowe.Ar path , 247bbf21555SRichard Loweor the root directory if 248bbf21555SRichard Lowe.Ar path 249bbf21555SRichard Loweis not specified. 250bbf21555SRichard LoweIf 251bbf21555SRichard Lowe.Fl l 252bbf21555SRichard Loweis specified, file sizes will be shown too. 253bbf21555SRichard Lowe.Pp 254bbf21555SRichard Lowe.It Ic lsdev Op Fl v 255bbf21555SRichard LoweLists all of the devices from which it may be possible to load modules. 256bbf21555SRichard LoweIn addition to disks and partitions, ZFS pools are also listed. 257bbf21555SRichard LoweIf 258bbf21555SRichard Lowe.Fl v 259bbf21555SRichard Loweis specified, more details are printed. 260bbf21555SRichard LoweFor ZFS pools the output resembles 261bbf21555SRichard Lowe.Nm zpool Cm status 262bbf21555SRichard Loweoutput. 263bbf21555SRichard Lowe.Pp 264bbf21555SRichard Lowe.It Ic lsmod Op Fl v 265bbf21555SRichard LoweDisplays loaded modules. 266bbf21555SRichard LoweIf 267bbf21555SRichard Lowe.Fl v 268bbf21555SRichard Loweis specified, more details are shown. 269bbf21555SRichard Lowe.Pp 270bbf21555SRichard Lowe.It Ic lszfs Ar filesystem 271bbf21555SRichard LoweA ZFS extended command that can be used to explore the ZFS filesystem 272bbf21555SRichard Lowehierarchy in a pool. 273bbf21555SRichard LoweLists the immediate children of the 274bbf21555SRichard Lowe.Ar filesystem . 275bbf21555SRichard LoweThe filesystem hierarchy is rooted at a filesystem with the same name 276bbf21555SRichard Loweas the pool. 277bbf21555SRichard Lowe.Pp 278bbf21555SRichard Lowe.It Ic more Ar file Op Ar 279bbf21555SRichard LoweDisplay the files specified, with a pause at each 280bbf21555SRichard Lowe.Va screen-#rows 281bbf21555SRichard Lowedisplayed. 282bbf21555SRichard Lowe.Pp 283bbf21555SRichard Lowe.It Ic read Xo 284bbf21555SRichard Lowe.Op Fl t Ar seconds 285bbf21555SRichard Lowe.Op Fl p Ar prompt 286bbf21555SRichard Lowe.Op Va variable 287bbf21555SRichard Lowe.Xc 288bbf21555SRichard LoweReads a line of input from the terminal, storing it in 289bbf21555SRichard Lowe.Va variable 290bbf21555SRichard Loweif specified. 291bbf21555SRichard LoweA timeout can be specified with 292bbf21555SRichard Lowe.Fl t , 293bbf21555SRichard Lowethough it will be canceled at the first key pressed. 294bbf21555SRichard LoweA prompt may also be displayed through the 295bbf21555SRichard Lowe.Fl p 296bbf21555SRichard Loweflag. 297bbf21555SRichard Lowe.Pp 2980e8f244eSToomas Soome.It Ic reboot Op Fl f 299bbf21555SRichard LoweImmediately reboots the system. 3000e8f244eSToomas SoomeOn a 3010e8f244eSToomas Soome.Sy UEFI 3020e8f244eSToomas Soomesystem, if the 3030e8f244eSToomas Soome.Fl f 3040e8f244eSToomas Soomeflag is set, or the 3050e8f244eSToomas Soome.Va BOOT_TO_FW_UI 3060e8f244eSToomas Soomeenvironment variable exists, and the firmware supports this feature, 3070e8f244eSToomas Soomethe system will automatically enter the firmware setup after reboot. 308bbf21555SRichard Lowe.Pp 309bbf21555SRichard Lowe.It Ic set Ar variable 310bbf21555SRichard Lowe.It Ic set Ar variable Ns = Ns Ar value 311bbf21555SRichard LoweSet loader's environment variables. 312bbf21555SRichard Lowe.Pp 313bbf21555SRichard Lowe.It Ic show Op Va variable 314bbf21555SRichard LoweDisplays the specified variable's value, or all variables and their 315bbf21555SRichard Lowevalues if 316bbf21555SRichard Lowe.Va variable 317bbf21555SRichard Loweis not specified. 318bbf21555SRichard Lowe.Pp 319bbf21555SRichard Lowe.It Ic unload 320bbf21555SRichard LoweRemove all modules from memory. 321bbf21555SRichard Lowe.Pp 322bbf21555SRichard Lowe.It Ic unset Va variable 323bbf21555SRichard LoweRemoves 324bbf21555SRichard Lowe.Va variable 325bbf21555SRichard Lowefrom the environment. 326bbf21555SRichard Lowe.Pp 327bbf21555SRichard Lowe.It Ic \&? 328bbf21555SRichard LoweLists available commands. 329bbf21555SRichard Lowe.El 330bbf21555SRichard Lowe.Ss ZFS Features 331bbf21555SRichard Lowe.Nm 332bbf21555SRichard Lowesupports the following format for specifying ZFS filesystems which 333bbf21555SRichard Lowecan be used wherever 334bbf21555SRichard Lowe.Nm 335bbf21555SRichard Lowerefers to a device specification: 336bbf21555SRichard Lowe.Pp 337bbf21555SRichard Lowe.Ar zfs:pool/filesystem: 338bbf21555SRichard Lowe.Pp 339bbf21555SRichard Lowewhere 340bbf21555SRichard Lowe.Pa pool/filesystem 341bbf21555SRichard Loweis a ZFS filesystem name as described in 342bbf21555SRichard Lowe.Xr zfs 8 . 343bbf21555SRichard Lowe.Ss Builtin Environment Variables 344bbf21555SRichard LoweThe 345bbf21555SRichard Lowe.Nm 346bbf21555SRichard Lowehas actually two different kinds of 347bbf21555SRichard Lowe.Sq environment 348bbf21555SRichard Lowevariables. 349bbf21555SRichard LoweThere are ANS Forth's 350bbf21555SRichard Lowe.Em environmental queries , 351bbf21555SRichard Loweand a separate space of environment variables used by builtins, which 352bbf21555SRichard Loweare not directly available to Forth words. 353bbf21555SRichard LoweIt is the latter type that this section covers. 354bbf21555SRichard Lowe.Pp 355bbf21555SRichard LoweEnvironment variables can be set and unset through the 356bbf21555SRichard Lowe.Ic set 357bbf21555SRichard Loweand 358bbf21555SRichard Lowe.Ic unset 359bbf21555SRichard Lowebuiltins, and can have their values interactively examined through the 360bbf21555SRichard Loweuse of the 361bbf21555SRichard Lowe.Ic show 362bbf21555SRichard Lowebuiltin. 363bbf21555SRichard LoweTheir values can also be accessed as described in 364bbf21555SRichard Lowe.Sx BUILTIN PARSER . 365bbf21555SRichard Lowe.Pp 366bbf21555SRichard LoweNotice that these environment variables are not inherited by any shell 367bbf21555SRichard Loweafter the system has been booted. 368bbf21555SRichard Lowe.Pp 369bbf21555SRichard LoweA few variables are set automatically by 370bbf21555SRichard Lowe.Nm . 371bbf21555SRichard LoweOthers can affect the behavior of either 372bbf21555SRichard Lowe.Nm 373bbf21555SRichard Loweor the kernel at boot. 374bbf21555SRichard LoweSome options may require a value, 375bbf21555SRichard Lowewhile others define behavior just by being set. 376bbf21555SRichard LoweBoth types of builtin variables are described below. 377bbf21555SRichard Lowe.Bl -tag -width bootfile 378bbf21555SRichard Lowe.It Va autoboot_delay 379bbf21555SRichard LoweNumber of seconds 380bbf21555SRichard Lowe.Ic autoboot 381bbf21555SRichard Lowewill wait before booting. 382bbf21555SRichard LoweIf this variable is not defined, 383bbf21555SRichard Lowe.Ic autoboot 384bbf21555SRichard Lowewill default to 10 seconds. 385bbf21555SRichard Lowe.Pp 386bbf21555SRichard LoweIf set to 387bbf21555SRichard Lowe.Dq Li NO , 388bbf21555SRichard Loweno 389bbf21555SRichard Lowe.Ic autoboot 390bbf21555SRichard Lowewill be automatically attempted after processing 391bbf21555SRichard Lowe.Pa /boot/loader.rc , 392bbf21555SRichard Lowethough explicit 393bbf21555SRichard Lowe.Ic autoboot Ns 's 394bbf21555SRichard Lowewill be processed normally, defaulting to 10 seconds delay. 395bbf21555SRichard Lowe.Pp 396bbf21555SRichard LoweIf set to 397bbf21555SRichard Lowe.Dq Li 0 , 398bbf21555SRichard Loweno delay will be inserted, but user still will be able to interrupt 399bbf21555SRichard Lowe.Ic autoboot 400bbf21555SRichard Loweprocess and escape into the interactive mode by pressing some key 401bbf21555SRichard Loweon the console while kernel and 402bbf21555SRichard Lowemodules are being loaded. 403bbf21555SRichard Lowe.Pp 404bbf21555SRichard LoweIf set to 405bbf21555SRichard Lowe.Dq Li -1 , 406bbf21555SRichard Loweno delay will be inserted and 407bbf21555SRichard Lowe.Nm 408bbf21555SRichard Lowewill engage interactive mode only if 409bbf21555SRichard Lowe.Ic autoboot 410bbf21555SRichard Lowehas failed for some reason. 411bbf21555SRichard Lowe.It Va boot_ask 412bbf21555SRichard LoweWill set 413bbf21555SRichard Lowe.Xr kernel 8 414bbf21555SRichard Lowe.Fl a 415bbf21555SRichard Loweoption. 416bbf21555SRichard Lowe.It Va boot_debug 417bbf21555SRichard LoweWill set 418bbf21555SRichard Lowe.Xr kernel 8 419bbf21555SRichard Lowe.Fl d 420bbf21555SRichard Loweoption. 421bbf21555SRichard Lowe.It Va boot_kmdb 422bbf21555SRichard LoweWill set 423bbf21555SRichard Lowe.Xr kernel 8 424bbf21555SRichard Lowe.Fl k 425bbf21555SRichard Loweoption. 426bbf21555SRichard Lowe.It Va boot_reconfigure 427bbf21555SRichard LoweWill set 428bbf21555SRichard Lowe.Xr kernel 8 429bbf21555SRichard Lowe.Fl r 430bbf21555SRichard Loweoption. 431bbf21555SRichard Lowe.It Va boot_single 432bbf21555SRichard LoweWill set 433bbf21555SRichard Lowe.Xr kernel 8 434bbf21555SRichard Lowe.Fl s 435bbf21555SRichard Loweoption. 436bbf21555SRichard Lowe.It Va boot_verbose 437bbf21555SRichard LoweWill set 438bbf21555SRichard Lowe.Xr kernel 8 439bbf21555SRichard Lowe.Fl v 440bbf21555SRichard Loweoption. 441bbf21555SRichard Lowe.It Va boot-args 442bbf21555SRichard LoweWill set custom arguments for the kernel. 443bbf21555SRichard LoweIf set in 444bbf21555SRichard Lowe.Nm 445bbf21555SRichard Loweconfiguration, the 446bbf21555SRichard Lowe.Nm 447bbf21555SRichard Lowestartup will parse the 448bbf21555SRichard Lowe.Va boot-args 449bbf21555SRichard Lowevalue to set boot prefixed variables listed above, any unrecognized options 450bbf21555SRichard Loweare added to kernel command line verbatim. 451bbf21555SRichard Lowe.It Va bootfile 452bbf21555SRichard LoweThe name of the kernel. 4536312020eSToomas Soome.It Va chain_disk 4546312020eSToomas SoomeIf set, contains the device or file name used with 4556312020eSToomas Soome.Cm chain 4566312020eSToomas Soomecommand and will cause chain command menu entry to appear on 4576312020eSToomas Soome.Nm 4586312020eSToomas Soomemain menu. 4596312020eSToomas SoomeThe alternate method to use chain loader is to add menu entries 4606312020eSToomas Soomeinto 4616312020eSToomas Soome.Xr menu.lst 5 4626312020eSToomas Soomefile. 463bbf21555SRichard Lowe.It Va console 464bbf21555SRichard LoweDefines the current console or consoles. 465bbf21555SRichard LoweMultiple consoles may be specified. 466bbf21555SRichard LoweIn that case, the first listed console will become the default console for 467bbf21555SRichard Lowethe 468bbf21555SRichard Lowe.Xr kernel 8 . 469bbf21555SRichard Lowe.It Va currdev 470bbf21555SRichard LoweSelects the default device. 471bbf21555SRichard LoweSyntax for devices is odd. 472bbf21555SRichard Lowe.It Va interpret 473bbf21555SRichard LoweHas the value 474bbf21555SRichard Lowe.Dq Li ok 475bbf21555SRichard Loweif the Forth's current state is interpreting. 476bbf21555SRichard Lowe.It Va screen-#rows 477bbf21555SRichard LoweDefine the number of lines on the screen, to be used by the pager. 478bbf21555SRichard Lowe.It Va module_path 479bbf21555SRichard LoweSets the list of directories which will be searched for modules 480bbf21555SRichard Lowenamed in a load command or implicitly required by a dependency. 481bbf21555SRichard LoweThe default value for this variable is 482bbf21555SRichard Lowe.Dq Li /platform/i86pc/${ISADIR} 483bbf21555SRichard Lowe.It Va prompt 484bbf21555SRichard LoweValue of 485bbf21555SRichard Lowe.Nm Ns 's 486bbf21555SRichard Loweprompt. 487bbf21555SRichard LoweDefaults to 488bbf21555SRichard Lowe.Dq Li "${interpret}" . 489bbf21555SRichard LoweIf variable 490bbf21555SRichard Lowe.Va prompt 491bbf21555SRichard Loweis unset, the default prompt is 492bbf21555SRichard Lowe.Ql > . 493bbf21555SRichard Lowe.It Va os_console 494bbf21555SRichard LoweIf set, the value is used to set 495bbf21555SRichard Lowe.Xr kernel 8 496bbf21555SRichard Lowe.Va console 497bbf21555SRichard Loweproperty. 498*ae676b12SColin Percival.It Va twiddle_divisor 499*ae676b12SColin PercivalThrottles the output of the 500*ae676b12SColin Percival.Sq twiddle 501*ae676b12SColin PercivalI/O progress indicator displayed while loading the kernel and modules. 502*ae676b12SColin PercivalThis is useful on slow serial consoles where the time spent waiting for 503*ae676b12SColin Percivalthese characters to be written can add up to many seconds. 504*ae676b12SColin PercivalThe spinner is updated only once every 505*ae676b12SColin Percival.Va twiddle_divisor 506*ae676b12SColin Percivaloperations. 507*ae676b12SColin PercivalThe default value for 508*ae676b12SColin Percival.Va twiddle_divisor 509*ae676b12SColin Percivalis 16. 510bbf21555SRichard Lowe.El 511bbf21555SRichard Lowe.Pp 512bbf21555SRichard LoweOther variables are used for loader or to set kernel properties or for 513bbf21555SRichard Loweinformational purposes. 514bbf21555SRichard Lowe.Ss Builtin Parser 515bbf21555SRichard LoweWhen a builtin command is executed, the rest of the line is taken 516bbf21555SRichard Loweby it as arguments, and it is processed by a special parser which 517bbf21555SRichard Loweis not used for regular Forth commands. 518bbf21555SRichard Lowe.Pp 519bbf21555SRichard LoweThis special parser applies the following rules to the parsed text: 520bbf21555SRichard Lowe.Bl -enum 521bbf21555SRichard Lowe.It 522bbf21555SRichard LoweAll backslash characters are preprocessed. 523bbf21555SRichard Lowe.Bl -bullet 524bbf21555SRichard Lowe.It 525bbf21555SRichard Lowe\eb , \ef , \er , \en and \et are processed as in C. 526bbf21555SRichard Lowe.It 527bbf21555SRichard Lowe\es is converted to a space. 528bbf21555SRichard Lowe.It 529bbf21555SRichard Lowe\ev is converted to 530bbf21555SRichard Lowe.Tn ASCII 531bbf21555SRichard Lowe11. 532bbf21555SRichard Lowe.It 533bbf21555SRichard Lowe\ez is just skipped. 534bbf21555SRichard LoweUseful for things like 535bbf21555SRichard Lowe.Dq \e0xf\ez\e0xf . 536bbf21555SRichard Lowe.It 537bbf21555SRichard Lowe\e0xN and \e0xNN are replaced by the hex N or NN. 538bbf21555SRichard Lowe.It 539bbf21555SRichard Lowe\eNNN is replaced by the octal NNN 540bbf21555SRichard Lowe.Tn ASCII 541bbf21555SRichard Lowecharacter. 542bbf21555SRichard Lowe.It 543bbf21555SRichard Lowe\e" , \e' and \e$ will escape these characters, preventing them from 544bbf21555SRichard Lowereceiving special treatment in Step 2, described below. 545bbf21555SRichard Lowe.It 546bbf21555SRichard Lowe\e\e will be replaced with a single \e . 547bbf21555SRichard Lowe.It 548bbf21555SRichard LoweIn any other occurrence, backslash will just be removed. 549bbf21555SRichard Lowe.El 550bbf21555SRichard Lowe.It 551bbf21555SRichard LoweEvery string between non-escaped quotes or double-quotes will be treated 552bbf21555SRichard Loweas a single word for the purposes of the remaining steps. 553bbf21555SRichard Lowe.It 554bbf21555SRichard LoweReplace any 555bbf21555SRichard Lowe.Li $VARIABLE 556bbf21555SRichard Loweor 557bbf21555SRichard Lowe.Li ${VARIABLE} 558bbf21555SRichard Lowewith the value of the environment variable 559bbf21555SRichard Lowe.Va VARIABLE . 560bbf21555SRichard Lowe.It 561bbf21555SRichard LoweSpace-delimited arguments are passed to the called builtin command. 562bbf21555SRichard LoweSpaces can also be escaped through the use of \e\e . 563bbf21555SRichard Lowe.El 564bbf21555SRichard Lowe.Pp 565bbf21555SRichard LoweAn exception to this parsing rule exists, and is described in 566bbf21555SRichard Lowe.Sx Builtins And FORTH . 567bbf21555SRichard Lowe.Ss Builtins And FORTH 568bbf21555SRichard LoweAll builtin words are state-smart, immediate words. 569bbf21555SRichard LoweIf interpreted, they behave exactly as described previously. 570bbf21555SRichard LoweIf they are compiled, though, 571bbf21555SRichard Lowethey extract their arguments from the stack instead of the command line. 572bbf21555SRichard Lowe.Pp 573bbf21555SRichard LoweIf compiled, the builtin words expect to find, at execution time, the 574bbf21555SRichard Lowefollowing parameters on the stack: 575bbf21555SRichard Lowe.D1 Ar addrN lenN ... addr2 len2 addr1 len1 N 576bbf21555SRichard Lowewhere 577bbf21555SRichard Lowe.Ar addrX lenX 578bbf21555SRichard Loweare strings which will compose the command line that will be parsed 579bbf21555SRichard Loweinto the builtin's arguments. 580bbf21555SRichard LoweInternally, these strings are concatenated in from 1 to N, 581bbf21555SRichard Lowewith a space put between each one. 582bbf21555SRichard Lowe.Pp 583bbf21555SRichard LoweIf no arguments are passed, a 0 584bbf21555SRichard Lowe.Em must 585bbf21555SRichard Lowebe passed, even if the builtin accepts no arguments. 586bbf21555SRichard Lowe.Pp 587bbf21555SRichard LoweWhile this behavior has benefits, it has its trade-offs. 588bbf21555SRichard LoweIf the execution token of a builtin is acquired (through 589bbf21555SRichard Lowe.Ic ' 590bbf21555SRichard Loweor 591bbf21555SRichard Lowe.Ic ['] ) , 592bbf21555SRichard Loweand then passed to 593bbf21555SRichard Lowe.Ic catch 594bbf21555SRichard Loweor 595bbf21555SRichard Lowe.Ic execute , 596bbf21555SRichard Lowethe builtin behavior will depend on the system state 597bbf21555SRichard Lowe.Bf Em 598bbf21555SRichard Loweat the time 599bbf21555SRichard Lowe.Ic catch 600bbf21555SRichard Loweor 601bbf21555SRichard Lowe.Ic execute 602bbf21555SRichard Loweis processed! 603bbf21555SRichard Lowe.Ef 604bbf21555SRichard LoweThis is particularly annoying for programs that want or need to 605bbf21555SRichard Lowehandle exceptions. 606bbf21555SRichard LoweIn this case, the use of a proxy is recommended. 607bbf21555SRichard LoweFor example: 608bbf21555SRichard Lowe.Dl : (boot) boot ; 609bbf21555SRichard Lowe.Ss FICL 610bbf21555SRichard Lowe.Tn FICL 611bbf21555SRichard Loweis a Forth interpreter written in C, in the form of a forth 612bbf21555SRichard Lowevirtual machine library that can be called by C functions and vice 613bbf21555SRichard Loweversa. 614bbf21555SRichard Lowe.Pp 615bbf21555SRichard LoweIn 616bbf21555SRichard Lowe.Nm , 617bbf21555SRichard Loweeach line read interactively is then fed to 618bbf21555SRichard Lowe.Tn FICL , 619bbf21555SRichard Lowewhich may call 620bbf21555SRichard Lowe.Nm 621bbf21555SRichard Loweback to execute the builtin words. 622bbf21555SRichard LoweThe builtin 623bbf21555SRichard Lowe.Ic include 624bbf21555SRichard Lowewill also feed 625bbf21555SRichard Lowe.Tn FICL , 626bbf21555SRichard Loweone line at a time. 627bbf21555SRichard Lowe.Pp 628bbf21555SRichard LoweThe words available to 629bbf21555SRichard Lowe.Tn FICL 630bbf21555SRichard Lowecan be classified into four groups. 631bbf21555SRichard LoweThe 632bbf21555SRichard Lowe.Tn ANS 633bbf21555SRichard LoweForth standard words, extra 634bbf21555SRichard Lowe.Tn FICL 635bbf21555SRichard Lowewords, extra 636bbf21555SRichard Lowe.Fx 637bbf21555SRichard Lowewords, and the builtin commands; 638bbf21555SRichard Lowethe latter were already described. 639bbf21555SRichard LoweThe 640bbf21555SRichard Lowe.Tn ANS 641bbf21555SRichard LoweForth standard words are listed in the 642bbf21555SRichard Lowe.Sx STANDARDS 643bbf21555SRichard Lowesection. 644bbf21555SRichard LoweThe words falling in the two other groups are described in the 645bbf21555SRichard Lowefollowing subsections. 646bbf21555SRichard Lowe.Ss FICL Extra Words 647bbf21555SRichard Lowe.Bl -tag -width wid-set-super 648bbf21555SRichard Lowe.It Ic .env 649bbf21555SRichard Lowe.It Ic .ver 650bbf21555SRichard Lowe.It Ic -roll 651bbf21555SRichard Lowe.It Ic 2constant 652bbf21555SRichard Lowe.It Ic >name 653bbf21555SRichard Lowe.It Ic body> 654bbf21555SRichard Lowe.It Ic compare 655bbf21555SRichard LoweThis is the STRING word set's 656bbf21555SRichard Lowe.Ic compare . 657bbf21555SRichard Lowe.It Ic compile-only 658bbf21555SRichard Lowe.It Ic endif 659bbf21555SRichard Lowe.It Ic forget-wid 660bbf21555SRichard Lowe.It Ic parse-word 661bbf21555SRichard Lowe.It Ic sliteral 662bbf21555SRichard LoweThis is the STRING word set's 663bbf21555SRichard Lowe.Ic sliteral . 664bbf21555SRichard Lowe.It Ic wid-set-super 665bbf21555SRichard Lowe.It Ic w@ 666bbf21555SRichard Lowe.It Ic w! 667bbf21555SRichard Lowe.It Ic x. 668bbf21555SRichard Lowe.It Ic empty 669bbf21555SRichard Lowe.It Ic cell- 670bbf21555SRichard Lowe.It Ic -rot 671bbf21555SRichard Lowe.El 672bbf21555SRichard Lowe.Ss Loader Extra Words 673bbf21555SRichard Lowe.Bl -tag -width XXXXXXXX 674bbf21555SRichard Lowe.It Ic \&$ Pq -- 675bbf21555SRichard LoweEvaluates the remainder of the input buffer, after having printed it first. 676bbf21555SRichard Lowe.It Ic \&% Pq -- 677bbf21555SRichard LoweEvaluates the remainder of the input buffer under a 678bbf21555SRichard Lowe.Ic catch 679bbf21555SRichard Loweexception guard. 680bbf21555SRichard Lowe.It Ic .# 681bbf21555SRichard LoweWorks like 682bbf21555SRichard Lowe.Ic \&. 683bbf21555SRichard Lowebut without outputting a trailing space. 684bbf21555SRichard Lowe.It Ic fclose Pq Ar fd -- 685bbf21555SRichard LoweCloses a file. 686bbf21555SRichard Lowe.It Ic fkey Pq Ar fd -- char 687bbf21555SRichard LoweReads a single character from a file. 688bbf21555SRichard Lowe.It Ic fload Pq Ar fd -- 689bbf21555SRichard LoweProcesses a file 690bbf21555SRichard Lowe.Em fd . 691bbf21555SRichard Lowe.It Ic fopen Pq Ar addr len mode Li -- Ar fd 692bbf21555SRichard LoweOpens a file. 693bbf21555SRichard LoweReturns a file descriptor, or \-1 in case of failure. 694bbf21555SRichard LoweThe 695bbf21555SRichard Lowe.Ar mode 696bbf21555SRichard Loweparameter selects whether the file is to be opened for read access, write 697bbf21555SRichard Loweaccess, or both. 698bbf21555SRichard LoweThe constants 699bbf21555SRichard Lowe.Dv O_RDONLY , O_WRONLY , 700bbf21555SRichard Loweand 701bbf21555SRichard Lowe.Dv O_RDWR 702bbf21555SRichard Loweare defined in 703bbf21555SRichard Lowe.Pa /boot/forth/support.4th , 704bbf21555SRichard Loweindicating read only, write only, and read-write access, respectively. 705bbf21555SRichard Lowe.It Xo 706bbf21555SRichard Lowe.Ic fread 707bbf21555SRichard Lowe.Pq Ar fd addr len -- len' 708bbf21555SRichard Lowe.Xc 709bbf21555SRichard LoweTries to read 710bbf21555SRichard Lowe.Em len 711bbf21555SRichard Lowebytes from file 712bbf21555SRichard Lowe.Em fd 713bbf21555SRichard Loweinto buffer 714bbf21555SRichard Lowe.Em addr . 715bbf21555SRichard LoweReturns the actual number of bytes read, or -1 in case of error or end of 716bbf21555SRichard Lowefile. 717bbf21555SRichard Lowe.It Ic heap? Pq -- Ar cells 718bbf21555SRichard LoweReturn the space remaining in the dictionary heap, in cells. 719bbf21555SRichard LoweThis is not related to the heap used by dynamic memory allocation words. 720bbf21555SRichard Lowe.It Ic inb Pq Ar port -- char 721bbf21555SRichard LoweReads a byte from a port. 722bbf21555SRichard Lowe.It Ic isvirtualized? Pq -- Ar addr len flag | Ar flag 723bbf21555SRichard LoweReturns 724bbf21555SRichard Lowe.Ic true 725bbf21555SRichard Loweand string with virtualization engine name or 726bbf21555SRichard Lowe.Ic false . 727bbf21555SRichard Lowe.It Ic key Pq -- Ar char 728bbf21555SRichard LoweReads a single character from the console. 729bbf21555SRichard Lowe.It Ic key? Pq -- Ar flag 730bbf21555SRichard LoweReturns 731bbf21555SRichard Lowe.Ic true 732bbf21555SRichard Loweif there is a character available to be read from the console. 733bbf21555SRichard Lowe.It Ic ms Pq Ar u -- 734bbf21555SRichard LoweWaits 735bbf21555SRichard Lowe.Em u 736bbf21555SRichard Lowemicroseconds. 737bbf21555SRichard Lowe.It Ic outb Pq Ar port char -- 738bbf21555SRichard LoweWrites a byte to a port. 739bbf21555SRichard Lowe.It Ic seconds Pq -- Ar u 740bbf21555SRichard LoweReturns the number of seconds since midnight. 741bbf21555SRichard Lowe.It Ic tib> Pq -- Ar addr len 742bbf21555SRichard LoweReturns the remainder of the input buffer as a string on the stack. 743bbf21555SRichard Lowe.El 744bbf21555SRichard Lowe.Ss Loader Extra Framebuffer Words 745bbf21555SRichard Lowe.Bl -tag -width XXXXXXXX 746bbf21555SRichard Lowe.It Ic fb-bezier Pq Ar x1 y1 x2 y2 x3 y3 width -- 747bbf21555SRichard LoweDraws a quadratic Bezier curve in the current foreground color using the 748bbf21555SRichard Lowethree provided points and specified line with. 749bbf21555SRichard Lowe.It Ic fb-drawrect Pq Ar x1 y1 x2 y2 fill -- 750bbf21555SRichard LoweDraws a rectangle to the screen with the top left at 751bbf21555SRichard Lowe.Em (x1,y1) 752bbf21555SRichard Loweand the bottom right at 753bbf21555SRichard Lowe.Em (x2,y2) 754bbf21555SRichard Lowe, using the current foreground color. 755bbf21555SRichard LoweIf 756bbf21555SRichard Lowe.Em fill 757bbf21555SRichard Loweis 758bbf21555SRichard Lowe.Ic true 759bbf21555SRichard Lowethen the rectangle will be filled in. 760bbf21555SRichard Lowe.It Ic fb-line Pq Ar x1 y1 x2 y2 width -- 761bbf21555SRichard LoweDraws a line from 762bbf21555SRichard Lowe.Em (x1,y1) 763bbf21555SRichard Loweto 764bbf21555SRichard Lowe.Em (x2,y2) 765bbf21555SRichard Lowein the current foreground color and with the specified width. 766bbf21555SRichard Lowe.It Ic fb-putimage Pq Ar flags x1 y1 x2 y2 addr len -- flag 767bbf21555SRichard LoweOutputs an image to the screen. 768bbf21555SRichard LoweReturns 769bbf21555SRichard Lowe.Ic true 770bbf21555SRichard Loweif the image was able to be written and 771bbf21555SRichard Lowe.Ic false 772bbf21555SRichard Loweotherwise. 773bbf21555SRichard LoweOnly truecolor PNG images are supported and the path to the file 774bbf21555SRichard Lowemust be provided through the 775bbf21555SRichard Lowe.Em addr 776bbf21555SRichard Loweand 777bbf21555SRichard Lowe.Em len 778bbf21555SRichard Lowearguments on the stack. 779bbf21555SRichard LoweThe image will be displayed in the rectangular screen region with the top left 780bbf21555SRichard Loweat 781bbf21555SRichard Lowe.Em (x1,y1) 782bbf21555SRichard Loweand the bottom right at 783bbf21555SRichard Lowe.Em (x2,y2) 784bbf21555SRichard Lowe. 785bbf21555SRichard Lowe.Pp 786bbf21555SRichard LoweEither 787bbf21555SRichard Lowe.Em x2 788bbf21555SRichard Loweor 789bbf21555SRichard Lowe.Em y2 790bbf21555SRichard Lowecan be set to "0" which causes it to be calculated to maintain the aspect 791bbf21555SRichard Loweratio of the image. 792bbf21555SRichard LoweIf both are "0" then the native resolution of the image will be used. 793bbf21555SRichard Lowe.Pp 794bbf21555SRichard LoweIf 795bbf21555SRichard Lowe.Em x1 796bbf21555SRichard Loweis "0", then the image will be placed as far over to the right of the 797bbf21555SRichard Lowescreen as possible. 798bbf21555SRichard LoweSimilarly, if 799bbf21555SRichard Lowe.Em y1 800bbf21555SRichard Loweis "0", then the image will be placed as far down the screen as possible. 801bbf21555SRichard Lowe.Pp 802bbf21555SRichard LoweFlags is a bitfield; the following bits are defined: 803bbf21555SRichard Lowe.Bl -tag -width XXXXX -offset indent 804bbf21555SRichard Lowe.It 1 805bbf21555SRichard LoweDraw a single pixel border around the image in the current foreground color. 806bbf21555SRichard Lowe.It 2 807bbf21555SRichard LoweDo not scroll the image with the rest of the screen. 808bbf21555SRichard Lowe.It 128 809bbf21555SRichard LoweOutput diagnostic information (for debugging). 810bbf21555SRichard Lowe.El 811bbf21555SRichard Lowe.It Ic fb-setpixel Pq Ar x y -- 812bbf21555SRichard LoweColors the pixel at 813bbf21555SRichard Lowe.Em (x,y) 814bbf21555SRichard Lowewith the current foreground color. 815bbf21555SRichard Lowe.It Ic term-drawrect Pq Ar x1 y1 x2 y2 -- 816bbf21555SRichard LoweDraws a rectangle with rounded corners using terminal coordinates and the 817bbf21555SRichard Lowecurrent foreground color. 818bbf21555SRichard Lowe.El 819bbf21555SRichard Lowe.Ss Loader Defined Environmental Queries 820bbf21555SRichard Lowe.Bl -tag -width Ds 821bbf21555SRichard Lowe.It arch-i386 822bbf21555SRichard Lowe.Ic TRUE 823bbf21555SRichard Loweif the architecture is IA32. 824bbf21555SRichard Lowe.It loader_version 825bbf21555SRichard Lowe.Nm 826bbf21555SRichard Loweversion. 827bbf21555SRichard Lowe.El 828bbf21555SRichard Lowe.Ss Errors 829bbf21555SRichard LoweThe following values are thrown by 830bbf21555SRichard Lowe.Nm : 831bbf21555SRichard Lowe.Bl -tag -width XXXXX -offset indent 832bbf21555SRichard Lowe.It 100 833bbf21555SRichard LoweAny type of error in the processing of a builtin. 834bbf21555SRichard Lowe.It -1 835bbf21555SRichard Lowe.Ic Abort 836bbf21555SRichard Loweexecuted. 837bbf21555SRichard Lowe.It -2 838bbf21555SRichard Lowe.Ic Abort" 839bbf21555SRichard Loweexecuted. 840bbf21555SRichard Lowe.It -56 841bbf21555SRichard Lowe.Ic Quit 842bbf21555SRichard Loweexecuted. 843bbf21555SRichard Lowe.It -256 844bbf21555SRichard LoweOut of interpreting text. 845bbf21555SRichard Lowe.It -257 846bbf21555SRichard LoweNeed more text to succeed -- will finish on next run. 847bbf21555SRichard Lowe.It -258 848bbf21555SRichard Lowe.Ic Bye 849bbf21555SRichard Loweexecuted. 850bbf21555SRichard Lowe.It -259 851bbf21555SRichard LoweUnspecified error. 852bbf21555SRichard Lowe.El 853bbf21555SRichard Lowe.Sh FILES 854bbf21555SRichard Lowe.Bl -tag -width /boot/defaults/loader.conf -compact 855bbf21555SRichard Lowe.It Pa /boot/defaults/loader.conf 856bbf21555SRichard Lowe.It Pa /boot/conf.d/* 857bbf21555SRichard Lowe.It Pa /boot/loader.conf 858bbf21555SRichard Lowe.It Pa /boot/loader.conf.local 859bbf21555SRichard Lowe.Nm 860bbf21555SRichard Loweconfiguration files, as described in 861bbf21555SRichard Lowe.Xr loader.conf 5 . 862bbf21555SRichard Lowe.It Pa /boot/loader.help 863bbf21555SRichard LoweLoaded by 864bbf21555SRichard Lowe.Ic help . 865bbf21555SRichard LoweContains the help messages. 866bbf21555SRichard Lowe.It Pa /boot/loader.rc 867bbf21555SRichard Lowe.Nm 868bbf21555SRichard Lowebootstrapping script. 869bbf21555SRichard Lowe.It Pa /boot/forth/loader.4th 870bbf21555SRichard LoweExtra builtin-like words. 871bbf21555SRichard Lowe.It Pa /boot/forth/support.4th 872bbf21555SRichard Lowe.Pa loader.conf 873bbf21555SRichard Loweprocessing words. 874bbf21555SRichard Lowe.It Pa /boot/loader 875bbf21555SRichard Lowe.Nm 876bbf21555SRichard Loweitself. 877bbf21555SRichard Lowe.El 878bbf21555SRichard Lowe.Sh EXAMPLES 879bbf21555SRichard LoweBoot in single user mode: 880bbf21555SRichard Lowe.Pp 881bbf21555SRichard Lowe.Dl boot -s 882bbf21555SRichard Lowe.Pp 883bbf21555SRichard LoweLoad the kernel, a boot_archive, and then autoboot in five seconds. 884bbf21555SRichard LoweNotice that a kernel must be loaded before any other 885bbf21555SRichard Lowe.Ic load 886bbf21555SRichard Lowecommand is attempted. 887bbf21555SRichard Lowe.Bd -literal -offset indent 888bbf21555SRichard Loweload /platform/i86pc/kernel/amd64/unix 889bbf21555SRichard Loweload -t rootfs /platform/i86pc/amd64/boot_archive 890bbf21555SRichard Loweautoboot 5 891bbf21555SRichard Lowe.Ed 892bbf21555SRichard Lowe.Pp 893bbf21555SRichard LoweSet the default device used for loading a kernel from a ZFS filesystem: 894bbf21555SRichard Lowe.Bd -literal -offset indent 895bbf21555SRichard Loweset currdev=zfs:rpool/ROOT/knowngood: 896bbf21555SRichard Lowe.Ed 897bbf21555SRichard Lowe.Sh NOTES 898bbf21555SRichard LoweAlthough setting the 899bbf21555SRichard Lowe.Va currdev 900bbf21555SRichard Loweas shown in the example above is supported, it is advisable to use loader 901bbf21555SRichard Lowebeadm command or boot environment menu instead. 902bbf21555SRichard LoweThe reason is, the beadm or menu selection will also instruct loader to clean up 903bbf21555SRichard Lowethe currently set configuration and load configuration from the new boot 904bbf21555SRichard Loweenvironment. 905bbf21555SRichard Lowe.Sh SEE ALSO 906bbf21555SRichard Lowe.Xr btxld 1onbld , 907bbf21555SRichard Lowe.Xr loader.conf 5 , 9086312020eSToomas Soome.Xr menu.lst 5 , 909bbf21555SRichard Lowe.Xr boot 8 910bbf21555SRichard Lowe.Sh STANDARDS 911bbf21555SRichard LoweFor the purposes of ANS Forth compliance, loader is an 912bbf21555SRichard Lowe.Bf Em 913bbf21555SRichard LoweANS Forth System with Environmental Restrictions, Providing 914bbf21555SRichard Lowe.Ef 915bbf21555SRichard Lowe.Bf Li 916bbf21555SRichard Lowe.No .( , 917bbf21555SRichard Lowe.No :noname , 918bbf21555SRichard Lowe.No ?do , 919bbf21555SRichard Loweparse, pick, roll, refill, to, value, \e, false, true, 920bbf21555SRichard Lowe.No <> , 921bbf21555SRichard Lowe.No 0<> , 922bbf21555SRichard Lowecompile\&, , erase, nip, tuck 923bbf21555SRichard Lowe.Ef 924bbf21555SRichard Lowe.Em and 925bbf21555SRichard Lowe.Li marker 926bbf21555SRichard Lowe.Bf Em 927bbf21555SRichard Lowefrom the Core Extensions word set, Providing the Exception Extensions 928bbf21555SRichard Loweword set, Providing the Locals Extensions word set, Providing the 929bbf21555SRichard LoweMemory-Allocation Extensions word set, Providing 930bbf21555SRichard Lowe.Ef 931bbf21555SRichard Lowe.Bf Li 932bbf21555SRichard Lowe\&.s, 933bbf21555SRichard Lowebye, forget, see, words, 934bbf21555SRichard Lowe\&[if], 935bbf21555SRichard Lowe\&[else] 936bbf21555SRichard Lowe.Ef 937bbf21555SRichard Lowe.Em and 938bbf21555SRichard Lowe.Li [then] 939bbf21555SRichard Lowe.Bf Em 940bbf21555SRichard Lowefrom the Programming-Tools extension word set, Providing the 941bbf21555SRichard LoweSearch-Order extensions word set. 942bbf21555SRichard Lowe.Ef 943