freebsd-skq/lib/libstand
jhb 2f8a906c36 First cut at support for booting a GPT labeled disk via the BIOS bootstrap
on i386 and amd64 machines.  The overall process is that /boot/pmbr lives
in the PMBR (similar to /boot/mbr for MBR disks) and is responsible for
locating and loading /boot/gptboot.  /boot/gptboot is similar to /boot/boot
except that it groks GPT rather than MBR + bsdlabel.  Unlike /boot/boot,
/boot/gptboot lives in its own dedicated GPT partition with a new
"FreeBSD boot" type.  This partition does not have a fixed size in that
/boot/pmbr will load the entire partition into the lower 640k.  However,
it is limited in that it can only be 545k.  That's still a lot better than
the current 7.5k limit for boot2 on MBR.  gptboot mostly acts just like
boot2 in that it reads /boot.config and loads up /boot/loader.  Some more
details:
- Include uuid_equal() and uuid_is_nil() in libstand.
- Add a new 'boot' command to gpt(8) which makes a GPT disk bootable using
  /boot/pmbr and /boot/gptboot.  Note that the disk must have some free
  space for the boot partition.
  - This required exposing the backend of the 'add' function as a
    gpt_add_part() function to the rest of gpt(8).  'boot' uses this to
    create a boot partition if needed.
- Don't cripple cgbase() in the UFS boot code for /boot/gptboot so that
  it can handle a filesystem > 1.5 TB.
- /boot/gptboot has a simple loader (gptldr) that doesn't do any I/O
  unlike boot1 since /boot/pmbr loads all of gptboot up front.  The
  C portion of gptboot (gptboot.c) has been repocopied from boot2.c.
  The primary changes are to parse the GPT to find a root filesystem
  and to use 64-bit disk addresses.  Currently gptboot assumes that the
  first UFS partition on the disk is the / filesystem, but this algorithm
  will likely be improved in the future.
- Teach the biosdisk driver in /boot/loader to understand GPT tables.
  GPT partitions are identified as 'disk0pX:' (e.g. disk0p2:) which is
  similar to the /dev names the kernel uses (e.g. /dev/ad0p2).
- Add a new "freebsd-boot" alias to g_part() for the new boot UUID.

MFC after:	1 month
Discussed with:	marcel (some things might still change, but am committing
			what I have so far)
2007-10-24 21:33:00 +00:00
..
arm
i386 Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
powerpc
sparc64 Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
__main.c
arp.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
assert.c
bcd.c
bootp.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
bootp.h
bootparam.c
bootparam.h
bswap.c
bzipfs.c Re-enable support for bzip2'ed compressed filesystems. 2005-05-17 16:22:54 +00:00
cd9660.c Implement the full range of ISO9660 number conversion routines in iso.h. 2005-10-18 13:35:08 +00:00
close.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
closeall.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
dev.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
dosfs.c Don't add integers to void pointers. 2004-10-03 15:58:20 +00:00
dosfs.h
environment.c Cast away const qualifier to squash GCC warning. 2007-04-04 03:29:02 +00:00
ether.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
ext2fs.c Don't add integers to void pointers. 2004-10-03 15:58:20 +00:00
fstat.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
getopt.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
gets.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
globals.c
gzipfs.c
if_ether.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
in_cksum.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
inet_ntoa.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
ioctl.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
iodesc.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
libstand.3 Fix prototypes. 2005-11-24 11:14:06 +00:00
lseek.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
Makefile First cut at support for booting a GPT labeled disk via the BIOS bootstrap 2007-10-24 21:33:00 +00:00
net.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
net.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
netif.c
netif.h
nfs.c
nfsv2.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
nullfs.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
open.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
pager.c
printf.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
qdivrem.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
quad.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
random.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
rarp.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
read.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
readdir.c
rpc.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
rpc.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
rpcv2.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
saioctl.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
sbrk.c Don't add integers to void pointers. 2004-10-03 15:58:20 +00:00
splitfs.c Remove unused variable. Shorten the path to WARNS=6 compliance. 2005-05-20 12:55:38 +00:00
stand.h Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
stat.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
strcasecmp.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
strdup.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
strerror.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
strtol.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
tftp.c - Given that we tell the compiler that struct ip is packed and 32-bit 2007-10-21 17:03:18 +00:00
tftp.h
twiddle.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
udp.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
ufs.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
write.c Remove California Regent's clause 3, per letter 2007-01-09 01:02:06 +00:00
zalloc_defs.h Just use uintptr_t and intptr_t rather than requiring each arch to provide 2005-05-31 20:01:18 +00:00
zalloc_malloc.c
zalloc_mem.h
zalloc_protos.h
zalloc.c