3 monitor, edparams \- load and start MINIX 3, modify boot parameters
19 This text describes the Boot Monitor, a boot time interactive program designed
20 not only to load and start MINIX 3, its most important task, but to also
21 provide an interface to configure MINIX 3 and to boot other operating systems.
23 The monitor is controlled with an environment that is modeled after the
24 Bourne shell. This environment is filled at startup with default values
25 that depend on the machine the monitor is running on and the environment
26 settings saved into the boot parameters sector (the second sector on a
27 device). When the environment is loaded, the monitor executes the function
30 which by default starts a simple menu.
32 The environment can be manipulated at boot time from the monitor prompt,
33 but may also be edited using
37 simulates the monitor as much as it can, echoing commands it can't execute
38 between brackets. It can also be used in Makefiles and scripts by giving
39 it commands as arguments.
41 The DOS version of the monitor, usually named
43 under DOS, boots MINIX 3 from a "DOS virtual disk".
45 is a simple COM program that interprets a DOS
46 file as a disk, loads a MINIX 3 kernel from the active partition in the same
47 way as the BIOS based monitor, and executes it to start MINIX 3. All the
48 monitor commands function in the same way, except for the
50 command, it can only load MINIX 3. The monitor grabs as much free memory as
51 it can for MINIX 3 to work in, as the
53 variable shows. Further details on how to run MINIX 3 under DOS, Windows 95,
54 or even Windows NT are written down in
57 The monitor is best described by the commands you can type to the '>'
58 prompt. This is known as the "monitor mode". You can enter this mode by
59 hitting the Escape key. These are the monitor commands:
61 \fIname\fP = [\fBdevice\fP] \fIvalue\fP
64 Set environment variable.
74 as being subject to device translation. (See the section on devices.) These
75 (name, value) pairs are passed to the kernel who uses them to configure
76 itself. These variables are passed by default:
80 This is the device used as your root device. It is by default set to
82 which means that the device specified by
84 will be loaded into the RAM disk and used as root. If you change this
85 variable then a physical device will be used as root, and the RAM disk will
86 be uninitialized and have the size specified by
92 Describes the device to use to initialize the RAM disk if
96 It's by default set to
98 a special name for the device the monitor booted from.
103 The size of the RAM disk. If the RAM disk is used for the root file system
104 then the root file system is stretched out to
117 depending on the hardware you have. You can set it to a smaller value to
118 test your kernel in a more limited environment.
123 The type of system bus, either
128 This answers basic questions like: "How many interrupt controllers and how
129 to initialize?" Or: "Does the keyboard have LEDs?"
134 List of memory free for use by MINIX 3. It is a comma separated list of
136 pairs denoting the byte offsets and sizes of free memory in hexadecimal.
137 .B "800:925E0,100000:F00000"
138 is a typical example of about 585K starting at 2K, and 15M starting at 1M.
139 (The first 2K are BIOS parameters and the 53K under the 640K boundary is
140 the monitor itself.) The very last number you can play with if you know
141 what you are doing. Either increase it if the monitor has it wrong, or
142 decrease it to test if MINIX 3 still runs with less memory then normal.
147 Describes capabilities of the VDU:
174 variable binds a driver to the first controller, i.e. the
176 devices. The monitor sets
178 to a suitable default, so that most machines can find their disk.
183 If set to a hexadecimal value it makes the monitor set the BIOS video mode to
184 this value when MINIX 3 is started.
185 This allows the use of video modes with more rows or colums than the
186 standard 80x25 mode. You can use any text mode in the 00-FF range, and VESA
187 extended modes in the 100-FFF range. Most text modes use a 9x16 font with
188 400 scanlines on screen, so you see 400/16 = 25 lines. The text mode can be
189 modified by adding special flags to the console setting. Add
190 2000 to switch to 480 scan lines, adding 20% more lines to the screen. Add
191 4000 to select a 9x14 font, so 28 or 34 lines are shown. Add 8000 instead
192 to select an 8x8 font showing 50 or 60 lines. Each setting has drawbacks.
193 Using 480 scanlines implies a 60 Hz refresh, so the screen may flicker. The
194 8x8 font looks squashed. More letters on screen require more memory, so there
195 is less for virtual consoles. Interesting modes to try are 4003 (80x28),
196 2003 (80x30), 6003 (80x34), 8003 (80x50), A003 (80x60), 109 (132x25),
197 10A (132x43), 10B (132x50), 10C (132x60). The 109 VESA mode is often
198 available, and can be modified like mode 3. Use mode 7 instead of 3 for
199 monochrome. Which modes and flags work can only be found out by experiment.
200 More parameters may follow the mode number that are of interest
201 to the console driver, see
207 Set by the DOS version of the monitor to the name of the virtual disk, i.e.
210 argument as shown above. The "dosfile" driver
211 will use this as the name of the file to use as a disk.
214 Two variables are only used by the monitor, even though they are passed to the
219 The name of the file containing the kernel image, by default
221 If it refers to a directory however then the newest file inside the
222 directory is chosen to be the kernel image. The names inside
224 are best set to the MINIX 3 version you are using, which looks good when the
225 monitor prints its name. Rules for pretty printing image names:
228 A '/' or '_' is changed to a space.
230 The first letter is changed from lowercase to uppercase.
232 An 'r' if followed by a digit changes to " revision ".
238 If set then only processes marked with this label or without a label are
239 loaded from the image.
242 .B Installboot \-boot
243 will create functions to select images and labels. These functions will set
247 and echo what you selected. The two numbers separated by a colon used as an
248 image name tell the starting sector and sector count of the image on disk.
251 \fIname\fP() \fIcommand\fP
255 Functions may be used to bundle a set of commands, so that you can easily
256 boot MINIX 3 with a different set of parameters then normal. E.g.
259 ram() { rootdev=ram; boot }
262 will allow you to run MINIX 3 with the root device on RAM for a change, if you
263 normally use a real device as root. There are three predefined functions,
265 with default value an
267 command that shows the monitor's startup banner,
273 with default value a command that clears the screen.
276 at startup to show the banner message and a menu. The
278 function is executed just before MINIX 3 is started. These three functions can
279 be redefined as you please.
282 \fIname\fP(\fIkey\fP) \fIcommand\fP
284 Define kernel selecting function.
286 The menu command uses functions like these to add menu entries to select
287 a different kernel from a boot disk.
288 .B Installboot \-boot
289 produces these functions when the images are labeled. The label
294 AT(a) {label=AT;image=42:626;echo AT kernel selected;menu}
297 With the menu option:
305 will then execute the
310 \fIname\fP(\fIkey\fP,\fItext\fP) \fIcommand\fP
312 User defined menu option.
314 This variant may be used to make any menu entry you like:
317 dos(d,Boot MS-DOS) boot d0p0
321 may be anything, even parentheses if they match.
330 is a user defined function then its value is expanded and executed in place of
332 Try a recursive one like 'rec() {rec;xx}' one day. You can see the monitor
333 run out of space with nice messages about using
335 to increase it's heap.
338 \fBboot\fP [\fB\-\fP\fIopts\fP]
340 \fBboot\fP \fIdevice\fP
342 Boot MINIX 3 or another O.S.
346 will load and execute the MINIX 3 image named by the
348 variable. With options the variable
352 before MINIX 3 is started, and unset when Minix returns. With a
356 loads the boot sector of
358 into memory and jumps to it, starting another operating system. You would
359 normally use partitions on the first hard disk for this command (d0p[0\-3]),
360 using d0 will also work (choosing the active partition). One can also boot
361 devices on the second hard disk (d1, d1p[0\-3]) if the bootstrap writer did
362 not hardwire the disk number to disk 0.
364 Some Operating Systems can only be booted from the active partition, if
367 then partition 2 is first made active. You'll then need to use
370 .BI "installboot \-m /dev/c0d0 /usr/mdec/jumpboot" " keys"
375 chosen so that MINIX 3 is booted at startup. (See
376 .BR installboot (8).)
381 Copies output to and takes input from serial line
383 (0-3) at 9600 baud, 8 bits, no parity.
384 This allows you to control a MINIX 3 system remotely through an RS-232
388 \fBdelay\fP [\fImsec\fP]
390 Delay (500 msec default).
392 Fast booting speed was one of the objectives when this program was created,
393 so a hard disk boot usually takes only a fraction of a second. If you need
394 some time (to hit Escape, or stare at the numbers) you can use
396 to make the monitor pause for a specified number of milliseconds.
399 \fBecho\fP \fIword\fP ...
403 Used to display messages, like the startup banner. Echo normally prints
404 the words with spaces in between and a newline at the end. Echo understands
405 special '\e' escape sequences as follows:
408 \e (At the end) Don't print a newline.
412 \ev Print the monitor's version numbers.
414 \ec Clear the screen.
416 \ew Wait until a RETURN is typed
418 \e\e Print a backslash.
422 \fBls\fP [\fIdirectory\fP]
424 List contents of a directory.
426 Useful when looking for kernel images.
433 This command allows you to execute functions defined with a
435 If no menu functions have been defined then
437 will use this one hidden built-in function:
440 *(=,Start Minix) boot
443 Kernel selecting functions only add new options to this set, but if you
444 define a two argument function yourself then the above one is no longer
445 shown, allowing you to customize the menu completely. Your first
446 function definition should therefore be one that starts MINIX 3.
448 Menu entries are shown in the same order as
450 shows them. If you don't like the order then you have to unset the
451 functions and retype them in the proper order.
453 If you type a key then a scheduled trap is killed and the appropriate menu
454 function is executed. If you need more time to choose then hit the
455 spacebar. A key not on the menu also kills a trap, but does nothing more.
462 This will save all the environment variables and functions with nondefault
463 values to the parameter sector (the second sector on the boot device), so
464 they are automatically set the next time you boot the monitor.
471 Show the current values of the environment variables and functions. Default
472 values are shown between parentheses to distinguish them from values that
476 \fBtrap\fP \fImsec\fP \fIfunction\fP
480 Schedules a function to be executed after
482 milliseconds. Only the monitor mode cannot be interrupted, a scheduled trap
483 is killed when the prompt is printed. Example:
486 main() {trap 10000 boot; menu}
489 This gives you 10 seconds to choose a menu option before MINIX 3 is booted.
492 \fBunset\fP \fIname\fP ...
494 Unset environment variables.
496 Removes the named variables and functions from the environment, and sets
497 special variables back to their default values. This is also the only way
498 to remove the "device name translation" property from a variable.
505 Reboot the machine, exit to MINIX 3 or exit to DOS as appropriate.
512 If the PC supports power management then turn it off, otherwise
513 print some error messages and do nothing.
516 \fB{\fP \fIcommand\fP; ... \fB}\fP
520 Treat a number of commands as a single command. Used for function
521 definitions when a function body must contain more than one command.
524 The MINIX 3 kernel can't do anything with device names, so they have to be
525 translated to device numbers before they are passed to the kernel. This
526 number is found under the st_rdev field (see
528 of the file on the boot file system. The monitor will look for the device
529 file with the working directory set to '/dev'. If it can't find the device
530 name then it will translate names like 'ram', 'fd1', 'c0d1p0', 'c1d0p2s0',
531 and even the obsolete 'hd2a' to what it itself thinks the numbers should be.
535 is translated to the name of the device booted from, like 'fd0',
536 or 'c0d0p1s0', and then searched for in /dev.
538 can only be translated to a device for the first controller, and only if
539 the disks on that controller are numbered without "gaps". (The master
540 device on the second IDE channel is always d2 on MINIX 3. The BIOS will
541 call it disk 0, 1, or 2 depending on the number of disks on the first
544 Controller numbers are meaningless to the BIOS, so everything is assumed to
545 be attached to controller 0. You can omit
547 for device names, and it is best to always omit
551 command, and to always use the full name for variables passed to MINIX 3.
553 A few extensions have been made to this program for kernel hackers. They
554 may be triggered by setting bits in the flags word in the kernel startup
555 code (the mpx file.) The flag bits are:
558 Call kernel in 386 mode.
561 Do not make space for the bss areas of processes other than the kernel.
564 Use the stack size set by
568 Load MM, FS, etc. into extended memory.
571 No need to patch process sizes into the kernel.
574 The kernel can return to the monitor on halt or reboot.
577 Offer generic BIOS support instead of just INT 13 (disk I/O).
580 Pass memory lists for free and used memory (processes).
583 Kernel returns monitor code on shutdown in boot parameters array.
593 command will hang forever on the original IBM PC (not the XT!). Not that it
594 matters, as everything takes forever on that box.
598 one can easily hide the identity of this program.
600 Earl Chew, for the inspiration his ShoeLace package provided, unless he wants
601 to file a "look and feel" suit against me, then I will say I modeled it after
602 the Sun ROM boot monitor, which is also true.
604 Kees J. Bot (kjb@cs.vu.nl)
606 .\" $PchId: monitor.8,v 1.11 2002/02/27 19:36:34 philip Exp $