source: trunk/minix/man/man8/monitor.8@ 11

Last change on this file since 11 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 16.1 KB
Line 
1.TH MONITOR 8
2.SH NAME
3monitor, edparams \- load and start MINIX 3, modify boot parameters
4.SH SYNOPSIS
5.B /boot
6.br
7.B edparams
8.I device
9.RI [ command " ...]"
10.br
11.B boot.com
12.I virdisk
13.RI [ command " ...]"
14.SH DESCRIPTION
15.de SP
16.if t .sp 0.4
17.if n .sp
18..
19This text describes the Boot Monitor, a boot time interactive program designed
20not only to load and start MINIX 3, its most important task, but to also
21provide an interface to configure MINIX 3 and to boot other operating systems.
22.PP
23The monitor is controlled with an environment that is modeled after the
24Bourne shell. This environment is filled at startup with default values
25that depend on the machine the monitor is running on and the environment
26settings saved into the boot parameters sector (the second sector on a
27device). When the environment is loaded, the monitor executes the function
28named
29.BR main ,
30which by default starts a simple menu.
31.PP
32The environment can be manipulated at boot time from the monitor prompt,
33but may also be edited using
34.B edparams
35on a given device.
36.B Edparams
37simulates the monitor as much as it can, echoing commands it can't execute
38between brackets. It can also be used in Makefiles and scripts by giving
39it commands as arguments.
40.PP
41The DOS version of the monitor, usually named
42.B boot.com
43under DOS, boots MINIX 3 from a "DOS virtual disk".
44.B Boot.com
45is a simple COM program that interprets a DOS
46file as a disk, loads a MINIX 3 kernel from the active partition in the same
47way as the BIOS based monitor, and executes it to start MINIX 3. All the
48monitor commands function in the same way, except for the
49.B boot
50command, it can only load MINIX 3. The monitor grabs as much free memory as
51it can for MINIX 3 to work in, as the
52.B memory
53variable shows. Further details on how to run MINIX 3 under DOS, Windows 95,
54or even Windows NT are written down in
55.BR dosminix (8).
56.SH COMMANDS
57The monitor is best described by the commands you can type to the '>'
58prompt. This is known as the "monitor mode". You can enter this mode by
59hitting the Escape key. These are the monitor commands:
60.PP
61\fIname\fP = [\fBdevice\fP] \fIvalue\fP
62.SP
63.RS
64Set environment variable.
65.br
66Changes the value of
67.I name
68to
69.IR value .
70The optional word
71.B device
72marks
73.I name
74as 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
76itself. These variables are passed by default:
77.SP
78.B rootdev
79.RS
80This is the device used as your root device. It is by default set to
81.BR ram,
82which means that the device specified by
83.B ramimagedev
84will be loaded into the RAM disk and used as root. If you change this
85variable then a physical device will be used as root, and the RAM disk will
86be uninitialized and have the size specified by
87.BR ramsize .
88.RE
89.SP
90.B ramimagedev
91.RS
92Describes the device to use to initialize the RAM disk if
93.B rootdev
94is set to
95.BR ram .
96It's by default set to
97.BR bootdev ,
98a special name for the device the monitor booted from.
99.RE
100.SP
101.B ramsize
102.RS
103The size of the RAM disk. If the RAM disk is used for the root file system
104then the root file system is stretched out to
105.B ramsize
106if possible.
107.RE
108.SP
109.B processor
110.RS
111Set by default to
112.BR 86 ,
113.BR 186 ,
114.BR 286 ,
115.BR 386 ,
116.BR 486 ", ..."
117depending on the hardware you have. You can set it to a smaller value to
118test your kernel in a more limited environment.
119.RE
120.SP
121.B bus
122.RS
123The type of system bus, either
124.BR xt ,
125.BR at
126or
127.BR mca .
128This answers basic questions like: "How many interrupt controllers and how
129to initialize?" Or: "Does the keyboard have LEDs?"
130.RE
131.SP
132.B memory
133.RS
134List of memory free for use by MINIX 3. It is a comma separated list of
135.IR base:size
136pairs denoting the byte offsets and sizes of free memory in hexadecimal.
137.B "800:925E0,100000:F00000"
138is 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
140the monitor itself.) The very last number you can play with if you know
141what you are doing. Either increase it if the monitor has it wrong, or
142decrease it to test if MINIX 3 still runs with less memory then normal.
143.RE
144.SP
145.B video
146.RS
147Describes capabilities of the VDU:
148.BR mda ,
149.BR cga ,
150.B ega
151or
152.BR vga .
153.RE
154.SP
155.B chrome
156.RS
157Either
158.B color
159or
160.BR mono .
161.RE
162.SP
163.B c0
164.RS
165By default
166.B at
167(AT compatibles),
168.B bios
169(XT or PS/2), or
170.B dosfile
171(running under DOS).
172The
173.B c0
174variable binds a driver to the first controller, i.e. the
175.B /dev/c0*
176devices. The monitor sets
177.B c0
178to a suitable default, so that most machines can find their disk.
179.RE
180.SP
181.B console
182.RS
183If set to a hexadecimal value it makes the monitor set the BIOS video mode to
184this value when MINIX 3 is started.
185This allows the use of video modes with more rows or colums than the
186standard 80x25 mode. You can use any text mode in the 00-FF range, and VESA
187extended modes in the 100-FFF range. Most text modes use a 9x16 font with
188400 scanlines on screen, so you see 400/16 = 25 lines. The text mode can be
189modified by adding special flags to the console setting. Add
1902000 to switch to 480 scan lines, adding 20% more lines to the screen. Add
1914000 to select a 9x14 font, so 28 or 34 lines are shown. Add 8000 instead
192to select an 8x8 font showing 50 or 60 lines. Each setting has drawbacks.
193Using 480 scanlines implies a 60 Hz refresh, so the screen may flicker. The
1948x8 font looks squashed. More letters on screen require more memory, so there
195is less for virtual consoles. Interesting modes to try are 4003 (80x28),
1962003 (80x30), 6003 (80x34), 8003 (80x50), A003 (80x60), 109 (132x25),
19710A (132x43), 10B (132x50), 10C (132x60). The 109 VESA mode is often
198available, and can be modified like mode 3. Use mode 7 instead of 3 for
199monochrome. Which modes and flags work can only be found out by experiment.
200More parameters may follow the mode number that are of interest
201to the console driver, see
202.BR boot (8).
203.RE
204.SP
205.B dosfile-d0
206.RS
207Set by the DOS version of the monitor to the name of the virtual disk, i.e.
208the
209.I virdisk
210argument as shown above. The "dosfile" driver
211will use this as the name of the file to use as a disk.
212.RE
213.SP
214Two variables are only used by the monitor, even though they are passed to the
215kernel too:
216.SP
217.B image
218.RS
219The name of the file containing the kernel image, by default
220.BR minix .
221If it refers to a directory however then the newest file inside the
222directory is chosen to be the kernel image. The names inside
223.B /minix/
224are best set to the MINIX 3 version you are using, which looks good when the
225monitor prints its name. Rules for pretty printing image names:
226.RS
227.SP
228A '/' or '_' is changed to a space.
229.SP
230The first letter is changed from lowercase to uppercase.
231.SP
232An 'r' if followed by a digit changes to " revision ".
233.RE
234.RE
235.SP
236.B label
237.RS
238If set then only processes marked with this label or without a label are
239loaded from the image.
240.RE
241.SP
242.B Installboot \-boot
243will create functions to select images and labels. These functions will set
244.B label
245and
246.B image
247and echo what you selected. The two numbers separated by a colon used as an
248image name tell the starting sector and sector count of the image on disk.
249.RE
250.SP
251\fIname\fP() \fIcommand\fP
252.RS
253Define function.
254.br
255Functions may be used to bundle a set of commands, so that you can easily
256boot MINIX 3 with a different set of parameters then normal. E.g.
257.SP
258.RS
259ram() { rootdev=ram; boot }
260.RE
261.SP
262will allow you to run MINIX 3 with the root device on RAM for a change, if you
263normally use a real device as root. There are three predefined functions,
264.BR leader ,
265with default value an
266.B echo
267command that shows the monitor's startup banner,
268.BR main ,
269with default value
270.BR menu ,
271and
272.BR trailer ,
273with default value a command that clears the screen.
274The monitor executes
275.B leader;main
276at startup to show the banner message and a menu. The
277.B trailer
278function is executed just before MINIX 3 is started. These three functions can
279be redefined as you please.
280.RE
281.SP
282\fIname\fP(\fIkey\fP) \fIcommand\fP
283.RS
284Define kernel selecting function.
285.br
286The menu command uses functions like these to add menu entries to select
287a different kernel from a boot disk.
288.B Installboot \-boot
289produces these functions when the images are labeled. The label
290.B AT
291would give:
292.SP
293.RS
294AT(a) {label=AT;image=42:626;echo AT kernel selected;menu}
295.RE
296.SP
297With the menu option:
298.SP
299.RS
300a Select AT kernel
301.RE
302.SP
303Typing
304.B a
305will then execute the
306.B AT
307function above.
308.RE
309.SP
310\fIname\fP(\fIkey\fP,\fItext\fP) \fIcommand\fP
311.RS
312User defined menu option.
313.br
314This variant may be used to make any menu entry you like:
315.SP
316.RS
317dos(d,Boot MS-DOS) boot d0p0
318.RE
319.SP
320.I Text
321may be anything, even parentheses if they match.
322.RE
323.SP
324.I name
325.RS
326Call function.
327.br
328If
329.I name
330is a user defined function then its value is expanded and executed in place of
331.IR name .
332Try a recursive one like 'rec() {rec;xx}' one day. You can see the monitor
333run out of space with nice messages about using
334.BR chmem (1)
335to increase it's heap.
336.RE
337.SP
338\fBboot\fP [\fB\-\fP\fIopts\fP]
339.br
340\fBboot\fP \fIdevice\fP
341.RS
342Boot MINIX 3 or another O.S.
343.br
344Without an argument,
345.B boot
346will load and execute the MINIX 3 image named by the
347.B image
348variable. With options the variable
349.B bootopts
350is first set to
351.BI \- opts
352before MINIX 3 is started, and unset when Minix returns. With a
353.I device
354argument,
355.B boot
356loads the boot sector of
357.I device
358into memory and jumps to it, starting another operating system. You would
359normally use partitions on the first hard disk for this command (d0p[0\-3]),
360using d0 will also work (choosing the active partition). One can also boot
361devices on the second hard disk (d1, d1p[0\-3]) if the bootstrap writer did
362not hardwire the disk number to disk 0.
363.br
364Some Operating Systems can only be booted from the active partition, if
365you use a '*', e.g.
366.BR "boot *d0p2" ,
367then partition 2 is first made active. You'll then need to use
368.SP
369.RS
370.BI "installboot \-m /dev/c0d0 /usr/mdec/jumpboot" " keys"
371.RE
372.SP
373with
374.I keys
375chosen so that MINIX 3 is booted at startup. (See
376.BR installboot (8).)
377.RE
378.SP
379\fBctty\fP \fIn\fP
380.RS
381Copies output to and takes input from serial line
382.I n
383(0-3) at 9600 baud, 8 bits, no parity.
384This allows you to control a MINIX 3 system remotely through an RS-232
385connection.
386.RE
387.SP
388\fBdelay\fP [\fImsec\fP]
389.RS
390Delay (500 msec default).
391.br
392Fast booting speed was one of the objectives when this program was created,
393so a hard disk boot usually takes only a fraction of a second. If you need
394some time (to hit Escape, or stare at the numbers) you can use
395.B delay
396to make the monitor pause for a specified number of milliseconds.
397.RE
398.SP
399\fBecho\fP \fIword\fP ...
400.RS
401Print these words.
402.br
403Used to display messages, like the startup banner. Echo normally prints
404the words with spaces in between and a newline at the end. Echo understands
405special '\e' escape sequences as follows:
406.RS
407.SP
408\e (At the end) Don't print a newline.
409.br
410\en Print a newline.
411.br
412\ev Print the monitor's version numbers.
413.br
414\ec Clear the screen.
415.br
416\ew Wait until a RETURN is typed
417.br
418\e\e Print a backslash.
419.RE
420.RE
421.SP
422\fBls\fP [\fIdirectory\fP]
423.RS
424List contents of a directory.
425.br
426Useful when looking for kernel images.
427.RE
428.SP
429.B menu
430.RS
431Menu driven startup.
432.br
433This command allows you to execute functions defined with a
434.IR key .
435If no menu functions have been defined then
436.B menu
437will use this one hidden built-in function:
438.SP
439.RS
440*(=,Start Minix) boot
441.SP
442.RE
443Kernel selecting functions only add new options to this set, but if you
444define a two argument function yourself then the above one is no longer
445shown, allowing you to customize the menu completely. Your first
446function definition should therefore be one that starts MINIX 3.
447.SP
448Menu entries are shown in the same order as
449.B set
450shows them. If you don't like the order then you have to unset the
451functions and retype them in the proper order.
452.SP
453If you type a key then a scheduled trap is killed and the appropriate menu
454function is executed. If you need more time to choose then hit the
455spacebar. A key not on the menu also kills a trap, but does nothing more.
456.RE
457.SP
458.B save
459.RS
460Save environment.
461.br
462This will save all the environment variables and functions with nondefault
463values to the parameter sector (the second sector on the boot device), so
464they are automatically set the next time you boot the monitor.
465.RE
466.SP
467.B set
468.RS
469Show environment.
470.br
471Show the current values of the environment variables and functions. Default
472values are shown between parentheses to distinguish them from values that
473were explicitly set.
474.RE
475.SP
476\fBtrap\fP \fImsec\fP \fIfunction\fP
477.RS
478Schedule function.
479.br
480Schedules a function to be executed after
481.I msec
482milliseconds. Only the monitor mode cannot be interrupted, a scheduled trap
483is killed when the prompt is printed. Example:
484.SP
485.RS
486main() {trap 10000 boot; menu}
487.RE
488.SP
489This gives you 10 seconds to choose a menu option before MINIX 3 is booted.
490.RE
491.SP
492\fBunset\fP \fIname\fP ...
493.RS
494Unset environment variables.
495.br
496Removes the named variables and functions from the environment, and sets
497special variables back to their default values. This is also the only way
498to remove the "device name translation" property from a variable.
499.RE
500.SP
501\fBexit\fP
502.RS
503Exit the monitor.
504.br
505Reboot the machine, exit to MINIX 3 or exit to DOS as appropriate.
506.RE
507.SP
508\fBoff\fP
509.RS
510Turn the PC off.
511.br
512If the PC supports power management then turn it off, otherwise
513print some error messages and do nothing.
514.RE
515.SP
516\fB{\fP \fIcommand\fP; ... \fB}\fP
517.RS
518Bundle commands.
519.br
520Treat a number of commands as a single command. Used for function
521definitions when a function body must contain more than one command.
522.RE
523.SH DEVICES
524The MINIX 3 kernel can't do anything with device names, so they have to be
525translated to device numbers before they are passed to the kernel. This
526number is found under the st_rdev field (see
527.BR stat (2))
528of the file on the boot file system. The monitor will look for the device
529file with the working directory set to '/dev'. If it can't find the device
530name then it will translate names like 'ram', 'fd1', 'c0d1p0', 'c1d0p2s0',
531and even the obsolete 'hd2a' to what it itself thinks the numbers should be.
532.PP
533The special name
534.B bootdev
535is translated to the name of the device booted from, like 'fd0',
536or 'c0d0p1s0', and then searched for in /dev.
537.B Bootdev
538can only be translated to a device for the first controller, and only if
539the disks on that controller are numbered without "gaps". (The master
540device on the second IDE channel is always d2 on MINIX 3. The BIOS will
541call it disk 0, 1, or 2 depending on the number of disks on the first
542IDE channel.)
543.SP
544Controller numbers are meaningless to the BIOS, so everything is assumed to
545be attached to controller 0. You can omit
546.B c0
547for device names, and it is best to always omit
548.B c0
549for the
550.B boot
551command, and to always use the full name for variables passed to MINIX 3.
552.SH EXTENSIONS
553A few extensions have been made to this program for kernel hackers. They
554may be triggered by setting bits in the flags word in the kernel startup
555code (the mpx file.) The flag bits are:
556.TP 10
5570x0001
558Call kernel in 386 mode.
559.TP
5600x0002
561Do not make space for the bss areas of processes other than the kernel.
562.TP
5630x0004
564Use the stack size set by
565.BR chmem (1).
566.TP
5670x0008
568Load MM, FS, etc. into extended memory.
569.TP
5700x0010
571No need to patch process sizes into the kernel.
572.TP
5730x0020
574The kernel can return to the monitor on halt or reboot.
575.TP
5760x0040
577Offer generic BIOS support instead of just INT 13 (disk I/O).
578.TP
5790x0080
580Pass memory lists for free and used memory (processes).
581.TP
5820x0100
583Kernel returns monitor code on shutdown in boot parameters array.
584.SH "SEE ALSO"
585.BR controller (4),
586.BR installboot (8),
587.BR usage (8),
588.BR boot (8),
589.BR dosminix (8).
590.SH BUGS
591The
592.B delay
593command will hang forever on the original IBM PC (not the XT!). Not that it
594matters, as everything takes forever on that box.
595.PP
596By redefining
597.B leader
598one can easily hide the identity of this program.
599.SH ACKNOWLEDGMENTS
600Earl Chew, for the inspiration his ShoeLace package provided, unless he wants
601to file a "look and feel" suit against me, then I will say I modeled it after
602the Sun ROM boot monitor, which is also true.
603.SH AUTHOR
604Kees J. Bot (kjb@cs.vu.nl)
605.\"
606.\" $PchId: monitor.8,v 1.11 2002/02/27 19:36:34 philip Exp $
Note: See TracBrowser for help on using the repository browser.