source: trunk/minix/man/man8/installboot.8@ 12

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

Minix 3.1.2a

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