• Please review our updated Terms and Rules here

If the 55 AA signature at the end of the MBR needed and why?

Ruud

Veteran Member
Joined
Nov 30, 2009
Messages
1,548
Location
Heerlen, NL
Why is this 55 AA signature at the end of the Master Boot Record? Various documents about the MBR say it is needed but not why. Even documents advising you about how to write your own OS say it is needed. I'm busy writing my own OS, don't use this signature and I have no troubles. That's quite logical IMHO because none of my software is looking for it.

Today I run into this thread where Ray states that XUB looks for it. This is a good reason to add the signature to my MBR, just in case I want to use XUB with my OS.

Question: which other software looks for this signature?
 
The signature is used by the BIOS to determine if it should attempt to boot from the drive. On early BIOSes, this signature was often not checked because you were only booting from either the first floppy drive or the first hard drive. If an unformatted floppy was inserted, there would be a read error. If the floppy was formatted but not "bootable", it would still have a stub bootsector (telling you to insert another disk). So if the sector on the first floppy drive could be read, the BIOS was always booting it regardless.

Once BIOSes started to have the capability to boot from multiple hard drives, CD-ROM, USB, etc, then it became important to check the signature to determine when booting from a device should be attempted.
 
It should also be noted that MBR didn't exist until DOS 2.0. So a BIOS that checks for this signature can't boot DOS 1.x.
 
55AA being of course alternate zeros-&-ones then alternate ones-&-zeros, often used as a marker or flag for various purposes back in the day
 
Thank you for the answers! The BIOS looking for it makes sense. So far I only (dis)assembled XT-BIOSes and never found a check on these bytes. But I can understand modern BIOSes will check it.
 
I think I've seen the occasional BIOS setup on old machines which lets you turn the signature check on and off, but I'm not 100% sure on that, maybe I'm just getting confused with emulators:

Bochs has a configuration file setting for floppies:
Code:
#=======================================================================
# FLOPPY_BOOTSIG_CHECK: disabled=[0|1]
# Enables or disables the 0xaa55 signature check on boot floppies
# Defaults to disabled=0
# Examples:
#   floppy_bootsig_check: disabled=0
#   floppy_bootsig_check: disabled=1
#=======================================================================
floppy_bootsig_check: disabled=0

And QEMU has a similar command-line option::
Code:
       -no-fd-bootchk
              Disable boot signature checking for floppy disks in BIOS. May be
              needed to boot from old floppy disks.
 
Thank you for the answers! The BIOS looking for it makes sense. So far I only (dis)assembled XT-BIOSes and never found a check on these bytes. But I can understand modern BIOSes will check it.
The OS/2 museum has you covered [here], in the "What Is a Valid Boot Sector?" section.

To summarize: The 55 AA signature was introduced for hard drives, and the code to verify it was in the MFM controller ROM. The PC/XT BIOS only supported floppy boot and did not check anything; the PC/AT BIOS used the signature for hard drives only, but introduced some basic heuristics when booting from floppy. Early operating systems (PC-DOS 1.x or Xenix) did not contain any signature on their boot floppies and would not boot otherwise.

Later BIOSes used all kinds of heuristics. I worked on an IBM ThinkPad with a Pentium II processor, and its BIOS would refuse booting from the hard drive unless its partition table contained at least one FAT16 partition (no need to be activated). Installing Linux on that thing was very confusing until I figured that out.
 
Back
Top