Click here to Skip to main content
16,020,253 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
As per my understanding MBR is located at first partition of hard disk and of size 512 bytes. My question is how BIOS accesses the MBR located on harddisk without drivers? Does BIOS reads specific sector from hard-disk, if yes which interrupt?
Posted
Comments
Sergey Alexandrovich Kryukov 27-Aug-13 1:16am    
Pretty interesting question, my 5, but it involve a pretty big chunk of information.
—SA

1 solution

This is possible because a portion of BIOS is located on the firmware of each disk controller, accessible with standardized API. In particular, you can read any logical sector. The BIOS-level API is based on the interrupt 0x13:
http://en.wikipedia.org/wiki/INT_13H[^].

In fact, this is a pretty complex procedure. First, BIOS needs to auto-detect the drives, consult the boot order record in the BIOS setup data, for the selected drive (optical drive, USB drive, etc.), read partition information, select a partition, and only then access a correct sector and try to load the MRB, detect if the record is a valid MRB and report if it is not found, retry it all with the next drive from the boot order sequence, repeat until successful boot of failure.

See also:
http://en.wikipedia.org/wiki/Master_boot_record[^],
http://en.wikipedia.org/wiki/BIOS_Boot_partition[^].

—SA
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900