📄 installb.8
字号:
.TH INSTALLBOOT 8.SH NAMEinstallboot \- make a device bootable.SH SYNOPSIS.B installboot \-i(mage).I image.RI [ label :] kernel.IR "mm fs" " ... " init.br.B installboot \-(e)x(tract).I image.br.B installboot \-d(evice).I device bootblock boot.RI [[ label :] image\&...].br.B installboot \-b(oot).I device bootblock boot.RI [ label :] image\&....br.B installboot \-m(aster).RI [ fix ].I device masterboot.SH DESCRIPTION.de SP.if t .sp 0.4.if n .sp...B Installbootmay be used to make a device bootable by constructing a kernel image andinstalling bootstrap code into the boot block of a Minix file system. Tounderstand how this can be done one first has to know what happens when aPC is booted..PPWhen the power is turned on the typical PC will try to read the first sectorfrom the first floppy disk or from the first hard disk into memory and executeit. The code obtained from the hard disk (from the so-called master bootsector) will immediately replace itself by the code found in the first sectorof the active partition. Thus the PC is now executing the bootstrap code foundin the first sector of /dev/fd0, /dev/hd1, /dev/hd2, /dev/hd3, or /dev/hd4.The bootstrap will locate the operating system on the device it itself wasloaded from, load it, and execute it..PPTo make a Minix file system.B /dev/fd0mounted on.B /mntbootable, enter the following:.SP.RS.ft Bcp /usr/mdec/boot /mnt/boot.SPinstallboot \-i /mnt/minix kernel mm fs init.SPinstallboot \-d /dev/fd0 /usr/mdec/bootblock boot.ft P.RE.PPThe "boot" program in the example is named the "boot monitor". It is loadedby the bootblock code placed in the boot sector of /dev/fd0 and it will takecare of loading the kernel image "minix" from the root directory of thefile system. See.BR monitor (8)for a description of the boot monitor. Note that.B bootis a name in the file system on.B /dev/fd0in this example, the same file as.BR /mnt/boot .Making.B /mnt/minixis normally not necessary, there is usually a kernel image in the.B toolsdirectory..SH OPTIONS.B \-i(mage).I image.RI [ label :] kernel.IR "mm fs" " ... " init.RSThe.B \-imageoption (or the.B \-ishorthand) combines the executable files needed to run Minix in one file.Only the names and a few zero bytes are inserted into the image. The nameis for identification and the zeros are used to pad separate pieces tosector boundaries for fast loading..SPAn executable may be prefixed by a label. The monitor may be instructed toload processes by label. So more than one kernel process may be included inthe image, each with a different winchester driver for instance. So if youhave compiled two different kernels with an AT or XT driver then.SP.RS.BI "installboot \-i" " image AT:at_kernel XT:xt_kernel mm fs init".RE.SPwill make an image with two different labeled kernels and oneunlabeled set of the other binaries..RE.PP.B \-(e)x(tract).I image.RSExtract the binaries from.I imageunder the names stored in the image. (The name includes the optional label.).RE.PP.B \-d(evice).I device bootblock boot.RI [[ label :] image\&...].RSInstalls.I bootblockin the boot sector of.I devicetogether with the disk addresses to.IR boot .These disk addresses are needed to load.I bootfrom the file system at boot time. The argument.I bootis first searched in the file system on.IR device .If it is not found then it is read as a normal file and added at the end ofthe file system. The file system should be smaller than the device it is onto allow this. Any extra images are also added to the end as describedunder.BR \-boot .(Make sure you understand all this.).SPThe device need not be mounted when.B installbootis run, nor does it matter if it is..SP.B Installbootneeds to be run again if.I bootis rewritten, because it will then occupy a new place on the disk..SPOld boot parameters are kept if there are no images added..RE.PP.B \-b(oot).I device bootblock boot.RI [ label :] image\&....RSThis option fills a blank floppy in.I devicewith boot code and kernel images. This "boot disk" does not have a rootfile system, only the boot monitor and Minix kernels. The boot parameterssector is filled with code that enables menu options for selecting animage. After loading an image, the monitor will ask you to insert a rootfile system diskette before starting Minix..SPThe labels used on the images should match those on the executables usedinside the image. You can put a comma separated list of labels on an imagefor each label used within the image. For the image created earlier onewould create a boot floppy like this:.SP.RS.nf.BI "installboot \-b /dev/fd0 bootblock boot" " AT,XT:image".fi.RE.SPIf a label-list is omitted on an image, then that image will be selected bydefault. (Like in the normal one image, no labels case.).SPNote that.B \-deviceand.B \-boottogether allow you to make a boot floppy with or without a root file system.With the boot code in the file system, attached to the end of it, or afterthe boot block. And with one or more kernel images in the file system orat the end of the device. Somewhat confusing..RE.PP.B \-m(aster).RI [ fix ].I device masterboot.RSThis option installs the.I masterbootprogram into the boot sector of the given device. If another device isgiven instead of.I masterbootthen its bootstrap code is copied to.IR device .The master bootstrap on a hard disk boots the active partition on that diskat boot time. The MS-DOS fdisk command normally puts a master bootstrap onthe hard disk. Minix has two bootstraps that can be used as a masterbootstrap. A fairly normal one named.B masterbootthat works as follows:.RS.SPIf the ALT key is held down while booting then '/dev/hd?' appears and youare expected to type a number key (0 \- 9) to select the device to boot..SPIf.I fix(a small number) is given then the bootstrap is locked into booting the.BI /dev/hd fixdisk or primary partition. This is needed if 'boot *hd\fIN\fP' is used fromthe monitor to boot an O.S. that needs the active flag set..SPIf installed on a Minix floppy then it will try to boot the next floppy orthe first hard disk. Ideal for floppies with just data on it, they will nolonger obstruct the boot process if left in the drive. Also a very usefultrick to boot from floppy drive 1..SPIf installed on a hard disk then the active partition is selected and bootedas usual, unless none of the partitions is marked active, then it will bootthe next disk. The latter is useful if you want to boot an operatingsystem from the second disk by default..RE.SPThe second bootstrap is named.BR extboot .It has only one function, to boot the logical partition named by.IR fix ..I Fixis not optional for.B extbootand must be a number-letter pair, like.B 2cfor.BR /dev/hd2c ..SP.B Extbootor.B masterbootwith a fix key need not be installed in the hard disk master bootstrap perse if you don't want to mess with the DOS master bootstrap, or if you wantkeep the active flag functioning. An extended partition or a non-root Minixpartition are better candidates. It seems logical to put.B extbootin the extended partition boot block..SPA backup copy of the current master bootstrap (including the partitiontable) can be made with:.RS.SPdd if=\fIdevice\fP of=\fIbackup-file\fP count=1.SP.REA simple 'cat \fIbackup-file\fP > \fIdevice\fP' will put it back. You canalso use.B fdisk /mbrunder MS-DOS 5.0 (or newer) to restore the master bootstrap..RE.RE.SH FILES.TP 25.B /usr/mdec/bootblockMinix bootstrap for the Minix root device. To be placed in the boot sector..TP.B /usr/mdec/bootMinix Boot Monitor. Can usually be found in the root directory of a bootabledevice..TP.B /usr/mdec/masterbootMaster bootstrap. Can be placed in the first sector of a disk to select theactive partition. In a Minix primary partition it selects the activesubpartition..TP.B /usr/mdec/extbootExtended partition bootstrap..SH "SEE ALSO".BR part (8),.BR monitor (8)..SH DIAGNOSTICS.I Bootdoesn't fit on.I device.RSIf there is no space on the device to add the boot code. This usuallymeans that there is no boot code in the file system you use.B installboot \-deviceon..RE.PP.I Imagedoesn't fit on.I device.RSIf the device is too small for all the images you try to put on it..SH BUGSIt has four more options than the SunOS installboot program it is modeledafter..PPThe bootblock code has been crunched to such ugliness that you can use itto scare little kids out of your garden..SH AUTHORKees J. Bot (kjb@cs.vu.nl)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -