cvs commit: src/sbin/gpt Makefile boot.c gpt.c gpt.h
dillon at crater.dragonflybsd.org
Tue Jul 29 17:48:37 PDT 2008
dillon 2008/07/29 17:45:26 PDT
DragonFly src repository
sbin/gpt Makefile gpt.c gpt.h
Add a terrible hack to GPT which allows non-EFI BIOSes to boot from it.
With a freshly made gpt on a disk you can run 'gpt boot da0' (specifying
the correct whole-disk name) and GPT will do the following:
* It will create a 100MB partition #0 in the GPT
* It will fake up a slice 1 in the PMBR for the BIOS and the loader that
aliases partition #0 in the GPT.
The BIOS and loader will see a bootable slice 1 while the kernel, once
booted, will see a GPT. This can cause confusion because the kernel
will NOT see the fake slice 1 any more, and the partition number in the
GPT of the boot partition 0 (aka da0s0).
The boot partition (da0s0 from the point of view of the kernel) needs
to have a 32 bit disklabel and a UFS filesystem in da0s0a which contains
the kernel image and boot sub-directory. In the boot sub-directory the
loader.conf file must contain a line that points to the root mount, which
say you may have created with gpt add as partition #1.
Older kernels may require the root mount to also be in a disklabel, so you
might have to put a 32 or 64 bit disklabel in partition #1 as well.
This requirement will be removed soon relative to this commit (since the
idea with GPT is to not have to use disklabels).
Revision Changes Path
1.2 +1 -1 src/sbin/gpt/Makefile
1.5 +2 -1 src/sbin/gpt/gpt.c
1.2 +1 -0 src/sbin/gpt/gpt.h
More information about the Commits