History log of /freebsd-10.1-release/sys/sys/diskmbr.h
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 247961 07-Mar-2013 gavin

Support the FAT16 partition type in gpart(8)

PR: kern/174714
Submitted by: 4721 at hushmail dot com
MFC after: 1 week


# 246630 10-Feb-2013 ae

Add bootcamp support to the loader.

Tested by: dchagin
MFC after: 1 week


# 234417 18-Apr-2012 marck

VMware environments are not unusual now. Add VMware partitions recognition
(both MBR for ESXi <= 4.1 and GPT for ESXi 5) to g_part.

Reviewed by: ae
Approved by: ae
MFC after: 2 weeks


# 231367 10-Feb-2012 ae

Add alias for the partition with type 0x42 to the MBR scheme.

MFC after: 1 week


# 230522 25-Jan-2012 nwhitehorn

Experimental support for booting CHRP-type PowerPC systems from hard disks.


# 223587 27-Jun-2011 ae

MS Windows NT+ uses 4 bytes at offset 0x1b8 in the MBR to identify
disk drive. The boot0cfg(8) utility preserves these 4 bytes when is
writing bootcode to keep a multiboot ability.
Change gpart's bootcode method to keep DSN if it is not zero. Also
do not allow writing bootcode with size not equal to MBRSIZE.

PR: kern/157819
Tested by: Eir Nym
MFC after: 1 month


# 218014 28-Jan-2011 ae

Add new user-friendly aliases for partition types for the MBR and
EBR schemes: fat32, ebr, linux-data, linux-raid, linux-swap and
linux-lvm. Add bios-boot GUID and alias for the GPT scheme. It used by
GRUB 2 loader. Also do sorting definitions of types in diskmbr.h
and in g_part.c.

PR: bin/120990, kern/147664
MFC after: 2 weeks


# 209536 26-Jun-2010 rpaulo

Add NTFS partition type to GEOM_MBR.


# 139825 07-Jan-2005 imp

