Commit Graph

20 Commits

Author SHA1 Message Date
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
jmcneill 7ed78119d5 PR# 33260: [dM] kernel divide-by-zero for some broken disks 2006-09-23 11:51:04 +00:00
christos 1214d130c2 Always make partitions contiguous even if the mbr has gaps. From someone
who wants to remain anonymous.
2006-06-11 23:25:23 +00:00
dsl db0d69832d Improve disk portability between systems.
- Always look for labels in the first two sectors
- Update all existing labels, but only write new labels to netbsd mbr
  partitions, and the first/second sector of disks that don't have an mbr.
Moving disks between systems still sucks bigtime!
- raw patition is either c or d, if d then c is reserved
- max partitions might be 8 or 16, nothing in the label gives the maximum
- endianness
2006-01-28 19:57:07 +00:00
jmmv d9585f8d92 Improve a comment in the patch I sent (handle DM6 DDO partition) based
on hubertf@'s comments.  Hmm...  I didn't even notice this was already
committed.
2005-12-27 15:45:09 +00:00
christos ddeaed4040 don't hard-code 63. 2005-12-26 16:11:04 +00:00
christos 4ead7c35d9 Julio M. Merino Vidal: Patch to recognize and automatically skip the Ontrack
Disk Manager drivers.
2005-12-26 16:08:34 +00:00
dsl a89c49ee25 KNF - remove the K&R function definitions 2005-12-18 17:02:45 +00:00
dsl 5f7cb96ae2 Only update partition 2 when RAW_PART is 3. 2005-12-18 16:48:06 +00:00
dsl ae10740c03 Revert previous change.
It breaks the code that generates a default label (with partition 'a'
covering the entire volume - which is what everything expects) for disks that
don't have a NetBSD label nor an MBR, but do have a single filesytem covering
the entire volume.
2005-12-14 21:40:32 +00:00
cube cb6200f890 Remove bogus XXX comment: a.msg doesn't point to stack data. 2005-12-14 15:27:59 +00:00
cube ae544644cf Fix typo in previous commit. 2005-12-14 15:23:00 +00:00
reinoud d3857d0bd2 Fix disklabel recognition code for mbr based systems like i386. It would
return NULL even though no disklabel was found making callers assume that a
valid disklabel WAS found but instead were presented by the dummy disklabel
that is created.

If the rval is SCAN_CONTINUE it now returns a standard error that no
disklabel was found instead of the NULL.
2005-12-14 15:01:03 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
perry da8abec863 nuke trailing whitespace 2005-02-26 21:34:55 +00:00
fvdl af5309b07c Change the 'sz' variable in bounds_check_* to int64_t to avoid overflows
when a very large blocknumber is passed in.
2005-02-08 08:56:21 +00:00
lukem 1c33b4e6a4 Overhaul MBR handling (part 1):
<sys/bootblock.h>:
    *	Added definitions for the Master Boot Record (MBR) used by
	a variety of systems (primarily i386), including the format
	of the BIOS Parameter Block (BPB).
	This information was cribbed from a variety of sources
	including <sys/disklabel_mbr.h> which this is a superset of.

	As part of this, some data structure elements and #defines
	were renamed to be more "namespace friendly" and consistent
	with other bootblocks and MBR documentation.
	Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
    *	Deprecated in favor of <sys/bootblock.h> (the latter is more
	"host tool" friendly).

amd64 & i386:
    *	Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
	be consistent with the naming convention of the msdosfs tools.

    *	Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
	and it's confusing to have two functionally equivalent bootblocks,
	especially given that "ufs" has multiple meanings (it could be
	a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

    *	Rework pbr.S (the first sector of bootxx_*):
	    +	Ensure that BPB (bytes 11..89) and the partition table
		(bytes 446..509) do not contain code.
	    +	Add support for booting from FAT partitions if BOOT_FROM_FAT
		is defined.  (Only set for bootxx_msdos).
	    +	Remove "dummy" partition 3; if people want to installboot(8)
		these to the start of the disk they can use fdisk(8) to
		create a real MBR partition table...
	    +	Compile with TERSE_ERROR so it fits because of the above.
		Whilst this is less user friendly, I feel it's important
		to have a valid partition table and BPB in the MBR/PBR.

    *	Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
	with other platforms.

    *	Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
    	we can boot off FAT partitions.

    *	Crank version of /usr/mdec/boot to 3.1, and fix some of the other
	entries in the version file.

installboot(8) (i386):
    *	Read the existing MBR of the filesystem and retain the BIOS
    	Parameter Block (BPB) in bytes 11..89 and the MBR partition
	table in bytes 446..509.  (Previously installboot(8) would
	trash those two sections of the MBR.)

mbrlabel(8):
    *	Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
	to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).
2003-10-08 04:25:43 +00:00
dsl 40bac1084c When writing the disklabel:
- Write label to all netbsd (type 169) mbr partitions (even if they don't
  already have a label).
- Update any label found in sector LABELSECTOR and sector 0.
Latter change makes DIOCWDINFO (etc) work on raidframe (fixing bin/22529).
2003-08-19 11:49:24 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
dsl d38f6f3115 MI code to read disklabels from mbr disks. 2003-07-07 13:28:48 +00:00