Implement non-booting support for the DragonFly 64 bit disklabel:
commitf584d992d59ee620492fbc0c7fc6c746831f6dab
authorMatthew Dillon <dillon@dragonflybsd.org>
Tue, 19 Jun 2007 02:53:56 +0000 (19 02:53 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Tue, 19 Jun 2007 02:53:56 +0000 (19 02:53 +0000)
tree969be0a1043bb842b194963185a15fdee90ff441
parent04cb7e0ef4b590ec188fe1cf91ee09a317eff44e
Implement non-booting support for the DragonFly 64 bit disklabel:

* Add full kernel support.  Both 32 and 64 bit labels will be probed.
* Add a new program, disklabel64, which allows you to create and edit
  the new disklabel.
* Add some logic to prevent foot shooting.

DragonFly's 64 bit disklabels start at byte offset 0 on the disk slice
or GPT partition and operate in a slice-relative fashion.  No translation
is required when going from on-disk to in-core or vise-versa, unlike the
existing 32 bit disklabels.  512 bytes at the beginning of the label are
reserved for legacy boot code.  Specifically, the label starts at sector 0,
NOT sector 1, which means its location on the disk is the same regardless
of the sector size.

The label has a UUID to uniquely identify the storage and a type and
object uuid for each partition.  All location specifications are 64 bit
byte offsets, NOT logical blocks.  The label enforces an alignment
requirement for label-related I/O and partitions which defaults to 4K
regardless of the sector size.  This makes the label 100% portable across
media with different sector sizes within the constraints of the alignment
requirement.

All partitions are specified using byte offsets and sizes, constrained
by the alignment requirement, relative to the base of the label (i.e.
offset 0 in the slice).  disklabel64 will adjust the offsets for display
purposes to be relative to the partition table area.  The label headers,
partition table, and boot2 areas come BEFORE the partition table area and
partitions which overlap any of those objects are not allowed.

By default, a virgin 64 bit disklabel will reserve 32K for boot2.  As of
this writing, boot1 and boot2 blocks have not yet been implemented.
13 files changed:
sbin/Makefile
sbin/disklabel/disklabel.c
sbin/disklabel64/Makefile [new file with mode: 0644]
sbin/disklabel64/crc32.c [new file with mode: 0644]
sbin/disklabel64/disklabel64.5 [new file with mode: 0644]
sbin/disklabel64/disklabel64.8 [new file with mode: 0644]
sbin/disklabel64/disklabel64.c [new file with mode: 0644]
sbin/disklabel64/pathnames.h [new file with mode: 0644]
sys/kern/subr_disklabel32.c
sys/kern/subr_disklabel64.c
sys/kern/subr_diskslice.c
sys/sys/disklabel.h
sys/sys/disklabel64.h