/* -> /*- for license, minor formatting changes


# 127976 07-Apr-2004 imp

Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core


# 113452 13-Apr-2003 phk

Add definitions for location of the magic sequence and the length
of a partition entry.


# 113394 12-Apr-2003 phk

protoypes for the dos_partition encoding functions.


# 113034 03-Apr-2003 phk

Retire the DIOCGMBR ioctl before anybody starts to use it.


# 113030 03-Apr-2003 phk

Add #define for DOSPTYP_PMBR, and use it.


# 109556 20-Jan-2003 phk

Add NEXTDOSPART (N-Extended-Dos-Partitions) as replacement for the
misplaced MAX_SLICES from <sys/diskslice.h>.


# 108392 29-Dec-2002 phk

Add a couple of ioctls for modifying MBR's and the rest of sector0.


# 104314 01-Oct-2002 phk

Divorce bsd disklabels, IBM PC MBR's and whatever the things are
called on NEC PC98 machines.

Sponsored by: DARPA & NAI Labs.


# 103683 20-Sep-2002 phk

Make FreeBSD "struct disklabel" agnostic, step 312 of 723:

Rename bioqdisksort() to bioq_disksort().
Keep a #define around to avoid changing all diskdrivers right now.

Move it from subr_disklabel.c to subr_disk.c.
Move prototype from <sys/disklabel.h> to <sys/bio.h>

Sponsored by: DARPA and NAI Labs.


# 103675 20-Sep-2002 phk

Make FreeBSD "struct disklabel" agnostic, step 311 of 723:

Rename diskerr() to disk_err() for naming consistency.

Drop the by now entirely useless struct disklabel argument.

Add a flag argument for new-line termination.

Fix a couple of printf-format-casts to %j instead of %l.

Correctly print the name of all bio commands.

Move the function from subr_disklabel.c to subr_disk.c,
and from <sys/disklabel.h> to <sys/disk.h>.

Use the new disk_err() throughout, #include <sys/disk.h> as needed.

Bump __FreeBSD_version for the sake of the aac disk drivers #ifdefs.

Remove unused disklabel members of softc for aac, amr and mlx, which seem
to originally have been intended for diskerr() use, but which only rotted
and got Copy&Pasted at least two times to many.

Sponsored by: DARPA & NAI Labs.


# 103670 20-Sep-2002 phk

Retire now unused DIOCGDVIRGIN kludge.

Sponsored by: DARPA & NAI Labs.


# 103100 08-Sep-2002 phk

Deal with a new exteded MBR paritition type

Submitted by: Michal Mertl <mime@traveller.cz>


# 101974 16-Aug-2002 alfred

forgot to actually commit the DK/FS TYPES split, do it now.


# 98423 19-Jun-2002 phk

Remove the compat bits for the mis-aligned struct disklabel on alpha,
people got three times longer than I promised.

Sponsored by: DARPA & NAI Labs.


# 96755 16-May-2002 trhodes

More s/file system/filesystem/g


# 96473 12-May-2002 phk

ARGH! SBLOCK is not unused. Try to get this right.

BBSIZE belongs in <sys/disklabel.h> (but shouldn't be a constant).

Define SBLOCK again, using the right math.

Sponsored by: DARPA & NAI Labs.


# 94960 17-Apr-2002 alfred

De-K&R dkcksum() to fix some issues with c++.

Submitted by: Miguel Mendez <flynn@energyhq.homeip.net>


# 94182 08-Apr-2002 phk

Move generic disk ioctls from <sys/disklabel.h> to <sys/disk.h>.

Sponsored by: DARPA & NAI Labs


# 94175 08-Apr-2002 phk

In reverence of the 3rd X11 development rule:

3.The only thing worse than generalizing from one example
is generalizing from no examples at all.

Remove the fwcylinders attribute before anybody gets the idea that we
alone have squared the circle.

Sponsored by: DARPA & NAI Labs.


# 94048 07-Apr-2002 phk

Constify.

Sponsored by: DARPA & NAI Labs.


# 93810 04-Apr-2002 phk

Delete the bogus d_boot[01] fields from struct disklabel.

This shrinks the size 4 bytes on alpha, down to the same 276 bytes
as all other platforms.

Construct a hack to make old ioctls work on new kernels.

Once world is recompiled only the new and correct sysctls will be
used.

This hack will become annoying around 1st of may to make people
rebuild their worlds and it will be gone before 5.0.


# 93773 04-Apr-2002 phk

CTASSERT the size of struct dos_partition.


# 93657 02-Apr-2002 phk

Retire the bogus ioctl DIOCGPART in toto.

Once again we can notice that badly thought out hacks ferment and infect
far more code than initially expected.

Sponsored by: DARPA and NAI Labs.


# 93582 01-Apr-2002 phk

Really sweep the broom on this one.

It's amazing how much cruft accumulate over the years...


# 93578 01-Apr-2002 phk

Remove various controller/disk type hacks for SMD, ST506 and ancient
SCSI stuff which have far outlived its sell by date.


# 93496 31-Mar-2002 phk

Here follows the new kernel dumping infrastructure.

Caveats:

The new savecore program is not complete in the sense that it emulates
enough of the old savecores features to do the job, but implements none
of the options yet.

I would appreciate if a userland hacker could help me out getting savecore
to do what we want it to do from a users point of view, compression,
email-notification, space reservation etc etc. (send me email if
you are interested).

Currently, savecore will scan all devices marked as "swap" or "dump" in
/etc/fstab _or_ any devices specified on the command-line.

All architectures but i386 lack an implementation of dumpsys(), but
looking at the i386 version it should be trivial for anybody familiar
with the platform(s) to provide this function.

Documentation is quite sparse at this time, more to come.

Details:

ATA and SCSI drivers should work as the dump formatting code has been
removed. The IDA, TWE and AAC have not yet been converted.

Dumpon now opens the device and uses ioctl(DIOCGKERNELDUMP) to set
the device as dumpdev. To implement the "off" argument, /dev/null
is used as the device.

Savecore will fail if handed any options since they are not (yet)
implemented. All devices marked "dump" or "swap" in /etc/fstab
will be scanned and dumps found will be saved to diskfiles
named from the MD5 hash of the header record. The header record
is dumped in readable format in the .info file. The kernel
is not saved. Only complete dumps will be saved.

All maintainer rights for this code are disclaimed: feel free to
improve and extend.

Sponsored by: DARPA, NAI Labs


# 93318 28-Mar-2002 grog

Add d_type and fstype names for JFS.

Requested by: Hiten Pandya <hiten@uk.FreeBSD.org>


# 93026 23-Mar-2002 phk

Revert last commit, it came too late to save alpha :-(


# 93025 23-Mar-2002 phk

Hide the ugly d_boot[01] from the kernel.


# 93008 23-Mar-2002 bde

Fixed some style bugs in the removal of __P(()). The main ones were
not removing tabs before "__P((", and not outdenting continuation lines
to preserve non-KNF lining up of code with parentheses. Switch to KNF
formatting and/or rewrap the whole prototype in some cases.


# 92719 19-Mar-2002 alfred

Remove __P


# 92698 19-Mar-2002 phk

Add five GEOM oriented ioctls to get basic information about a geom device.


# 92196 13-Mar-2002 jake

LABELOFFSET is 128 for sparc64.

Submitted by: tmm
Forgotten by: obrien


# 91951 09-Mar-2002 phk

Hide the DIOCGPART ioctl from userland where it has no decent use.

It's use in the kernel is also highly suspect due to the total absense
of any kind of lifetime definition of the passed pointers.


# 89468 17-Jan-2002 bde

Uninlined most of the bloated inline functions in <sys/disklabel.h>. Some
of them need to become even larger to support devfs.


# 89467 17-Jan-2002 bde

Garbage-collect vestiges of disksort(). We now have only one disksort()
again, but its name has regressed to bioqdisksort().

Fixed some style bugs


# 86012 04-Nov-2001 phk

Rename the top 7 bits if disk minors to spare bits, rather than type bits.


# 84587 06-Oct-2001 dfr

Put the label at the same place as i386 for compatibility.


# 83421 13-Sep-2001 obrien

Re-apply rev 1.178 -- style(9) the structure definitions.
I have to wonder how many other changes were lost in the KSE mildstone 2 merge.


# 71009 14-Jan-2001 imp

Use ANSI prototype and function definition for dkcksum so that this
file can be included with C++ again. This appears to have been broken
in 1.54 with the introduction of it as an inline function.


# 70054 15-Dec-2000 phk

Make a #define for the highest legal disk unit (0x1ff)


# 69210 26-Nov-2000 phk

Make diskerr() always log with printf.


# 68043 31-Oct-2000 jkh

Add a new ioctl for doing virgin disklabels.

Submitted by: dillon


# 66066 19-Sep-2000 phk

GC some LFS lint.


# 65934 16-Sep-2000 phk

Add proper prototype for dkcksum();


# 65921 16-Sep-2000 phk

Turn dkcksum() into an __inline function.

Change its type to u_int_16_t.


# 59771 30-Apr-2000 jlemon

Define more DOSPTYP_* constants for different filesystem types

Reminded by: ps


# 59363 18-Apr-2000 phk

Retire bufqdisksort(), all drivers use bioqdisksort now.


# 59249 15-Apr-2000 phk

Complete the bio/buf divorce for all code below devfs::strategy

Exceptions:
Vinum untouched. This means that it cannot be compiled.
Greg Lehey is on the case.

CCD not converted yet, casts to struct buf (still safe)

atapi-cd casts to struct buf to examine B_PHYS


# 58942 02-Apr-2000 phk

Clone bio versions of certain bits of infrastructure:
devstat_end_transaction_bio()
bioq_* versions of bufq_* incl bioqdisksort()
the corresponding "buf" versions will disappear when no longer used.

Move b_offset, b_data and b_bcount to struct bio.

Add BIO_FORMAT as a hack for fd.c etc.

We are now largely ready to start converting drivers to use struct
bio instead of struct buf.


# 55205 29-Dec-1999 peter

Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot). This is consistant with the other
BSD's who made this change quite some time ago. More commits to come.


# 54294 08-Dec-1999 phk

Remove BAD144 support, it has already been disabled for some time.


# 51865 02-Oct-1999 bde

Fixed breakage of userland K&R support in rev.1.39. Kernel inline functions
with new-style function definitions were exported.


# 51227 13-Sep-1999 bde

Oops, I forgot to commit this together with the updates to the callers.

Removed diskerr()'s unused d_name arg and updated callers. This fixes
warnings caused by the arg having the wrong type (not const enough).
The arg was also wrong (a full name instead of a short one) for calls
from from subr_diskmbr.c and pc98/diskslice_machdep.c.


# 50744 01-Sep-1999 phk

Try to win back the "removal of most crufty code" trophy from markm:

Remove WD formatting code which has never worked in 386bsd or FreeBSD.

Remove DIOCSSTEP and DIOCSRETRIES ioctls as well, they belong in
history, along with the SMD disks.

OK'ed by: bde


# 50551 29-Aug-1999 phk

Merge alpha and pc98 changes into i386 MBR handling code and replace all
three copies with one copy in MI land.


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 49771 14-Aug-1999 phk

Spring cleaning around strategy and disklabels/slices:

Introduce BUF_STRATEGY(struct buf *, int flag) macro, and use it throughout.
please see comment in sys/conf.h about the flag argument.

Remove strategy argument from all the diskslice/label/bad144
implementations, it should be found from the dev_t.

Remove bogus and unused strategy1 routines.

Remove open/close arguments from dssize(). Pick them up from dev_t.

Remove unused and unfinished setgeom support from diskslice/label/bad144 code.


# 49617 11-Aug-1999 imp

mfs: DOC2K label type for legacy labels


# 48417 01-Jul-1999 peter

Prototype for alpha_fix_srm_checksum().


# 46679 08-May-1999 phk

Fix some of the places where too much inside knowledge about major/minor
layout and dev_t structure is being (ab)used.


# 45260 03-Apr-1999 bde

Fixed some style bugs (mainly vinum ones and ones fixed in Lite2 but
not here).


# 44948 23-Mar-1999 grog

Add partition type for Vinum.

Offered-for-inspection-to: jkh


# 42264 03-Jan-1999 jkh

catch a /boot doc instance I missed.


# 38518 24-Aug-1998 dfr

Remove a useless ifdef which made struct disklabel have a different
size in kernel and user builds on the alpha and prevented various ioctls
from working.


# 37601 12-Jul-1998 dfr

Point at the correct disk location for alpha disklabels.


# 37466 07-Jul-1998 bde

Don't assume that longs are 32 bits in struct dos_partition.


# 36735 07-Jun-1998 dfr

This commit fixes various 64bit portability problems required for
FreeBSD/alpha. The most significant item is to change the command
argument to ioctl functions from int to u_long. This change brings us
inline with various other BSD versions. Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.


# 33742 22-Feb-1998 dg

The changes I had made long ago to support >32 disk-type units was
incomplete; dkmakeminor was broken for >32. I noticed this when trying
to use more than 32 ccd units on wcarchive.
Reviewed by: bde


# 33469 17-Feb-1998 jkh

Reserve ID for Greg Lehey's Veritas look-alike.


# 32995 01-Feb-1998 bde

Forward declare more structs that are used in prototypes here - don't
depend on <sys/types.h> forward declaring common ones.


# 29683 21-Sep-1997 gibbs

buf.h:
Change the definition of a buffer queue so that bufqdisksort can
properly deal with bordered writes.

Add inline functions for accessing buffer queues. This should be
considered an opaque data structure by clients.

callout.h:
New callout implementation.

device.h:
Add support for CAM interrupts.

disk.h:
disklabel.h:
tqdisksort->bufqdisksort

kernel.h:
Add new configuration entries for configuration hooks and calling
cpu_rootconf and cpu_dumpconf.

param.h:
Add a priority for sleeping waiting on config hooks.

proc.h:
Update for new callout implementation.

queue.h:
Add TAILQ_HEAD_INITIALIZER from NetBSD.

systm.h:
Add prototypes for cpu_root/dumpconf, splcam, splsoftcam, etc..


# 22975 22-Feb-1997 peter

Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.


# 21986 24-Jan-1997 dg

Changed dkunit() to use some previously unused bits in the 'type' field
to extend the unit field to 9 bits (512 units).


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 18444 21-Sep-1996 bde

Cleaned up all headers that include <sys/ioctl.h> or <sys/ioccom.h>:
- don't include <sys/ioctl.h> in any header. Include <sys/ioccom.h>
instead. This was already done in 4.4Lite for the most important
ioctl headers. Header spam currently increases kernel build
times by 10-20%. There are more than 30000 #includes (not counting
duplicates) for compiling LINT.
- include <sys/types.h> if and only it is necessary to make the header
almost self-sufficient (some ioctl headers still need structs from
elsewhere).
- uniformized idempotency ifdefs. Copied the style in the 4.4Lite
ioctl headers.


# 18429 20-Sep-1996 bde

Don't include <sys/conf.h> for the kernel in disk-related headers.
It is needed for implementation details but very little of it is
needed for the interface. Include it in the few places that didn't
already include it.

Include <sys/ioccom.h> in <sys/disklabel.h> (as already in
<sys/diskslice.h>) so that all the disk-related headers are almost
self-sufficient.


# 16363 14-Jun-1996 asami

The Great PC98 Merge.

All new code is "#ifdef PC98"ed so this should make no difference to
PC/AT (and its clones) users.

Ok'd by: core
Submitted by: FreeBSD(98) development team


# 15571 03-May-1996 asami

Bring in ccd support.

New disk type for ccd.


# 14478 11-Mar-1996 hsu

Merge in Lite2: use fixed-width types and reformat comments.
Reviewed by: davidg & bde


# 12478 24-Nov-1995 bde

Oops, the previous change was missing the declaration of `struct
buf_queue_head'. It isn't forward declared in <sys/types.h> like
`struct buf'.


# 12474 24-Nov-1995 bde

Declared tqdisksort(). <sys/disklabel.h> is the wrong place, but
<sys.disk.h> isn't used, so the declaration there isn't seen.


# 10823 16-Sep-1995 bde

Remove transitory labelling code. Labels are now handled by essentially
the original 4.4lite code. Machine Specific Partitions are now handled
separately.


# 8876 30-May-1995 rgrimes

Remove trailing whitespace.


# 8552 16-May-1995 dg

Changes to support the "new" bad144. Adds a "BADSCAN" ioctl and support.

Reviewed by: Bruce Evans
Submitted by: Poul-Henning Kamp


# 8542 15-May-1995 dg

Removed extraneous comma.

Reviewed by: Bruce Evans


# 8193 30-Apr-1995 julian

making a reservation for more bits before people start using them
in the minor number, (this stuff HAS to go!)
The change I want is:
/*
3 2 1 0
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
_________________________________________________________________
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
-----------------------------------------------------------------
| TYPE | SLICE | MAJOR? | UNIT |PART | <-now
-----------------------------------------------------------------
| TYPE |PART2| SLICE | MAJOR? | UNIT |PART | <-soon
-----------------------------------------------------------------

I want 3 more part bits (taken from 'TYPE' (useless as it is) (JRE)
*/


