What is the role of Magic Number in boot loading in Linux?

Not a checksum, but more of a signature. It does provide some simple evidence that some MBR is present.

0xAA55 is also an alternating bit pattern: 1010101001010101

It's often used to help determine if you are on a little-endian or big-endian system, because it will read as either AA55 or 55AA. I suspect that is part of why it is put on the end of the MBR.

See also this Wikipedia article


Hi I hope this will help you:

http://en.wikibooks.org/wiki/X86_Assembly/Bootloaders

http://en.wikipedia.org/wiki/Extended_boot_record

"The 0xAA55 signature is the last two bytes of the first sector of your bootdisk (bootsector/Master Boot Record/MBR). If it is 0xAA55, then the BIOS will try booting the system. If it's not found (it garbled or 0x0000), you'll get an error message from your BIOS that it didn't find a bootable disk (or the system tries booting the next disk). This signature is represented (in binary) as 0b1010101001010101. The alternating bit pattern was thought to be a protection against certain failures (drive or controller).

Of course, this is an i386ism (also present on amd64 I believe). Lots of other architectures may take different approaches."

http://www.mail-archive.com/[email protected]/msg18029.html

Tags:

Linux