lukem
f5cf87f961
add fix by Minoura Makoto to correctly support recursive extended partitions.
...
the offset of an extended sub-partition is the offset of the top-level
extended partition, not the partition before it (this is annoying, and
makes `clean' recursive mbr descent difficult). fixes PRs 11829 and 12677.
2001-04-16 10:47:15 +00:00
christos
8ce2d80d7a
back out previous; it is better for now to handle the dependencies in
...
bsd.prog.mk
2001-01-14 09:41:41 +00:00
christos
c26e2519ac
add .NOTMAIN for good measure.
2001-01-14 09:24:30 +00:00
christos
726afedd26
don't use OBJS in the dependency line because it is not defined yet.
2001-01-14 09:22:01 +00:00
christos
9b6a2fbeb4
don't use OBJ in the dependency line cause it is not defined yet.
2001-01-14 09:21:24 +00:00
lukem
45c96da8ec
use MBR_IS_EXTENDED() instead of local test (which was missing a test case)
2000-12-24 13:32:41 +00:00
lukem
0f2402d559
* Recursively print out extended partition entries. An extended partition is
...
effectively an MBR with it's own partition table which contains another
4 `slots', each of which can be another extended partition...
This involved reworking some of the internal functions.
* Use off_t appropriately (so we can manipulate sectors past 4GB).
* Tweak to compile with WARNS=2
2000-12-19 16:01:28 +00:00
lukem
b813a81a7c
convert to ANSI KNF
2000-12-19 15:44:27 +00:00
lukem
a67eb3719f
list the options in a specific options list (as per the `traditional'
...
man page). i find this much easier to read than option descriptions
scattered amongst paragraphs of text.
2000-12-18 23:42:40 +00:00
abs
fc52578672
xref (disklabel.8, fdisk.8, mbrlabel.8) as appropriate
2000-11-14 11:06:19 +00:00
lukem
42039d09f9
use .Xr
2000-11-07 05:40:17 +00:00
thorpej
6d78b8c024
When fetching the disk's hardware geometry, first attempt the
...
DIOCGDEFLABEL ioctl, then fall back onto the DIOCGDINFO ioctl
if that fails. This ensures that we will get the actual hardware
geometry info rather than any bogus info that might have been
previously written to the disk's label area.
2000-07-06 17:22:43 +00:00
wiz
334298998c
Fix QNX partition IDs, confirmed by looking at FreeBSD's fdisk.
...
Note: 77 == 0x4d
2000-06-14 19:35:50 +00:00
augustss
73053385f4
Note that sysid 0 marks a partition as unused.
2000-06-07 22:40:59 +00:00
fvdl
1033142eea
Truncate the CHS values correctly in case a partition boundary exceeds
...
their range.
2000-05-27 19:02:54 +00:00
nonaka
a279fa1682
also install on prep.
2000-05-02 18:20:41 +00:00
soren
c1e87c4d5e
Also install on cobalt.
2000-03-19 23:01:07 +00:00
perry
39546c529f
add bootselect MLINK -- from jhawk
2000-03-06 01:23:11 +00:00
hubertf
04a9ed5842
Revert last change, it was caused by the build not picking the
...
right files if DESTDIR is set.
2000-02-11 16:14:32 +00:00
hubertf
e597c0a106
s/STRIP/STRIPPROG/
2000-02-11 15:36:25 +00:00
tsutsui
c539ff5d84
STRIPPROG -> STRIP
2000-02-01 06:00:35 +00:00
soda
07a6bcdde4
Build fdisk also on arc
2000-01-31 15:54:48 +00:00
hubertf
92bd305e4a
Add note that "fdisk -i" is the same as "fdisk /mbr" on MSDOS.
1999-10-11 01:04:57 +00:00
enami
d758f82f45
Oops, needs an operator.
1999-09-25 04:27:55 +00:00
enami
cd2531c01e
Build fdisk also on hpcmips.
1999-09-25 04:26:28 +00:00
enami
62d623bfc4
Don't decend into the subdirectory mbr_bootsel except i386,
...
since it currently doesn't contain MI thing and not compile
on ofppc box (thanks Wolfgang) and probably on bebox box.
1999-09-25 04:18:20 +00:00
simonb
2bb88f2837
Fix tyop and clean up usage of commas a little.
1999-09-21 12:09:25 +00:00
soren
b49886ea7a
Update usage().
...
Prevent buffer overflows when configuring boot selector.
Cycle through partitions when entering boot names.
Use '<UNUSED>' consistently.
Reviewed by: fvdl
1999-09-06 23:58:59 +00:00
sakamoto
8ecadeaecd
Build fdisk on bebox and ofppc(replaced powerpc).
1999-07-02 17:48:26 +00:00
thorpej
7d344bb51b
Make sure the boot selector actually gets updated if you only change
...
the timeout and/or the default menu choice.
1999-06-04 18:59:15 +00:00
fvdl
6a2c64449b
Sanity check the drive number in %dl and use it instead of blindly
...
assuming disk 0.
1999-05-02 13:48:30 +00:00
fvdl
7d18a1432b
Tighten check for bad drive numbers to avoid passing garbage to the
...
2nd stage loader.
1999-05-02 12:20:01 +00:00
fvdl
c0042f7871
Because of space constraints, error messages got shortened. Reflect this
...
in the manual page.
1999-05-02 12:18:40 +00:00
fvdl
cbf8e59c01
Make check if we need int13 extensions for the bootselector more correct.
1999-05-02 12:17:48 +00:00
fvdl
5a48cda98a
Remove confusing entry about cylinder boundaries.
1999-05-02 12:17:13 +00:00
ross
255793452f
Since fdisk/mbr contains a man page, we need to descend into it regardless
...
of which ${MACHINE} we are.
1999-05-02 04:42:47 +00:00
christos
8eeaf82ae4
- Use the proper multiply instructions so that we don't get truncated.
...
- Fix comparison, which did not work before.
1999-04-30 15:29:44 +00:00
fvdl
a6f7895b92
Only use int13 extensions if the sectors can not be read through the
...
older CHS interface. This works around stupid BIOSs who report that
int13 extensions are present and functional, but fail when you actually
use them. Like Adaptec SCSI BIOSs.
For the bootselector, there was no space to get the CHS info from
the BIOS. Instead, use a flag that can be set by fdisk. fdisk will
set it if one of the partitions on the disk is out of CHS reach
for this disk/BIOS, so that the bootselector will use int13 extensions.
This isn't so bad, because it needs to be configured via fdisk anyway.
Change the mbr manualpage to reflect some shorter error messages.
1999-04-28 23:27:01 +00:00
fvdl
48c1c25ba5
Make the bootselector configurable by fdisk. Add a -B flag to this
...
effect (i386 only of course). Also change one branch in the
bootselector code to an explicit 16 bit one, and check both
the boot menu and partition tables to see if the partition
requested by the user should be booted. This check just in case,
should the bootselector menu and partition table get out of sync
somehow. (mmm, bytesqueezing)
1999-04-17 01:38:00 +00:00
fvdl
7adcf112ca
Add a manual page describing the MBR and the bootselector.
1999-04-15 22:35:19 +00:00
fvdl
fa9bff9be1
Add and build a bootselecting MBR (i386).
1999-04-15 22:31:23 +00:00
christos
22f9ed8d9b
Make it work for both elf and a.out
1999-03-24 16:02:41 +00:00
mycroft
f6590b22cd
Clean up SYNOPSIS formatting.
1999-03-07 11:02:05 +00:00
lukem
dcab0210a0
convert from NOxxx= to MKxxx=no.
...
include <bsd.own.mk> if testing a MKxxx variable.
1999-02-13 02:54:17 +00:00
perry
9a8b75daeb
add BeOS entry, from URA Hiroshi, PR 6974
1999-02-09 19:11:46 +00:00
ws
f0a4bb6818
Use the drive parameter from the partition table
...
to support booting from the second disk.
1999-02-08 21:52:43 +00:00
ws
faf59c0aba
Initialize drive number in DL (not done by some BIOSs).
...
If you want to use 32-bit addresses, be sure to init the high bits, too.
Some additional register saves around BIOS calls (just in case).
1999-01-28 14:14:04 +00:00
thorpej
3a6110fd02
Use <sys/disklabel_mbr.h>.
1999-01-27 21:41:31 +00:00
jonathan
9fe4d42638
Set otherwise-unused global variable `disksectors' to disklabel.d_secperunit.
...
Change fdisk -S to emit disksectors as DLSIZE (for benefit of sysinst.)
1998-11-08 00:29:08 +00:00
ws
1cd9ec3c71
Separate master bootcode from fdisk.
1998-10-15 15:23:23 +00:00
ws
3cdac6d69c
Separate master bootcode from fdisk.
...
Add int13 extension support to master bootcode.
1998-10-15 15:22:13 +00:00
ws
ba2f852285
Completely zero out a partition table entry,
...
if type, start and size are given as zero.
1998-10-02 17:23:22 +00:00
ws
d8881a6f9a
Automagically initialize boot code and partition table if not yet valid.
...
Don't touch the partition table on -i, if previously valid.
1998-09-28 15:44:18 +00:00
rvb
db826b28d9
Dont report more than 1023 cylinders for DOS/BIOS because
...
the code below will truncate to a 10 bit field. This
can cause major problems later for DOS.
1998-08-10 18:46:29 +00:00
drochner
c0f9ff25e7
Use the new NetBSD partition ID for first time setup of an MBR.
1998-02-25 14:19:12 +00:00
drochner
707f944948
update for new partition ID
1998-02-19 15:15:29 +00:00
drochner
43e4e2726a
Add new NetBSD partition ID.
...
Update information about partition types - add missing types, insert
"reserved" for IDs which are marked as "officially reserved" in other
lists.
Sources of information:
-"How it Works -- Partition Tables" by Hale Landis <hlandis@ibm.net>
-Ralph Brown's interrupt list
1998-02-19 14:47:43 +00:00
ghudson
70698891e2
When estimating the number of cylinders in the BIOS geometry, use the
...
total number of sectors as reported by disklabel.d_secperunit rather
than multiplying out the disklabel geometry, which is less accurate.
1998-02-07 16:19:16 +00:00
perry
34a98169f0
macroize BSD, NetBSD, FreeBSD and misc cleanup
1998-02-06 05:54:12 +00:00
mikel
b545bd186c
Don't print "DOS partition initialized" if -S set; from Nathan
...
Williams in PR bin/4893.
1998-02-02 06:39:41 +00:00
enami
24ec6663fe
Add missing cast. This is a minimum fix to avoid overflow which causes
...
core dumps with some disk geometry.
1997-12-22 01:54:07 +00:00
ross
2ac0cdeda9
Typos, English.
1997-11-26 04:26:27 +00:00
phil
a8d52993f0
Backout the prototype of opendisk().
1997-09-30 17:29:40 +00:00
phil
c342d989c5
Prototype opendisk().
1997-09-30 17:09:13 +00:00
lukem
216ef04613
switch to using opendisk(3) from libutil
1997-09-25 05:08:28 +00:00
lukem
2ddc10a0ab
define WARNS?=1 for all of sbin/*
1997-09-15 12:45:47 +00:00
lukem
700617acfc
correct use of various mdoc macros to cleanup resultant man page
1997-09-14 14:05:34 +00:00
lukem
6e61b15d9c
* support ``short'' names of disks (e.g, ``sd0'') instead of requiring
...
the full name (e.g, ``/dev/rsd0d'') a la disklabel(8) (where the code
was effectively lifted from ;-)
* prefix hexadecimal numbers in output with '0x'
1997-09-14 13:52:26 +00:00
phil
5388cd2717
Don't print some things if -f flag given.
1997-09-11 22:53:00 +00:00
phil
2d074efe44
-- add -b flag for setting fdisk's idea of BIOS geometry from command line
...
-- cleanup so WARNS=1 works
-- man page updated to reality.
1997-09-05 21:26:57 +00:00
phil
1b063875bf
Upgrade for non-interactive use. Interactive use is nearly unchanged.
...
-i no longer implies -u, -i now does not use the entire first track
because some BIOSes refuse to boot from a partition in the first track.
-s renamed to -S, new -s for non-interactive setting of a partition's
id, offset and size. Updated documentation to match.
1997-08-11 23:31:41 +00:00
phil
1145b74178
Add code for a -s flag where the output is a series of VAL=xyz lines
...
so /bin/sh can "eval `fdisk -s`" and get variables defined with the
fdisk information.
1997-07-29 08:31:31 +00:00
perry
c94b6b4f09
Add a whole lot of MBR partition types, derived from a couple of sources
...
including Linux.
Is there a master list of this somewhere?
1997-06-24 06:38:50 +00:00
mrg
5667e094a1
move man pages into share/man.
1997-06-23 04:23:46 +00:00
thorpej
98de682c7c
Make this work on big-endian systems, such as the PowerPC. From
...
Wolfgang Solfrank <ws@tools.de>
1997-03-29 20:46:17 +00:00
ghudson
9b746f76a4
Add code to look at the existing partition entries to deduce the
...
translated geometry of the disk. This code will only change the
disk geometry if it can find a geometry which is consistent with
all partition entries, so it's very conservative about choosing
a new disk geometry. Under some circumstances, it will choose a
number of cylinders which is a little lower than it needs to be,
but this code is enough so that you can create new partitions
with the correct physical addresses.
The right solution to this problem is to have the boot loader
communicate the BIOS geometry of each disk to the kernel, in a
manner similar to the symbol table, and then provide a kernel
interface to get at that information. I'm unfortunately not
really qualified to make such a change, and I want something
that works better than the status quo.
1995-10-04 23:11:19 +00:00
cgd
0114e805ce
convert to new RCS Id conventions; reduce my headache
1995-03-18 14:54:19 +00:00
mycroft
e631f9d003
Recognize Linux file systems correctly.
1995-01-13 10:42:02 +00:00
cgd
06e2955ff1
specify man pages the new way.
1994-12-22 10:44:04 +00:00
cgd
5eeab43e28
more cleanups from Jim Jegers, passed over by me.
1994-12-05 20:15:31 +00:00
mycroft
4b83d937e9
Allow `partitioning' of a regaular file.
1994-10-20 00:06:17 +00:00
mycroft
4922d725cf
Remove some more uses of obsolete functions.
1994-09-23 23:48:10 +00:00
mycroft
d9ad777ece
Clean up a bit more.
1994-09-23 05:30:09 +00:00
mycroft
73984e0809
Clean this up a bit.
1994-09-23 04:30:13 +00:00
jtc
3be79230a5
More spelling errors.
1994-01-28 20:07:07 +00:00
jtc
ab3a89f913
Fix spelling errors
1994-01-14 02:05:23 +00:00
cgd
04f80fa1bc
386bsd -> NetBSD
1993-12-06 09:32:27 +00:00
mycroft
aee4b07b8a
Add RCS identifiers, remove some completely useless RCS logs and patchkit
...
headers, and a few other insignificant changes.
1993-08-02 17:48:44 +00:00
mycroft
cda4f8f6ee
Add RCS identifiers.
1993-08-01 05:37:30 +00:00
cgd
3a05a908df
added a 386bsd fdisk program, by julian elischer. (patch 111)
1993-04-09 19:23:56 +00:00