LWN.net Logo

Garrett: Further adventures in EFI booting

Matthew Garrett continues his investigation into the subtleties of booting Linux with EFI. "GPT, or the GUID Partition Table, is the EFI era's replacement for MBR partitions. It has two main advantages over MBR - firstly it can cover partitions larger than 2TB without having to increase sector size, and secondly it doesn't have the primary/logical partition horror that still makes MBR more difficult than it has any right to be. The format is pretty simple - you have a header block 1 logical block into the media (so 512 bytes on a typical USB stick), and then a pointer to a list of partitions. There's then a secondary table one block from the end of the disk, which points at another list of partitions. Both blocks have multiple CRCs that guarantee that neither the header nor the partition list have been corrupted. It turns out to be a relatively straightforward modification of isohybrid to get it to look for a secondary EFI image and construct a GPT entry pointing at it. This works surprisingly well, and media prepared this way will boot EFI machines if burned to a CD or written to a USB stick."
(Log in to post comments)

Garrett: Further adventures in EFI booting

Posted Jul 27, 2011 12:42 UTC (Wed) by Trelane (subscriber, #56877) [Link]

So many good quotes of the week here. :)

Garrett: Further adventures in EFI booting

Posted Jul 27, 2011 13:05 UTC (Wed) by Cyberax (✭ supporter ✭, #52523) [Link]

An ugly job. But someone has to do it.

Kudos to mjg59!

Garrett: Further adventures in EFI booting

Posted Jul 27, 2011 13:54 UTC (Wed) by nye (guest, #51576) [Link]

I think if I had Matthew's job I would probably spend most of my time drinking alone and weeping.

Garrett: Further adventures in EFI booting

Posted Jul 27, 2011 14:01 UTC (Wed) by danieldk (guest, #27876) [Link]

Another excellent and detailed blog post. Thanks Matthew!

Garrett: Further adventures in EFI booting

Posted Jul 27, 2011 15:14 UTC (Wed) by epa (subscriber, #39769) [Link]

It reminds me of those programming challenges where you have to write a program which is valid in C, FORTRAN, shell script and VAX machine code all at the same time.

Garrett: Further adventures in EFI booting

Posted Jul 27, 2011 15:26 UTC (Wed) by nye (guest, #51576) [Link]

Garrett: Further adventures in EFI booting

Posted Jul 27, 2011 19:05 UTC (Wed) by dtlin (✭ supporter ✭, #36537) [Link]

Polyglots!

Garrett: Further adventures in EFI booting

Posted Aug 5, 2011 11:03 UTC (Fri) by Tov (guest, #61080) [Link]

Just for curiosity: what does "ER" + two random bytes disassembly to in X86 ASM?

Garrett: Further adventures in EFI booting

Posted Aug 5, 2011 13:07 UTC (Fri) by mjg59 (subscriber, #23239) [Link]

00000000 45 inc bp
00000001 52 push dx
00000002 0800 or [bx+si],al
00000004 0000 add [bx+si],al

Copyright © 2011, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds