Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More reliably load the extra sectors of code in the bootloader
I found out that you're supposed to call the reset BIOS call and retry several times because real floppy drives act like that. Sure enough when I checked the BIOS manual it says you should retry! I thought about using the "actual number of sectors read" return value to request fewer sectors the next try but there are a few reasons why not: 1. I saw online that some BIOS impls don't return a valid value unless the status flag is set 2. It's complicated to calculate the address to write to and technically I would have to calculate the track number as well if the number of sectors to read is more than 63 (but that's more than the size of the Code Segment anyway) and some BIOS support multi-track reads from one call so I don't have to calculate that. So I don't really understand when and how you're supposed to use that value. I would think you shouldn't trust any data read if you got an error status.
- Loading branch information