📄 monitor.8
字号:
will then execute the.B ATfunction above..RE.SP\fIname\fP(\fIkey\fP,\fItext\fP) \fIcommand\fP.RSUser defined menu option..brThis variant may be used to make any menu entry you like:.SP.RSdos(d,Boot MS-DOS) boot d0p0.RE.SP.I Textmay be anything, even parentheses if they match..RE.SP.I name.RSCall function..brIf.I nameis a user defined function then its value is expanded and executed in place of.IR name .Try a recursive one like 'rec() {rec;xx}' one day. You can see the monitorrun out of space with nice messages about using.BR chmem (1)to increase it's heap..RE.SP\fBboot\fP [\fB\-\fP\fIopts\fP].br\fBboot\fP \fIdevice\fP.RSBoot MINIX 3 or another O.S..brWithout an argument,.B bootwill load and execute the MINIX 3 image named by the.B imagevariable. With options the variable.B bootoptsis first set to.BI \- optsbefore MINIX 3 is started, and unset when Minix returns. With a.I deviceargument,.B bootloads the boot sector of.I deviceinto memory and jumps to it, starting another operating system. You wouldnormally use partitions on the first hard disk for this command (d0p[0\-3]),using d0 will also work (choosing the active partition). One can also bootdevices on the second hard disk (d1, d1p[0\-3]) if the bootstrap writer didnot hardwire the disk number to disk 0..brSome Operating Systems can only be booted from the active partition, ifyou use a '*', e.g..BR "boot *d0p2" ,then partition 2 is first made active. You'll then need to use.SP.RS.BI "installboot \-m /dev/c0d0 /usr/mdec/jumpboot" " keys".RE.SPwith.I keyschosen so that MINIX 3 is booted at startup. (See.BR installboot (8).).RE.SP\fBctty\fP \fIn\fP.RSCopies output to and takes input from serial line.I n(0-3) at 9600 baud, 8 bits, no parity.This allows you to control a MINIX 3 system remotely through an RS-232connection..RE.SP\fBdelay\fP [\fImsec\fP].RSDelay (500 msec default)..brFast booting speed was one of the objectives when this program was created,so a hard disk boot usually takes only a fraction of a second. If you needsome time (to hit Escape, or stare at the numbers) you can use.B delayto make the monitor pause for a specified number of milliseconds..RE.SP\fBecho\fP \fIword\fP ....RSPrint these words..brUsed to display messages, like the startup banner. Echo normally printsthe words with spaces in between and a newline at the end. Echo understandsspecial '\e' escape sequences as follows:.RS.SP\e (At the end) Don't print a newline..br\en Print a newline..br\ev Print the monitor's version numbers..br\ec Clear the screen..br\ew Wait until a RETURN is typed.br\e\e Print a backslash..RE.RE.SP\fBls\fP [\fIdirectory\fP].RSList contents of a directory..brUseful when looking for kernel images..RE.SP.B menu.RSMenu driven startup..brThis command allows you to execute functions defined with a.IR key .If no menu functions have been defined then.B menuwill use this one hidden built-in function:.SP.RS*(=,Start Minix) boot.SP.REKernel selecting functions only add new options to this set, but if youdefine a two argument function yourself then the above one is no longershown, allowing you to customize the menu completely. Your firstfunction definition should therefore be one that starts MINIX 3..SPMenu entries are shown in the same order as.B setshows them. If you don't like the order then you have to unset thefunctions and retype them in the proper order..SPIf you type a key then a scheduled trap is killed and the appropriate menufunction is executed. If you need more time to choose then hit thespacebar. A key not on the menu also kills a trap, but does nothing more..RE.SP.B save.RSSave environment..brThis will save all the environment variables and functions with nondefaultvalues to the parameter sector (the second sector on the boot device), sothey are automatically set the next time you boot the monitor..RE.SP.B set.RSShow environment..brShow the current values of the environment variables and functions. Defaultvalues are shown between parentheses to distinguish them from values thatwere explicitly set..RE.SP\fBtrap\fP \fImsec\fP \fIfunction\fP.RSSchedule function..brSchedules a function to be executed after.I msecmilliseconds. Only the monitor mode cannot be interrupted, a scheduled trapis killed when the prompt is printed. Example:.SP.RSmain() {trap 10000 boot; menu}.RE.SPThis gives you 10 seconds to choose a menu option before MINIX 3 is booted..RE.SP\fBunset\fP \fIname\fP ....RSUnset environment variables..brRemoves the named variables and functions from the environment, and setsspecial variables back to their default values. This is also the only wayto remove the "device name translation" property from a variable..RE.SP\fBexit\fP.RSExit the monitor..brReboot the machine, exit to MINIX 3 or exit to DOS as appropriate..RE.SP\fBoff\fP.RSTurn the PC off..brIf the PC supports power management then turn it off, otherwiseprint some error messages and do nothing..RE.SP\fB{\fP \fIcommand\fP; ... \fB}\fP.RSBundle commands..brTreat a number of commands as a single command. Used for functiondefinitions when a function body must contain more than one command..RE.SH DEVICESThe MINIX 3 kernel can't do anything with device names, so they have to betranslated to device numbers before they are passed to the kernel. Thisnumber is found under the st_rdev field (see.BR stat (2))of the file on the boot file system. The monitor will look for the devicefile with the working directory set to '/dev'. If it can't find the devicename then it will translate names like 'ram', 'fd1', 'c0d1p0', 'c1d0p2s0',and even the obsolete 'hd2a' to what it itself thinks the numbers should be..PPThe special name.B bootdevis translated to the name of the device booted from, like 'fd0',or 'c0d0p1s0', and then searched for in /dev..B Bootdevcan only be translated to a device for the first controller, and only ifthe disks on that controller are numbered without "gaps". (The masterdevice on the second IDE channel is always d2 on MINIX 3. The BIOS willcall it disk 0, 1, or 2 depending on the number of disks on the firstIDE channel.).SPController numbers are meaningless to the BIOS, so everything is assumed tobe attached to controller 0. You can omit.B c0for device names, and it is best to always omit.B c0for the.B bootcommand, and to always use the full name for variables passed to MINIX 3..SH EXTENSIONSA few extensions have been made to this program for kernel hackers. Theymay be triggered by setting bits in the flags word in the kernel startupcode (the mpx file.) The flag bits are:.TP 100x0001Call kernel in 386 mode..TP0x0002Do not make space for the bss areas of processes other than the kernel..TP0x0004Use the stack size set by.BR chmem (1)..TP0x0008Load MM, FS, etc. into extended memory..TP0x0010No need to patch process sizes into the kernel..TP0x0020The kernel can return to the monitor on halt or reboot..TP0x0040Offer generic BIOS support instead of just INT 13 (disk I/O)..TP0x0080Pass memory lists for free and used memory (processes)..TP0x0100Kernel returns monitor code on shutdown in boot parameters array..SH "SEE ALSO".BR controller (4),.BR installboot (8),.BR usage (8),.BR boot (8),.BR dosminix (8)..SH BUGSThe.B delaycommand will hang forever on the original IBM PC (not the XT!). Not that itmatters, as everything takes forever on that box..PPBy redefining.B leaderone can easily hide the identity of this program..SH ACKNOWLEDGMENTSEarl Chew, for the inspiration his ShoeLace package provided, unless he wantsto file a "look and feel" suit against me, then I will say I modeled it afterthe Sun ROM boot monitor, which is also true..SH AUTHORKees J. Bot (kjb@cs.vu.nl).\".\" $PchId: monitor.8,v 1.11 2002/02/27 19:36:34 philip Exp $
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -