installboot.8

来自「minix操作系统最新版本(3.1.1)的源代码」· 8 代码 · 共 396 行

8
396
字号
.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).I device masterboot.RI [ keys " [" logical ]].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 3 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/c0d0p0, /dev/c0d0p1, /dev/c0d0p2, or/dev/c0d0p3 (assuming the boot disk is attached to controller 0.)The bootstrap will locate the operating system on the device it itself wasloaded from, load it, and execute it..PPTo make a MINIX 3 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 3 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 3 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 3..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).I device masterboot.RI [ keys " [" logical ]].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 3 has two bootstraps that can be used as a masterbootstrap,.B masterbootand.BR jumpboot..SP.B Masterbootis a fairly normal master bootstrap that works as follows:.RS.SPIf installed on a hard disk then it will load the bootstrap of the activepartition and run it..B Masterbootcan be put in the first sector of a hard disk to boot the active partition,or in the first sector of a MINIX 3 partition to boot the active subpartition..SPIf installed on a MINIX 3 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..RE.SPThe other bootstrap named.B jumpbootis used for the weird cases:.SP.RSIf your default operating system is installed on another disk then.B jumpbootcan be installed on the first disk and instructed to boot the disk,partition or subpartition that must be booted by default..SPIf one of your operating systems insists on being active when booted then use.B jumpbootto ignore the active flag and boot your preferred O.S. instead.  The BootMonitor's "\fBboot\ \(**\fP" trick to activate the partition to boot isuseful here..SPTo boot a logical partition within an extended partition.  Note that you canput.B jumpbootin the first sector of the extended partition in this case, with theextended partition marked active..SPIf you hold down the ALT key while.B jumpbootis being executed, then you can type the disk, partition or subpartitionyou want to boot as one to three digits followed by typing ENTER..RE.SP.B Jumpbootcan be programmed to boot a certain partition with the.I keysargument and optionally also the.I logicalargument..I Keysare one to three digits naming the disk, partition or subpartition.  If thedevice to boot is.BR /dev/c0d1p3s0 ,then.I keysis.BR 130 .These are the same three digits you can type manually if you hold down ALTat boot.  To program.B jumpbootto boot a logical partition within an extended partition, let.I keysbe just a disk number, and specify.I logicalas the name of the logical partition on that disk that is to be booted.(Actually.I logicalcan be any device name, but this form should be avoided because it offersless checking to see if the device is still there after a diskrearrangement.).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 'cp \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 3 bootstrap for the Minix root device.  To be placed in the boot sector..TP.B /usr/mdec/bootMINIX 3 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 3 primary partition it selects the activesubpartition..TP.B /usr/mdec/jumpbootSpecial "boot this" bootstrap..SH "SEE ALSO".BR part (8),.BR monitor (8)..SH DIAGNOSTICS.I Fileis not an executable.RSWhat you think is boot code or part of the kernel isn't..RE.SP.I Programwill crash, text/data segment larger then 64K.RSOne of the 16-bit programs added to an image has a text or data segmentthat is larger than 64K.  You probably enabled too many drivers, orconfigured too many buffers..RE.SP.I Filecan't be attached to.I device.RSYou are trying to put the boot monitor or an image after a file system, butthere is no or not enough space.  Did you specify the full path of themonitor instead of just "boot"?.RE.SP.I Deviceis not a MINIX 3 file system.RSYou are using.B \-deviceon a device that doesn't contain a file system.  Maybe you specified thewrong device, maybe you should make a file system, or maybe you should use.BR \-boot ..RE.SP.I Devicecontains a file system.RSYou are about to destroy a file system with.BR \-boot .Maybe you meant to use.BR \-device ?You have 10 seconds to make up your mind....RE.SP.I Fileis too big.RSSeveral types of messages like these will tell you that.I filecan't be installed in a boot sector, or that there is no room to add someparameters, etc.  Is.I filereally a bootstrap?.RE.SS "Bootstrap errors"Read error.RSA read error trying to get the next bit of boot code.  You may even get theBIOS error code in hex.  Either the device has a bad block, or jumpboot istold to read a nonexistent disk..RE.SPNo active partition.RSNone of the partitions in a partition table is marked active..RE.SPNot bootable.RSPartition does not exist (jumpboot), or it's bootstrap isn't executable..RE.SH NOTESThe MINIX 3 bootstraps can boot beyond the 8G disk size limit if the BIOSsupports the IBM/MS INT 13 Extensions.  Alas only Minix-vmd can make use ofthis, standard MINIX 3 has a 4G disk size limit..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).\".\" $PchId: installboot.8,v 1.7 2000/08/13 22:09:31 philip Exp $

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?