[9] | 1 | .TH INSTALLBOOT 8
|
---|
| 2 | .SH NAME
|
---|
| 3 | installboot \- make a device bootable
|
---|
| 4 | .SH SYNOPSIS
|
---|
| 5 | .B installboot \-i(mage)
|
---|
| 6 | .I image
|
---|
| 7 | .RI [ label :] kernel
|
---|
| 8 | .IR "mm fs" " ... " init
|
---|
| 9 | .br
|
---|
| 10 | .B installboot \-(e)x(tract)
|
---|
| 11 | .I image
|
---|
| 12 | .br
|
---|
| 13 | .B installboot \-d(evice)
|
---|
| 14 | .I device bootblock boot
|
---|
| 15 | .RI [[ label :] image
|
---|
| 16 | \&...]
|
---|
| 17 | .br
|
---|
| 18 | .B installboot \-b(oot)
|
---|
| 19 | .I device bootblock boot
|
---|
| 20 | .RI [ label :] image
|
---|
| 21 | \&...
|
---|
| 22 | .br
|
---|
| 23 | .B installboot \-m(aster)
|
---|
| 24 | .I device masterboot
|
---|
| 25 | .RI [ keys " [" logical ]]
|
---|
| 26 | .SH DESCRIPTION
|
---|
| 27 | .de SP
|
---|
| 28 | .if t .sp 0.4
|
---|
| 29 | .if n .sp
|
---|
| 30 | ..
|
---|
| 31 | .B Installboot
|
---|
| 32 | may be used to make a device bootable by constructing a kernel image and
|
---|
| 33 | installing bootstrap code into the boot block of a MINIX 3 file system. To
|
---|
| 34 | understand how this can be done one first has to know what happens when a
|
---|
| 35 | PC is booted.
|
---|
| 36 | .PP
|
---|
| 37 | When the power is turned on the typical PC will try to read the first sector
|
---|
| 38 | from the first floppy disk or from the first hard disk into memory and execute
|
---|
| 39 | it. The code obtained from the hard disk (from the so-called master boot
|
---|
| 40 | sector) will immediately replace itself by the code found in the first sector
|
---|
| 41 | of the active partition. Thus the PC is now executing the bootstrap code found
|
---|
| 42 | in the first sector of /dev/fd0, /dev/c0d0p0, /dev/c0d0p1, /dev/c0d0p2, or
|
---|
| 43 | /dev/c0d0p3 (assuming the boot disk is attached to controller 0.)
|
---|
| 44 | The bootstrap will locate the operating system on the device it itself was
|
---|
| 45 | loaded from, load it, and execute it.
|
---|
| 46 | .PP
|
---|
| 47 | To make a MINIX 3 file system
|
---|
| 48 | .B /dev/fd0
|
---|
| 49 | mounted on
|
---|
| 50 | .B /mnt
|
---|
| 51 | bootable, enter the following:
|
---|
| 52 | .SP
|
---|
| 53 | .RS
|
---|
| 54 | .ft B
|
---|
| 55 | cp /usr/mdec/boot /mnt/boot
|
---|
| 56 | .SP
|
---|
| 57 | installboot \-i /mnt/minix kernel mm fs init
|
---|
| 58 | .SP
|
---|
| 59 | installboot \-d /dev/fd0 /usr/mdec/bootblock boot
|
---|
| 60 | .ft P
|
---|
| 61 | .RE
|
---|
| 62 | .PP
|
---|
| 63 | The "boot" program in the example is named the "Boot Monitor". It is loaded
|
---|
| 64 | by the bootblock code placed in the boot sector of /dev/fd0 and it will take
|
---|
| 65 | care of loading the kernel image "minix" from the root directory of the
|
---|
| 66 | file system. See
|
---|
| 67 | .BR monitor (8)
|
---|
| 68 | for a description of the Boot Monitor. Note that
|
---|
| 69 | .B boot
|
---|
| 70 | is a name in the file system on
|
---|
| 71 | .B /dev/fd0
|
---|
| 72 | in this example, the same file as
|
---|
| 73 | .BR /mnt/boot .
|
---|
| 74 | Making
|
---|
| 75 | .B /mnt/minix
|
---|
| 76 | is normally not necessary, there is usually a kernel image in the
|
---|
| 77 | .B tools
|
---|
| 78 | directory.
|
---|
| 79 | .SH OPTIONS
|
---|
| 80 | .B \-i(mage)
|
---|
| 81 | .I image
|
---|
| 82 | .RI [ label :] kernel
|
---|
| 83 | .IR "mm fs" " ... " init
|
---|
| 84 | .RS
|
---|
| 85 | The
|
---|
| 86 | .B \-image
|
---|
| 87 | option (or the
|
---|
| 88 | .B \-i
|
---|
| 89 | shorthand) combines the executable files needed to run MINIX 3 in one file.
|
---|
| 90 | Only the names and a few zero bytes are inserted into the image. The name
|
---|
| 91 | is for identification and the zeros are used to pad separate pieces to
|
---|
| 92 | sector boundaries for fast loading.
|
---|
| 93 | .SP
|
---|
| 94 | An executable may be prefixed by a label. The Monitor may be instructed to
|
---|
| 95 | load processes by label. So more than one kernel process may be included in
|
---|
| 96 | the image, each with a different winchester driver for instance. So if you
|
---|
| 97 | have compiled two different kernels with an AT or XT driver then
|
---|
| 98 | .SP
|
---|
| 99 | .RS
|
---|
| 100 | .BI "installboot \-i" " image AT:at_kernel XT:xt_kernel mm fs init"
|
---|
| 101 | .RE
|
---|
| 102 | .SP
|
---|
| 103 | will make an image with two different labeled kernels and one
|
---|
| 104 | unlabeled set of the other binaries.
|
---|
| 105 | .RE
|
---|
| 106 | .PP
|
---|
| 107 | .B \-(e)x(tract)
|
---|
| 108 | .I image
|
---|
| 109 | .RS
|
---|
| 110 | Extract the binaries from
|
---|
| 111 | .I image
|
---|
| 112 | under the names stored in the image. (The name includes the optional label.)
|
---|
| 113 | .RE
|
---|
| 114 | .PP
|
---|
| 115 | .B \-d(evice)
|
---|
| 116 | .I device bootblock boot
|
---|
| 117 | .RI [[ label :] image
|
---|
| 118 | \&...]
|
---|
| 119 | .RS
|
---|
| 120 | Installs
|
---|
| 121 | .I bootblock
|
---|
| 122 | in the boot sector of
|
---|
| 123 | .I device
|
---|
| 124 | together with the disk addresses to
|
---|
| 125 | .IR boot .
|
---|
| 126 | These disk addresses are needed to load
|
---|
| 127 | .I boot
|
---|
| 128 | from the file system at boot time. The argument
|
---|
| 129 | .I boot
|
---|
| 130 | is first searched in the file system on
|
---|
| 131 | .IR device .
|
---|
| 132 | If it is not found then it is read as a normal file and added at the end of
|
---|
| 133 | the file system. The file system should be smaller than the device it is on
|
---|
| 134 | to allow this. Any extra images are also added to the end as described
|
---|
| 135 | under
|
---|
| 136 | .BR \-boot .
|
---|
| 137 | (Make sure you understand all this.)
|
---|
| 138 | .SP
|
---|
| 139 | The device need not be mounted when
|
---|
| 140 | .B installboot
|
---|
| 141 | is run, nor does it matter if it is.
|
---|
| 142 | .SP
|
---|
| 143 | .B Installboot
|
---|
| 144 | needs to be run again if
|
---|
| 145 | .I boot
|
---|
| 146 | is rewritten, because it will then occupy a new place on the disk.
|
---|
| 147 | .SP
|
---|
| 148 | Old boot parameters are kept if there are no images added.
|
---|
| 149 | .RE
|
---|
| 150 | .PP
|
---|
| 151 | .B \-b(oot)
|
---|
| 152 | .I device bootblock boot
|
---|
| 153 | .RI [ label :] image
|
---|
| 154 | \&...
|
---|
| 155 | .RS
|
---|
| 156 | This option fills a blank floppy in
|
---|
| 157 | .I device
|
---|
| 158 | with boot code and kernel images. This "boot disk" does not have a root
|
---|
| 159 | file system, only the Boot Monitor and MINIX 3 kernels. The boot parameters
|
---|
| 160 | sector is filled with code that enables menu options for selecting an
|
---|
| 161 | image. After loading an image, the Monitor will ask you to insert a root
|
---|
| 162 | file system diskette before starting MINIX 3.
|
---|
| 163 | .SP
|
---|
| 164 | The labels used on the images should match those on the executables used
|
---|
| 165 | inside the image. You can put a comma separated list of labels on an image
|
---|
| 166 | for each label used within the image. For the image created earlier one
|
---|
| 167 | would create a boot floppy like this:
|
---|
| 168 | .SP
|
---|
| 169 | .RS
|
---|
| 170 | .nf
|
---|
| 171 | .BI "installboot \-b /dev/fd0 bootblock boot" " AT,XT:image"
|
---|
| 172 | .fi
|
---|
| 173 | .RE
|
---|
| 174 | .SP
|
---|
| 175 | If a label-list is omitted on an image, then that image will be selected by
|
---|
| 176 | default. (Like in the normal one image, no labels case.)
|
---|
| 177 | .SP
|
---|
| 178 | Note that
|
---|
| 179 | .B \-device
|
---|
| 180 | and
|
---|
| 181 | .B \-boot
|
---|
| 182 | together allow you to make a boot floppy with or without a root file system.
|
---|
| 183 | With the boot code in the file system, attached to the end of it, or after
|
---|
| 184 | the boot block. And with one or more kernel images in the file system or
|
---|
| 185 | at the end of the device. Somewhat confusing.
|
---|
| 186 | .RE
|
---|
| 187 | .PP
|
---|
| 188 | .B \-m(aster)
|
---|
| 189 | .I device masterboot
|
---|
| 190 | .RI [ keys " [" logical ]]
|
---|
| 191 | .RS
|
---|
| 192 | This option installs the
|
---|
| 193 | .I masterboot
|
---|
| 194 | program into the boot sector of the given device. If another device is
|
---|
| 195 | given instead of
|
---|
| 196 | .I masterboot
|
---|
| 197 | then its bootstrap code is copied to
|
---|
| 198 | .IR device .
|
---|
| 199 | The master bootstrap on a hard disk boots the active partition on that disk
|
---|
| 200 | at boot time. The MS-DOS fdisk command normally puts a master bootstrap on
|
---|
| 201 | the hard disk. MINIX 3 has two bootstraps that can be used as a master
|
---|
| 202 | bootstrap,
|
---|
| 203 | .B masterboot
|
---|
| 204 | and
|
---|
| 205 | .BR jumpboot.
|
---|
| 206 | .SP
|
---|
| 207 | .B Masterboot
|
---|
| 208 | is a fairly normal master bootstrap that works as follows:
|
---|
| 209 | .RS
|
---|
| 210 | .SP
|
---|
| 211 | If installed on a hard disk then it will load the bootstrap of the active
|
---|
| 212 | partition and run it.
|
---|
| 213 | .B Masterboot
|
---|
| 214 | can be put in the first sector of a hard disk to boot the active partition,
|
---|
| 215 | or in the first sector of a MINIX 3 partition to boot the active subpartition.
|
---|
| 216 | .SP
|
---|
| 217 | If installed on a MINIX 3 floppy then it will try to boot the next floppy or
|
---|
| 218 | the first hard disk. Ideal for floppies with just data on it, they will no
|
---|
| 219 | longer obstruct the boot process if left in the drive. Also a very useful
|
---|
| 220 | trick to boot from floppy drive 1.
|
---|
| 221 | .RE
|
---|
| 222 | .SP
|
---|
| 223 | The other bootstrap named
|
---|
| 224 | .B jumpboot
|
---|
| 225 | is used for the weird cases:
|
---|
| 226 | .SP
|
---|
| 227 | .RS
|
---|
| 228 | If your default operating system is installed on another disk then
|
---|
| 229 | .B jumpboot
|
---|
| 230 | can be installed on the first disk and instructed to boot the disk,
|
---|
| 231 | partition or subpartition that must be booted by default.
|
---|
| 232 | .SP
|
---|
| 233 | If one of your operating systems insists on being active when booted then use
|
---|
| 234 | .B jumpboot
|
---|
| 235 | to ignore the active flag and boot your preferred O.S. instead. The Boot
|
---|
| 236 | Monitor's "\fBboot\ \(**\fP" trick to activate the partition to boot is
|
---|
| 237 | useful here.
|
---|
| 238 | .SP
|
---|
| 239 | To boot a logical partition within an extended partition. Note that you can
|
---|
| 240 | put
|
---|
| 241 | .B jumpboot
|
---|
| 242 | in the first sector of the extended partition in this case, with the
|
---|
| 243 | extended partition marked active.
|
---|
| 244 | .SP
|
---|
| 245 | If you hold down the ALT key while
|
---|
| 246 | .B jumpboot
|
---|
| 247 | is being executed, then you can type the disk, partition or subpartition
|
---|
| 248 | you want to boot as one to three digits followed by typing ENTER.
|
---|
| 249 | .RE
|
---|
| 250 | .SP
|
---|
| 251 | .B Jumpboot
|
---|
| 252 | can be programmed to boot a certain partition with the
|
---|
| 253 | .I keys
|
---|
| 254 | argument and optionally also the
|
---|
| 255 | .I logical
|
---|
| 256 | argument.
|
---|
| 257 | .I Keys
|
---|
| 258 | are one to three digits naming the disk, partition or subpartition. If the
|
---|
| 259 | device to boot is
|
---|
| 260 | .BR /dev/c0d1p3s0 ,
|
---|
| 261 | then
|
---|
| 262 | .I keys
|
---|
| 263 | is
|
---|
| 264 | .BR 130 .
|
---|
| 265 | These are the same three digits you can type manually if you hold down ALT
|
---|
| 266 | at boot. To program
|
---|
| 267 | .B jumpboot
|
---|
| 268 | to boot a logical partition within an extended partition, let
|
---|
| 269 | .I keys
|
---|
| 270 | be just a disk number, and specify
|
---|
| 271 | .I logical
|
---|
| 272 | as the name of the logical partition on that disk that is to be booted.
|
---|
| 273 | (Actually
|
---|
| 274 | .I logical
|
---|
| 275 | can be any device name, but this form should be avoided because it offers
|
---|
| 276 | less checking to see if the device is still there after a disk
|
---|
| 277 | rearrangement.)
|
---|
| 278 | .SP
|
---|
| 279 | A backup copy of the current master bootstrap (including the partition
|
---|
| 280 | table) can be made with:
|
---|
| 281 | .RS
|
---|
| 282 | .SP
|
---|
| 283 | dd if=\fIdevice\fP of=\fIbackup-file\fP count=1
|
---|
| 284 | .SP
|
---|
| 285 | .RE
|
---|
| 286 | A simple 'cp \fIbackup-file\fP \fIdevice\fP' will put it back. You can
|
---|
| 287 | also use
|
---|
| 288 | .B fdisk /mbr
|
---|
| 289 | under MS-DOS 5.0 (or newer) to restore the master bootstrap.
|
---|
| 290 | .RE
|
---|
| 291 | .RE
|
---|
| 292 | .SH FILES
|
---|
| 293 | .TP 25
|
---|
| 294 | .B /usr/mdec/bootblock
|
---|
| 295 | MINIX 3 bootstrap for the Minix root device. To be placed in the boot sector.
|
---|
| 296 | .TP
|
---|
| 297 | .B /usr/mdec/boot
|
---|
| 298 | MINIX 3 Boot Monitor. Can usually be found in the root directory of a bootable
|
---|
| 299 | device.
|
---|
| 300 | .TP
|
---|
| 301 | .B /usr/mdec/masterboot
|
---|
| 302 | Master bootstrap. Can be placed in the first sector of a disk to select the
|
---|
| 303 | active partition. In a MINIX 3 primary partition it selects the active
|
---|
| 304 | subpartition.
|
---|
| 305 | .TP
|
---|
| 306 | .B /usr/mdec/jumpboot
|
---|
| 307 | Special "boot this" bootstrap.
|
---|
| 308 | .SH "SEE ALSO"
|
---|
| 309 | .BR part (8),
|
---|
| 310 | .BR monitor (8).
|
---|
| 311 | .SH DIAGNOSTICS
|
---|
| 312 | .I File
|
---|
| 313 | is not an executable
|
---|
| 314 | .RS
|
---|
| 315 | What you think is boot code or part of the kernel isn't.
|
---|
| 316 | .RE
|
---|
| 317 | .SP
|
---|
| 318 | .I Program
|
---|
| 319 | will crash, text/data segment larger then 64K
|
---|
| 320 | .RS
|
---|
| 321 | One of the 16-bit programs added to an image has a text or data segment
|
---|
| 322 | that is larger than 64K. You probably enabled too many drivers, or
|
---|
| 323 | configured too many buffers.
|
---|
| 324 | .RE
|
---|
| 325 | .SP
|
---|
| 326 | .I File
|
---|
| 327 | can't be attached to
|
---|
| 328 | .I device
|
---|
| 329 | .RS
|
---|
| 330 | You are trying to put the boot monitor or an image after a file system, but
|
---|
| 331 | there is no or not enough space. Did you specify the full path of the
|
---|
| 332 | monitor instead of just "boot"?
|
---|
| 333 | .RE
|
---|
| 334 | .SP
|
---|
| 335 | .I Device
|
---|
| 336 | is not a MINIX 3 file system
|
---|
| 337 | .RS
|
---|
| 338 | You are using
|
---|
| 339 | .B \-device
|
---|
| 340 | on a device that doesn't contain a file system. Maybe you specified the
|
---|
| 341 | wrong device, maybe you should make a file system, or maybe you should use
|
---|
| 342 | .BR \-boot .
|
---|
| 343 | .RE
|
---|
| 344 | .SP
|
---|
| 345 | .I Device
|
---|
| 346 | contains a file system
|
---|
| 347 | .RS
|
---|
| 348 | You are about to destroy a file system with
|
---|
| 349 | .BR \-boot .
|
---|
| 350 | Maybe you meant to use
|
---|
| 351 | .BR \-device ?
|
---|
| 352 | You have 10 seconds to make up your mind...
|
---|
| 353 | .RE
|
---|
| 354 | .SP
|
---|
| 355 | .I File
|
---|
| 356 | is too big
|
---|
| 357 | .RS
|
---|
| 358 | Several types of messages like these will tell you that
|
---|
| 359 | .I file
|
---|
| 360 | can't be installed in a boot sector, or that there is no room to add some
|
---|
| 361 | parameters, etc. Is
|
---|
| 362 | .I file
|
---|
| 363 | really a bootstrap?
|
---|
| 364 | .RE
|
---|
| 365 | .SS "Bootstrap errors"
|
---|
| 366 | Read error
|
---|
| 367 | .RS
|
---|
| 368 | A read error trying to get the next bit of boot code. You may even get the
|
---|
| 369 | BIOS error code in hex. Either the device has a bad block, or jumpboot is
|
---|
| 370 | told to read a nonexistent disk.
|
---|
| 371 | .RE
|
---|
| 372 | .SP
|
---|
| 373 | No active partition
|
---|
| 374 | .RS
|
---|
| 375 | None of the partitions in a partition table is marked active.
|
---|
| 376 | .RE
|
---|
| 377 | .SP
|
---|
| 378 | Not bootable
|
---|
| 379 | .RS
|
---|
| 380 | Partition does not exist (jumpboot), or it's bootstrap isn't executable.
|
---|
| 381 | .RE
|
---|
| 382 | .SH NOTES
|
---|
| 383 | The MINIX 3 bootstraps can boot beyond the 8G disk size limit if the BIOS
|
---|
| 384 | supports the IBM/MS INT 13 Extensions. Alas only Minix-vmd can make use of
|
---|
| 385 | this, standard MINIX 3 has a 4G disk size limit.
|
---|
| 386 | .SH BUGS
|
---|
| 387 | It has four more options than the SunOS installboot program it is modeled
|
---|
| 388 | after.
|
---|
| 389 | .PP
|
---|
| 390 | The bootblock code has been crunched to such ugliness that you can use it
|
---|
| 391 | to scare little kids out of your garden.
|
---|
| 392 | .SH AUTHOR
|
---|
| 393 | Kees J. Bot (kjb@cs.vu.nl)
|
---|
| 394 | .\"
|
---|
| 395 | .\" $PchId: installboot.8,v 1.7 2000/08/13 22:09:31 philip Exp $
|
---|