0

First of all thanks for showing interests in helping me,

so I try to understand how the bootloader works and i searched a little bit and found the following. The MBR has a size of 512 bytes, minus the 4 partition tables which are 64 bytes, we have a partition of 446 bytes plus the 2 bytes for the MBR signature aka. Magic Number. The magic number is 0x55aa. But how does the magic number fit in only 2 bytes? So 0x55 and 0xaa have a size of 255. How does it fit in only 2 bytes?

Thanks

Arusekk
  • 827
  • 4
  • 22
S Nell
  • 41
  • 6
  • Magic number is a word of 0xaa55 not a word of 0x55aa. A word is 16-bits (2 bytes). Because the x86 processors are little endian they are stored in memory as the byte 0x55 followed by a byte of 0xaa. The magic number is the last 2 bytes of the boot sector. Not sure what makes you think that 0xaa or 0x55 can't fit in a byte (both are less than 256) – Michael Petch Sep 21 '18 at 16:59
  • @MichaelPetch Ah I see, well maybe I was a little bit confused . So just for understanding i can hold 2^16 in the last 2 byte right ? And on the whole partion 2^512 ? – S Nell Sep 21 '18 at 17:14
  • You cna hold a value up to 2^16 in 2 bytes - correct. Not sure I understand what you mean for the whole partition in the second question. – Michael Petch Sep 21 '18 at 17:17
  • Just a mind game, on a partition of 512 bytes I can hold 2^512. I hope you understand what I mean. – S Nell Sep 21 '18 at 17:20
  • Okay thank you. You really helped me understanding that. Thank you very much! – S Nell Sep 21 '18 at 17:57

0 Answers0