How come the boot sector signature of IBM PC are them?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
gapry
Posts: 10
Joined: Sat Aug 25, 2012 7:42 pm

How come the boot sector signature of IBM PC are them?

Post by gapry »

An IBM PC boot loader for x86-CPUs in the boot sector is by convention indicated by a two-byte hexadecimal sequence 0x55, 0xAA. Why do them use 0x55 and 0xAA, not others? Do the values mean something which is special?
Antti
Member
Member
Posts: 923
Joined: Thu Jul 05, 2012 5:12 am
Location: Finland

Re: How come the boot sector signature of IBM PC are them?

Post by Antti »

I cannot say for sure but maybe it is just a magic number sequence. If looking at single bits, it has some symmetry.

Code: Select all

	55h == 01010101b
	AAh == 10101010b
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: How come the boot sector signature of IBM PC are them?

Post by sortie »

It's a magic number, so it probably depends on the whatever the developers thought was useful to put there. It's a pretty bad magic number since it's pretty small and there is no checksum, so detecting whether a sector contains a MBR is pretty risky of collisions with other formats.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: How come the boot sector signature of IBM PC are them?

Post by Combuster »

0x55 and 0xAA are not typical numbers you would find as data in a program, nor the does the opcode combination push bp;stosb that it would otherwise represent.

Therefore, if you find it in that particular place the chances it's not been put there on purpose is negligible.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply