8 .Nd NEC PC-98x1 slice table maintenance utility
19 In order for the BIOS to boot the kernel,
20 certain conventions must be adhered to.
21 Sector 0 of the disk must contain boot code,
24 BIOS slices can be used to break the disk up into several pieces.
25 The BIOS brings in sector 0 and verifies the magic number.
27 0 boot code then searches the slice table to determine which
30 This boot code then brings in the bootstrap from the
31 active slice and, if marked bootable, runs it.
34 you can have one or more slices with one active.
38 utility can be used to divide space on the disk into slices and set one
45 serves a similar purpose to the
48 The first form is used to
49 display slice information or to interactively edit the slice
51 The second is used to write a slice table using a
53 and is designed to be used by other scripts/programs.
56 .Bl -tag -width indent
58 Change the active slice only.
63 Reinitialize the boot code contained in sector 0 of the disk.
67 .It Fl f Ar configfile
68 Set slice values using the file
72 always modifies existing slices, unless
74 is also given, in which case all existing slices are deleted (marked
84 in which case standard input is read.
86 .Sx CONFIGURATION FILE ,
87 below, for file syntax.
92 is used, you are not asked if you really want to write the slices
93 table (as you are in the interactive mode).
96 Initialize sector 0 of the disk.
103 Initialize sector 0 slice table
106 slice covering the entire disk.
107 Some space at the start of the disk will reserved for the IPL program
108 and the pc98 slice table itself.
110 Print summary information and exit.
112 Test mode; do not write slice values.
113 Generally used with the
115 option to see what would be written to the slice table.
119 Update (edit) the disk's sector 0 slice table.
125 Slices that are unused are suppressed unless this flag is specified.
130 prints out the slice table that is written to the disk.
132 Operate on a single slice table entry only.
138 The final disk name can be provided as a
140 disk name only, e.g.\&
142 or as a full pathname.
145 tries to figure out the default disk device name from the
148 When called with no arguments, it prints the sector 0 slice table.
151 ******* Working on device /dev/da0 *******
152 parameters extracted from in-core disklabel are:
153 cylinders=33075 heads=8 sectors/track=32 (256 blks/cyl)
155 parameters to be used for BIOS calculations are:
156 cylinders=33075 heads=8 sectors/track=32 (256 blks/cyl)
158 Media sector size is 512
159 Warning: BIOS sector numbering starts with sector 1
160 Information from DOS bootblock is:
161 The data for partition 1 is:
162 sysmid 148,(FreeBSD/NetBSD/386BSD)
163 start 256, size 2490112 (1215 Meg), sid 196
164 beg: cyl 1/ sector 0/ head 0;
165 end: cyl 9727/ sector 0/ head 0
166 system Name FreeBSD(98)
167 The data for partition 2 is:
168 sysmid 148,(FreeBSD/NetBSD/386BSD)
169 start 2490368, size 5505024 (2688 Meg), sid 196
170 beg: cyl 9728/ sector 0/ head 0;
171 end: cyl 31231/ sector 0/ head 0
172 system Name FreeBSD(98)
173 The data for partition 3 is:
175 The data for partition 4 is:
177 The data for partition 5 is:
179 The data for partition 6 is:
181 The data for partition 7 is:
183 The data for partition 8 is:
185 The data for partition 9 is:
187 The data for partition 10 is:
189 The data for partition 11 is:
191 The data for partition 12 is:
193 The data for partition 13 is:
195 The data for partition 14 is:
197 The data for partition 15 is:
199 The data for partition 16 is:
203 The disk is divided into three slices that happen to fill the disk.
204 The second slice overlaps the end of the first.
205 (Used for debugging purposes.)
206 .Bl -tag -width ".Em cyl , sector No and Em head"
208 is used to label the slice.
211 magic number 148 decimal (94 in hex).
217 fields provide the start address
218 and size of a slice in sectors.
224 fields are used to specify the beginning and end addresses of the slice.
226 is the name of the slice.
230 these numbers are calculated using BIOS's understanding of the disk geometry
231 and saved in the bootblock.
237 flags are used to indicate that the slice data is to be updated.
240 option is also given,
242 will enter a conversational mode.
243 In this mode, no changes will be written to disk unless you explicitly tell
249 utility will display each slice and ask whether you want to edit it.
252 will step through each field, show you the old value,
253 and ask you for a new one.
254 When you are done with the slice,
256 will display it and ask you whether it is correct.
257 It will then proceed to the next entry.
263 fields correct is tricky, so by default,
264 they will be calculated for you;
265 you can specify them if you choose to though.
267 After all the slices are processed,
268 you are given the option to change the
271 Finally, when all the new data for sector 0 has been accumulated,
272 you are asked to confirm whether you really want to rewrite it.
274 The difference between the
281 flag edits (updates) the existing slice parameters
286 them (old values will be ignored);
287 it will setup the last BIOS slice to use the whole disk for
291 The automatic calculation of starting cylinder etc.\& uses
292 a set of figures that represent what the BIOS thinks the
293 geometry of the drive is.
294 These figures are taken from the in-core disklabel by default,
297 initially gives you an opportunity to change them.
298 This allows you to create a bootblock that can work with drives
299 that use geometry translation under the BIOS.
301 If you hand craft your disk layout,
302 please make sure that the
304 slice starts on a cylinder boundary.
306 Editing an existing slice will most likely result in the loss of
307 all data in that slice.
311 interactively once or twice to see how it works.
312 This is completely safe as long as you answer the last question
314 There are subtleties that
316 detects that are not fully explained in this manual page.
317 .Sh CONFIGURATION FILE
320 option is given, a disk's slice table can be written using values
323 The syntax of this file is very simple;
324 each line is either a comment or a specification, as follows:
325 .Bl -tag -width indent
326 .It Ic # Ar comment ...
327 Lines beginning with a
329 are comments and are ignored.
330 .It Ic g Ar spec1 spec2 spec3
331 Set the BIOS geometry used in slice calculations.
333 three values specified, with a letter preceding each number:
334 .Bl -tag -width indent
336 Set the number of cylinders to
339 Set the number of heads to
342 Set the number of sectors/track to
346 These specs can occur in any order, as the leading letter determines
347 which value is which; however, all three must be specified.
349 This line must occur before any lines that specify slice
352 It is an error if the following is not true:
353 .Bd -literal -offset indent
354 1 <= number of cylinders
355 1 <= number of heads <= 256
356 1 <= number of sectors/track < 64
359 The number of cylinders should be less than or equal to 1024, but this
360 is not enforced, although a warning will be printed.
365 file system) must lie completely within the
366 first 1024 cylinders; if this is not true, booting may fail.
367 Non-bootable slices do not have this restriction.
369 Example (all of these are equivalent), for a disk with 1019 cylinders,
370 39 heads, and 63 sectors:
371 .Bd -literal -offset indent
376 .It Ic p Ar slice type start length
377 Set the slice given by
387 Only those slices explicitly mentioned by these lines are modified;
388 any slice not referenced by a
390 line will not be modified.
391 However, if an invalid slice table is present, or the
393 option is specified, all existing slice entries will be cleared
394 (marked as unused), and these
396 lines will have to be used to
397 explicitly set slice information.
398 If multiple slices need to be
401 lines must be specified; one for each slice.
403 These slice lines must occur after any geometry specification lines,
411 Specifying a slice type of zero is
412 the same as clearing the slice and marking it as unused; however,
413 dummy values (such as
415 must still be specified for
420 Note: the start offset will be rounded upwards to a head boundary if
421 necessary, and the end offset will be rounded downwards to a cylinder
422 boundary if necessary.
424 Example: to clear slice 4 and mark it as unused:
428 Example: to set slice 1 to a
430 slice, starting at sector 1
431 for 2503871 sectors (note: these numbers will be rounded upwards and
432 downwards to correspond to head and cylinder boundaries):
434 .Dl "p 1 165 1 2503871"
439 Can occur anywhere in the config file, but only
442 Example: to make slice 1 the active slice:
451 The default boot code will not necessarily handle all slice types
452 correctly, in particular those introduced since
456 The entire utility should be made more user-friendly.
460 do not understand the difference between
464 causing difficulty to adjust.
466 You cannot use this command to completely dedicate a disk to
470 command must be used for this.