# 7861 15-Apr-1995 bde

Remove bogus unused `struct cpu_disklabel'.


# 7090 16-Mar-1995 bde

Add and move declarations to fix all of the warnings from `gcc -Wimplicit'
(except in netccitt, netiso and netns) and most of the warnings from
`gcc -Wnested-externs'. Fix all the bugs found. There were no serious
ones.


# 6635 22-Feb-1995 bde

Add a prototype.


# 5052 11-Dec-1994 bde

disklabel.h:
Prepare for disk slices - more macros for handling disk device numbers,
version of readdisklabel() without DOS goop.
Clean up prototypes.
Uniformize idempotency ifdef.

diskslice.h:
New file.

dkbad.h:
Define more magic numbers.
Declare internalized version of dkbad struct and functions to operate on it.
Uniformize idempotency ifdef.


# 4462 14-Nov-1994 bde

Declare `struct dkbad' with the correct scope so that everything including
<sys/disklabel.h> doesn't have to include <sys/dkbad.h> to avoid compiler
warnings.


# 4027 31-Oct-1994 phk

changed '#ifdef i386' to '#ifdef __i386__'


# 3940 27-Oct-1994 jkh

Julian Elischer's disklabel fixes.


# 3742 20-Oct-1994 paul

Added
#define MBR_PTYPE_FreeBSD 0xa5 /* FreeBSD partition type */


Reviewed by:
Submitted by:
Obtained from:


# 2165 21-Aug-1994 paul

Made them all idempotent.
Reviewed by:
Submitted by:


# 1817 02-Aug-1994 dg

Added $Id$


# 1549 25-May-1994 rgrimes

The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.

Reviewed by: Rodney W. Grimes
Submitted by: John Dyson and David Greenman


# 1541 24-May-1994 rgrimes

BSD 4.4 Lite Kernel Sources