Remove arch-alpha variable.
[dragonfly.git] / sys / boot / common / loader.8
CommitLineData
984263bc
MD
1.\" Copyright (c) 1999 Daniel C. Sobral
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
5ee58eed 25.\" $FreeBSD: src/sys/boot/common/loader.8,v 1.57 2003/06/29 20:57:55 brueffer Exp $
7deb6d08 26.\" $DragonFly: src/sys/boot/common/loader.8,v 1.8 2005/02/20 16:31:53 swildner Exp $
984263bc
MD
27.\"
28.\" Note: The date here should be updated whenever a non-trivial
29.\" change is made to the manual page.
30.Dd March 14, 1999
31.Dt LOADER 8
32.Os
33.Sh NAME
34.Nm loader
35.Nd kernel bootstrapping final stage
36.Sh DESCRIPTION
37The program called
38.Nm
39is the final stage of
9bb2a92d 40.Dx Ns 's
984263bc
MD
41kernel bootstrapping process.
42On IA32 (i386) architectures, it is a
43.Pa BTX
44client.
45It is linked statically to
46.Xr libstand 3
47and usually located in the directory
48.Pa /boot .
49.Pp
50It provides a scripting language that can be used to
51automate tasks, do pre-configuration or assist in recovery
52procedures.
53This scripting language is roughly divided in
54two main components.
55The smaller one is a set of commands
56designed for direct use by the casual user, called "builtin
57commands" for historical reasons.
58The main drive behind these commands is user-friendliness.
59The bigger component is an
60.Tn ANS
5ee58eed 61Forth compatible Forth interpreter based on FICL, by
984263bc
MD
62.An John Sadler .
63.Pp
64During initialization,
65.Nm
66will probe for a console and set the
67.Va console
68variable, or set it to serial console
69.Pq Dq comconsole
70if the previous boot stage used that.
71Then, devices are probed,
72.Va currdev
73and
74.Va loaddev
75are set, and
76.Va LINES
77is set to 24.
78Next,
79.Tn FICL
80is initialized, the builtin words are added to its vocabulary, and
81.Pa /boot/boot.4th
5ee58eed 82is processed if it exists.
984263bc
MD
83No disk switching is possible while that file is being read.
84The inner interpreter
85.Nm
86will use with
87.Tn FICL
88is then set to
89.Ic interpret ,
90which is
91.Tn FICL Ns 's
92default.
93After that,
94.Pa /boot/loader.rc
95is processed if available, and, failing that,
96.Pa /boot/boot.conf
5ee58eed 97is read for historical reasons.
984263bc
MD
98These files are processed through the
99.Ic include
100command, which reads all of them into memory before processing them,
101making disk changes possible.
102.Pp
103At this point, if an
104.Ic autoboot
105has not been tried, and if
106.Va autoboot_delay
107is not set to
108.Dq NO
109(not case sensitive), then an
110.Ic autoboot
111will be tried.
112If the system gets past this point,
113.Va prompt
114will be set and
115.Nm
116will engage interactive mode.
117.Sh BUILTIN COMMANDS
5ee58eed
MD
118In
119.Nm ,
120builtin commands take parameters from the command line.
984263bc
MD
121Presently,
122the only way to call them from a script is by using
123.Pa evaluate
124on a string.
125If an error condition occurs, an exception will be generated,
126which can be intercepted using
127.Tn ANS
128Forth exception handling
129words.
130If not intercepted, an error message will be displayed and
131the interpreter's state will be reset, emptying the stack and restoring
132interpreting mode.
133.Pp
134The builtin commands available are:
135.Pp
136.Bl -tag -width Ds -compact
137.It Ic autoboot Op Ar seconds
138Proceeds to bootstrap the system after a number of seconds, if not
139interrupted by the user.
140Displays a countdown prompt
141warning the user the system is about to be booted,
142unless interrupted by a key press.
143The kernel will be loaded first if necessary.
144Defaults to 10 seconds.
145.Pp
146.It Ic bcachestat
147Displays statistics about disk cache usage.
148For depuration only.
149.Pp
150.It Ic boot
151.It Ic boot Ar kernelname Op Cm ...
152.It Ic boot Fl flag Cm ...
153Immediately proceeds to bootstrap the system, loading the kernel
154if necessary.
155Any flags or arguments are passed to the kernel, but they
156must precede the kernel name, if a kernel name is provided.
157.Pp
158.Em WARNING :
159The behavior of this builtin is changed if
160.Xr loader.4th 8
161is loaded.
162.Pp
163.It Ic echo Xo
164.Op Fl n
165.Op Aq message
166.Xc
167Displays text on the screen.
168A new line will be printed unless
169.Fl n
170is specified.
171.Pp
172.It Ic heap
173Displays memory usage statistics.
174For debugging purposes only.
175.Pp
176.It Ic help Op topic Op subtopic
177Shows help messages read from
178.Pa /boot/loader.help .
179The special topic
180.Em index
181will list the topics available.
182.Pp
183.It Ic include Ar file Op Ar
184Process script files.
185Each file, in turn, is completely read into memory,
186and then each of its lines is passed to the command line interpreter.
187If any error is returned by the interpreter, the include
188command aborts immediately, without reading any other files, and
189returns an error itself (see
190.Sx ERRORS ) .
191.Pp
192.It Ic load Xo
193.Op Fl t Ar type
194.Ar file Cm ...
195.Xc
196Loads a kernel, kernel loadable module (kld), or file of opaque
197contents tagged as being of the type
198.Ar type .
199Kernel and modules can be either in a.out or ELF format.
200Any arguments passed after the name of the file to be loaded
201will be passed as arguments to that file.
202Currently, argument passing does not work for the kernel.
203.Pp
204.It Ic ls Xo
205.Op Fl l
206.Op Ar path
207.Xc
208Displays a listing of files in the directory
209.Ar path ,
210or the root directory if
211.Ar path
212is not specified.
213If
214.Fl l
215is specified, file sizes will be shown too.
216.Pp
217.It Ic lsdev Op Fl v
218Lists all of the devices from which it may be possible to load modules.
219If
220.Fl v
221is specified, more details are printed.
222.Pp
223.It Ic lsmod Op Fl v
224Displays loaded modules.
225If
226.Fl v
227is specified, more details are shown.
228.Pp
229.It Ic more Ar file Op Ar
230Display the files specified, with a pause at each
231.Va LINES
232displayed.
233.Pp
234.It Ic pnpscan Op Fl v
235Scans for Plug-and-Play devices.
236This is not functional at present.
237.Pp
238.It Ic read Xo
239.Op Fl t Ar seconds
240.Op Fl p Ar prompt
241.Op Va variable
242.Xc
243Reads a line of input from the terminal, storing it in
244.Va variable
245if specified.
246A timeout can be specified with
247.Fl t ,
248though it will be canceled at the first key pressed.
249A prompt may also be displayed through the
250.Fl p
251flag.
252.Pp
253.It Ic reboot
254Immediately reboots the system.
255.Pp
256.It Ic set Ar variable
257.It Ic set Ar variable Ns = Ns Ar value
258Set loader's environment variables.
259.Pp
260.It Ic show Op Va variable
261Displays the specified variable's value, or all variables and their
262values if
263.Va variable
264is not specified.
265.Pp
266.It Ic unload
267Remove all modules from memory.
268.Pp
269.It Ic unset Va variable
270Removes
271.Va variable
272from the environment.
273.Pp
274.It Ic \&?
275Same as
276.Dq help index .
277.Pp
278.El
279.Ss BUILTIN ENVIRONMENT VARIABLES
280The
281.Nm
282has actually two different kinds of
283.Sq environment
284variables.
285There are ANS Forth's
286.Em environmental queries ,
287and a separate space of environment variables used by builtins, which
288are not directly available to Forth words.
289It is the latter type that this section covers.
290.Pp
291Environment variables can be set and unset through the
292.Ic set
293and
294.Ic unset
295builtins, and can have their values interactively examined through the
296use of the
297.Ic show
298builtin.
299Their values can also be accessed as described in
300.Sx BUILTIN PARSER .
301.Pp
302Notice that these environment variables are not inherited by any shell
303after the system has been booted.
304.Pp
305A few variables are set automatically by
306.Nm .
307Others can affect the behavior of either
308.Nm
309or the kernel at boot.
310Some options may require a value,
311while others define behavior just by being set.
312Both types of builtin variables are described below.
313.Bl -tag -width bootfile
5ee58eed
MD
314.It Va acpi_load
315Unset this to disable automatic loading of the ACPI module.
316See also
317.Va hint.acpi.0.disabled
318in
319.Xr device.hints 5 .
984263bc
MD
320.It Va autoboot_delay
321Number of seconds
322.Ic autoboot
323will wait before booting.
324If this variable is not defined,
325.Ic autoboot
326will default to 10 seconds.
327.Pp
328If set to
329.Dq NO ,
330no
331.Ic autoboot
332will be automatically attempted after processing
333.Pa /boot/loader.rc ,
334though explicit
335.Ic autoboot Ns 's
336will be processed normally, defaulting to 10 seconds delay.
337.It Va boot_askname
338Instructs the kernel to prompt the user for the name of the root device
339when the kernel is booted.
340.It Va boot_ddb
341Instructs the kernel to start in the DDB debugger, rather than
342proceeding to initialize when booted.
343.It Va boot_gdb
344Selects gdb-remote mode for the kernel debugger by default.
345.It Va boot_single
346Prevents the kernel from initiating a multi-user startup; instead single-user
347mode will be entered when the kernel has finished device probing.
348.It Va boot_userconfig
349Requests that the kernel's interactive device configuration program
350be run when the kernel is booted.
351.It Va boot_verbose
352Setting this variable causes extra debugging information to be printed
353by the kernel during the boot phase.
354.It Va bootfile
355List of semicolon-separated search path for bootable kernels.
356The default is
357.Dq Li kernel;kernel.old .
358.It Va console
359Defines the current console.
360.It Va currdev
361Selects the default device.
362Syntax for devices is odd.
363.It Va init_path
364Sets the list of binaries which the kernel will try to run as the initial
365process.
366The first matching binary is used.
367The default list is
368.Dq Li /sbin/init:/sbin/oinit:/sbin/init.bak:/stand/sysinstall .
369.It Va interpret
370Has the value
371.Dq Li ok
372if the Forth's current state is interpreting.
373.It Va LINES
374Define the number of lines on the screen, to be used by the pager.
375.It Va module_path
376Sets the list of directories which will be searched for modules
377named in a load command or implicitly required by a dependency.
378The default value for this variable is
2e7cfdc9 379.Dq Li /;/boot;/modules .
984263bc
MD
380.It Va num_ide_disks
381Sets the number of IDE disks as a workaround for some problems in
382finding the root disk at boot.
383This has been deprecated in favor of
384.Va root_disk_unit .
385.It Va prompt
386Value of
387.Nm Ns 's
388prompt.
389Defaults to
390.Dq Li "${currdev}>" .
391.It Va root_disk_unit
392If the code which detects the disk unit number for the root disk is
393confused, e.g. by a mix of SCSI and IDE disks, or IDE disks with
394gaps in the sequence (e.g. no primary slave), the unit number can
395be forced by setting this variable.
396.It Va rootdev
397By default the value of
398.Va currdev
5ee58eed 399is used to set the root file system
984263bc
MD
400when the kernel is booted.
401This can be overridden by setting
402.Va rootdev
403explicitly.
404.It Va dumpdev
405The name of a device where the kernel can save a crash dump in case
406of a panic.
407This automatically sets the
408.Va kern.dumpdev
409.Xr sysctl 3
410MIB variable.
411.El
412.Pp
413Other variables are used to override kernel tunable parameters.
414The following tunables are available:
415.Bl -tag -width Va
5ee58eed
MD
416.It Va hw.physmem
417Limit the amount of physical memory the system will use.
418By default the size is in bytes, but the
419.Cm k , K , m , M , g
420and
421.Cm G
422suffixes
423are also accepted and indicate kilobytes, megabytes and gigabytes
424respectively.
425An invalid suffix will result in the variable being ignored by the
426kernel.
427.It Va hw.pci.enable_io_modes
428Enable PCI resources which are left off by some BIOSes or are not
429enabled correctly by the device driver.
430Tunable value set to ON (1) by default, but this may cause problems
431with some peripherals.
432.It Va hw.pci.allow_unsupported_io_range
433Allow the PCI bridge to pass through an unsupported memory range
434assigned by the BIOS.
435Tunable value set to OFF (0) by default.
984263bc
MD
436.It Va kern.maxusers
437Set the size of a number of statically allocated system tables; see
438.Xr tuning 7
439for a description of how to select an appropriate value for this
440tunable.
441When set, this tunable replaces the value declared in the kernel
442compile-time configuration file.
443.It Va kern.ipc.nmbclusters
444Set the number of mbuf clusters to be allocated.
445The value cannot be set below the default
446determined when the kernel was compiled.
447Modifies
448.Va NMBCLUSTERS .
5ee58eed
MD
449.It Va kern.ipc.nsfbufs
450Set the number of
451.Xr sendfile 2
452buffers to be allocated.
453Overrides
454.Dv NSFBUFS .
29ad119f
DR
455.It Va kern.mmxopt
456Toggles the mmx optimizations for the bcopy/copyin/copyout routines
984263bc
MD
457.It Va kern.vm.kmem.size
458Sets the size of kernel memory (bytes).
5ee58eed 459This overrides the value determined when the kernel was compiled.
984263bc
MD
460Modifies
461.Va VM_KMEM_SIZE .
462.It Va kern.maxswzone
463Limits the amount of KVM to be used to hold swap
464meta information, which directly governs the
465maximum amount of swap the system can support.
466This value is specified in bytes of KVA space
467and defaults to around 70MBytes.
468Care should be taken
469to not reduce this value such that the actual
470amount of configured swap exceeds 1/2 the
471kernel-supported swap.
472The default 70MB allows
473the kernel to support a maximum of (approximately)
47414GB of configured swap.
475Only mess around with
476this parameter if you need to greatly extend the
477KVM reservation for other resources such as the
478buffer cache or
479.Va NMBCLUSTERS .
480Modifies
481.Va VM_SWZONE_SIZE_MAX .
482.It Va kern.maxbcache
483Limits the amount of KVM reserved for use by the
484buffer cache, specified in bytes.
485The default maximum is 200MB.
486This parameter is used to
487prevent the buffer cache from eating too much
488KVM in large-memory machine configurations.
489Only mess around with this parameter if you need to
490greatly extend the KVM reservation for other resources
491such as the swap zone or
492.Va NMBCLUSTERS .
493Note that
494the NBUF parameter will override this limit.
495Modifies
496.Va VM_BCACHE_SIZE_MAX .
5ee58eed
MD
497.It Va machdep.disable_mtrrs
498Disable the use of i686 MTRRs (x86 only).
984263bc
MD
499.It Va net.inet.tcp.tcbhashsize
500Overrides the compile-time set value of
501.Va TCBHASHSIZE
502or the preset default of 512.
503Must be a power of 2.
504.El
505.Ss BUILTIN PARSER
506When a builtin command is executed, the rest of the line is taken
507by it as arguments, and it is processed by a special parser which
508is not used for regular Forth commands.
509.Pp
510This special parser applies the following rules to the parsed text:
511.Pp
512.Bl -enum
513.It
514All backslash characters are preprocessed.
515.Bl -bullet
516.It
517\eb , \ef , \er , \en and \et are processed as in C.
518.It
519\es is converted to a space.
520.It
521\ev is converted to
522.Tn ASCII
52311.
524.It
525\ez is just skipped.
526Useful for things like
527.Dq \e0xf\ez\e0xf .
528.It
529\e0xN and \e0xNN are replaced by the hex N or NN.
530.It
531\eNNN is replaced by the octal NNN
532.Tn ASCII
533character.
534.It
535\e" , \e' and \e$ will escape these characters, preventing them from
536receiving special treatment in Step 2, described below.
537.It
538\e\e will be replaced with a single \e .
539.It
540In any other occurrence, backslash will just be removed.
541.El
542.It
543Every string between non-escaped quotes or double-quotes will be treated
544as a single word for the purposes of the remaining steps.
545.It
546Replace any
547.Li $VARIABLE
548or
549.Li ${VARIABLE}
550with the value of the environment variable
551.Va VARIABLE .
552.It
553Space-delimited arguments are passed to the called builtin command.
554Spaces can also be escaped through the use of \e\e .
555.El
556.Pp
557An exception to this parsing rule exists, and is described in
558.Sx BUILTINS AND FORTH .
559.Ss BUILTINS AND FORTH
560All builtin words are state-smart, immediate words.
561If interpreted, they behave exactly as described previously.
562If they are compiled, though,
563they extract their arguments from the stack instead of the command line.
564.Pp
565If compiled, the builtin words expect to find, at execution time, the
566following parameters on the stack:
567.D1 Ar addrN lenN ... addr2 len2 addr1 len1 N
568where
569.Ar addrX lenX
570are strings which will compose the command line that will be parsed
571into the builtin's arguments.
572Internally, these strings are concatenated in from 1 to N,
573with a space put between each one.
574.Pp
575If no arguments are passed, a 0
576.Em must
577be passed, even if the builtin accepts no arguments.
578.Pp
579While this behavior has benefits, it has its trade-offs.
580If the execution token of a builtin is acquired (through
581.Ic '
582or
583.Ic ['] ) ,
584and then passed to
585.Ic catch
586or
587.Ic execute ,
588the builtin behavior will depend on the system state
589.Bf Em
590at the time
591.Ic catch
592or
593.Ic execute
594is processed
595.Ef
596\&! This is particularly annoying for programs that want or need to
597handle exceptions.
598In this case, the use of a proxy is recommended.
599For example:
600.Dl : (boot) boot ;
601.Sh FICL
602.Tn FICL
603is a Forth interpreter written in C, in the form of a forth
604virtual machine library that can be called by C functions and vice
605versa.
606.Pp
607In
608.Nm ,
609each line read interactively is then fed to
610.Tn FICL ,
611which may call
612.Nm
613back to execute the builtin words.
614The builtin
615.Ic include
616will also feed
617.Tn FICL ,
618one line at a time.
619.Pp
620The words available to
621.Tn FICL
622can be classified into four groups.
623The
624.Tn ANS
625Forth standard words, extra
626.Tn FICL
627words, extra
9bb2a92d 628.Dx
984263bc
MD
629words, and the builtin commands;
630the latter were already described.
631The
632.Tn ANS
633Forth standard words are listed in the
634.Sx STANDARDS
635section.
636The words falling in the two other groups are described in the
637following subsections.
638.Ss FICL EXTRA WORDS
639.Bl -tag -width wid-set-super
640.It Ic .env
641.It Ic .ver
642.It Ic -roll
643.It Ic 2constant
644.It Ic >name
645.It Ic body>
646.It Ic compare
647This is the STRING word set's
648.Ic compare .
649.It Ic compile-only
650.It Ic endif
651.It Ic forget-wid
652.It Ic parse-word
653.It Ic sliteral
654This is the STRING word set's
655.Ic sliteral .
656.It Ic wid-set-super
657.It Ic w@
658.It Ic w!
659.It Ic x.
660.It Ic empty
661.It Ic cell-
662.It Ic -rot
663.El
664.Ss FREEBSD EXTRA WORDS
665.Bl -tag -width XXXXXXXX
666.It Ic \&$ Pq --
667Evaluates the remainder of the input buffer, after having printed it first.
668.It Ic \&% Pq --
669Evaluates the remainder of the input buffer under a
670.Ic catch
671exception guard.
672.It Ic .#
673Works like
674.Ic .
675but without outputting a trailing space.
676.It Ic fclose Pq Ar fd --
677Closes a file.
678.It Ic fkey Pq Ar fd -- char
679Reads a single character from a file.
680.It Ic fload Pq Ar fd --
681Processes a file
682.Em fd .
5ee58eed 683.It Ic fopen Pq Ar addr len mode Li -- Ar fd
984263bc 684Opens a file.
5ee58eed
MD
685Returns a file descriptor, or \-1 in case of failure.
686The
687.Ar mode
688parameter selects whether the file is to be opened for read access, write
689access, or both.
690The constants
691.Dv O_RDONLY , O_WRONLY ,
692and
693.Dv O_RDWR
694are defined in
695.Pa /boot/support.4th ,
696indicating read only, write only, and read-write access, respectively.
984263bc
MD
697.It Xo
698.Ic fread
699.Pq Ar fd addr len -- len'
700.Xc
701Tries to read
702.Em len
703bytes from file
704.Em fd
705into buffer
706.Em addr .
707Returns the actual number of bytes read, or -1 in case of error or end of
708file.
709.It Ic heap? Pq -- Ar cells
710Return the space remaining in the dictionary heap, in cells.
711This is not related to the heap used by dynamic memory allocation words.
712.It Ic inb Pq Ar port -- char
713Reads a byte from a port.
714.It Ic key Pq -- Ar char
715Reads a single character from the console.
716.It Ic key? Pq -- Ar flag
717Returns
718.Ic true
719if there is a character available to be read from the console.
720.It Ic ms Pq Ar u --
721Waits
722.Em u
723microseconds.
724.It Ic outb Pq Ar port char --
725Writes a byte to a port.
726.It Ic seconds Pq -- Ar u
727Returns the number of seconds since midnight.
728.It Ic tib> Pq -- Ar addr len
729Returns the remainder of the input buffer as a string on the stack.
730.It Ic trace! Pq Ar flag --
731Activates or deactivates tracing.
732Does not work with
733.Ic catch .
734.El
735.Ss FREEBSD DEFINED ENVIRONMENTAL QUERIES
736.Bl -tag -width Ds
737.It arch-i386
738.Ic TRUE
739if the architecture is IA32.
9bb2a92d
HP
740.It DragonFly_version
741.Dx
984263bc
MD
742version at compile time.
743.It loader_version
744.Nm
745version.
746.El
747.Ss SYSTEM DOCUMENTATION
748.Sh FILES
749.Bl -tag -width /boot/defaults/loader.conf -compact
750.It Pa /boot/loader
751.Nm
752itself.
753.It Pa /boot/boot.4th
754Additional
755.Tn FICL
756initialization.
757.It Pa /boot/boot.conf
758.Nm
759bootstrapping script.
760Deprecated.
761.It Pa /boot/defaults/loader.conf
762.It Pa /boot/loader.conf
763.It Pa /boot/loader.conf.local
764.Nm
765configuration files, as described in
766.Xr loader.conf 5 .
767.It Pa /boot/loader.rc
768.Nm
769bootstrapping script.
770.It Pa /boot/loader.help
771Loaded by
772.Ic help .
773Contains the help messages.
774.El
775.Sh EXAMPLES
776Boot in single user mode:
777.Pp
778.Dl boot -s
779.Pp
780Load kernel's user configuration file.
781Notice that a kernel must be loaded before any other
782.Ic load
783command is attempted.
784.Bd -literal -offset indent
785load kernel
786load -t userconfig_script /boot/kernel.conf
787.Ed
788.Pp
789Load the kernel, a splash screen, and then autoboot in five seconds.
790.Bd -literal -offset indent
791load kernel
792load splash_bmp
793load -t splash_image_data /boot/chuckrulez.bmp
794autoboot 5
795.Ed
796.Pp
797Set the disk unit of the root device to 2, and then boot.
798This would be needed in a system with two IDE disks,
799with the second IDE disk hardwired to wd2 instead of wd1.
800.Bd -literal -offset indent
801set root_disk_unit=2
802boot /kernel
803.Ed
804.Pp
805See also:
806.Bl -tag -width /usr/share/examples/bootforth/X
807.It Pa /boot/loader.4th
808Extra builtin-like words.
809.It Pa /boot/support.4th
810.Pa loader.conf
811processing words.
812.It Pa /usr/share/examples/bootforth/
813Assorted examples.
814.El
815.Sh ERRORS
816The following values are thrown by
817.Nm :
818.Bl -tag -width XXXXX -offset indent
819.It 100
820Any type of error in the processing of a builtin.
821.It -1
822.Ic Abort
823executed.
824.It -2
825.Ic Abort"
826executed.
827.It -56
828.Ic Quit
829executed.
830.It -256
831Out of interpreting text.
832.It -257
833Need more text to succeed -- will finish on next run.
834.It -258
835.Ic Bye
836executed.
837.It -259
838Unspecified error.
839.El
840.Sh SEE ALSO
841.Xr libstand 3 ,
842.Xr loader.conf 5 ,
843.Xr tuning 7 ,
844.Xr boot 8 ,
845.Xr btxld 8
846.Sh STANDARDS
847For the purposes of ANS Forth compliance, loader is an
848.Bf Em
849ANS Forth System with Environmental Restrictions, Providing
850.Ef
851.Bf Li
852.No .( ,
853.No :noname ,
854.No ?do ,
855parse, pick, roll, refill, to, value, \e, false, true,
856.No <> ,
857.No 0<> ,
858compile\&, , erase, nip, tuck
859.Ef
860.Em and
861.Li marker
862.Bf Em
863from the Core Extensions word set, Providing the Exception Extensions
864word set, Providing the Locals Extensions word set, Providing the
865Memory-Allocation Extensions word set, Providing
866.Ef
867.Bf Li
868\&.s,
869bye, forget, see, words,
870\&[if],
871\&[else]
872.Ef
873.Em and
874.Li [then]
875.Bf Em
876from the Programming-Tools extension word set, Providing the
877Search-Order extensions word set.
878.Ef
879.Sh HISTORY
5ee58eed 880The
984263bc
MD
881.Nm
882first appeared in
883.Fx 3.1 .
884.Sh AUTHORS
885.An -nosplit
5ee58eed 886The
984263bc
MD
887.Nm
888was written by
889.An Michael Smith Aq msmith@FreeBSD.org .
890.Pp
891.Tn FICL
892was written by
893.An John Sadler Aq john_sadler@alum.mit.edu .
894.Sh BUGS
895The
896.Ic expect
897and
898.Ic accept
899words will read from the input buffer instead of the console.
900The latter will be fixed, but the former will not.