> >> Hi; > >> > >> As a result of the ongoing GRUB discussion, I have been trying to > >> trace the use of GRUB from BIOS to the end of GRUB stage 2. I am > >> particularly interested in seeing how the MBR is used. > > > > all the MBR does is: > > > > 1) provide up to 446 bytes of initial boot code (446 bytes) > > Not quite, the first two bytes are a relative jmp around a volume label > and some more (disk parameter block comes to mind) information of > varying length - and so the jmp +afew. > > > 2) define the four entries of the partition table (4 @ 16 bytes) > > The standard (DOS) boot code examines these, looking for one marked > active. Having found one, it reads the first sector and executes it. The one with \x80 at the beginning of it's partition table entry is the bootable partition. Just found this wiki: http://wiki.linuxquestions.org/wiki/Partition_table which has a great explanation of the partition table layout. I had found another when I was doing research at the time but I don't have it at home for reference. Now when GPT (GUID Patition Table) becomes the norm (used by Apple, not sure who else uses it), that will change things completely. You can learn about it at Microsoft's site http://technet2.microsoft.com/windowsserver/en/library/bdeda920-1f08-4683-9ffb-7b4b50df0b5a1033.mspx?mfr=true They seem to have some good details there. One interesting thing about that one is that it will protect what we currently know as the MBR so that the old style partitioning tools don't mess up the GUID partition table by overwritting that first sector. Just when you start getting a clue about something change is on the horizon... Jacques B. > > IBM's PC Techical Reference describes the process and, I think, has the > code. > > More recently I've seen code from Apple's Darwin to do this. Apple's > code loops if it can't find an active partition:-) > > > > > 3) have a boot block signature of x'55aa' at the end (final 2 bytes) > > > > if you add that up, you get 512. > > > >> I can create a temporary copy of my MBR using: > >> # dd if=/dev/sdX of=/tmp/sda-mbr.bin bs=512 count=1 > > > > yup, so far, so good. > > > >> My question is; what program should I use to read this file in a human > >> meaningful way (hexdump??)? > > debug in MSDOS is pretty good, it can disassemble the code. > > > > -- > > Cheers > John > > -- spambait > 1aaaaaaa@xxxxxxxxxxxxxxxx Z1aaaaaaa@xxxxxxxxxxxxxxxx > > Please do not reply off-list > > -- > fedora-list mailing list > fedora-list@xxxxxxxxxx > To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list >