BIOS INT 13H with AH=2 can only read 72 sectors each time. Why?

前端 未结 3 653
一生所求
一生所求 2021-01-12 14:23

I am using Bochs 2.4.5 to write a boot sector code. I use the INT 13H to read sectors from floppy. But I found that if the sector count to read > 72, the INT13 will fail. An

相关标签:
3条回答
  • 2021-01-12 15:06

    According to Standard Floppy Disks Supported by MS-DOS, the number of sectors per track on a 1.44 MB floppy disk is 18. Since 18*4 = 72, that might be a clue. It's possible that the BIOS doesn't want to read more than a certain number of tracks at once.

    0 讨论(0)
  • 2021-01-12 15:17

    You're using Bochs, so the answer can be found in the Bochs BIOS source: the BIOS is performing an explicit range check on the number of sectors, and rejecting it if it is greater than 72 (or equal to 0).

    0 讨论(0)
  • 2021-01-12 15:23

    The simple answer as pointed out by Matthew Slattery is that this is merely a range check performed by Bochs. This is based on a 2.88Mb floppy multi track floppy disk controller read which would be limited to 72 sectors.


    The happy answer is that current BIOS due to backwards compatibility only support a single side read which for a 1.44Mb floppy is a maximum of 18 sectors. This depends on the starting sector so that the actual maximum would be up to the total remaining on the track. Booting and running from a USB flash drive is a simple alternative to the obsolete floppy disk for os dev. The same BIOS disk/diskette functions can be used depending on the boot drive identifier (dl register).

    0 讨论(0)
提交回复
热议问题