Int 13h returns controller failure on some hardware?
-
- Member
- Posts: 70
- Joined: Tue Jul 14, 2020 4:01 am
- Libera.chat IRC: clementttttttttt
Int 13h returns controller failure on some hardware?
So, my own os's bootloader is suddenly saying controller failure, when it was proved to be working earlier. I initially suspected that it's the drive's problem, but after several tries with different drives, the result is the same. I did not modify the bootloader in anyway in that time period.
-
- Member
- Posts: 797
- Joined: Fri Aug 26, 2016 1:41 pm
- Libera.chat IRC: mpetch
Re: Int 13h returns controller failure on some hardware?
Hard to say without seeing the code. You should retry 3 times on failure. You shouldn't read/write across a cylinder boundary (assuming you are on a controller that support multitrack reads/writes), you should not read/write a series of sectors across a 64KiB DMA boundary in memory (Don't read/write data across the physical addresses 0x10000, 0x20000, 0x30000).
Are you using Int 13h AH=2h for reads or Int 21h/AH=42h? Are you accessing the correct drive number?
Are you using Int 13h AH=2h for reads or Int 21h/AH=42h? Are you accessing the correct drive number?
-
- Member
- Posts: 70
- Joined: Tue Jul 14, 2020 4:01 am
- Libera.chat IRC: clementttttttttt
Re: Int 13h returns controller failure on some hardware?
I'm using 42h, and dl has been preserved.
-
- Member
- Posts: 797
- Joined: Fri Aug 26, 2016 1:41 pm
- Libera.chat IRC: mpetch
Re: Int 13h returns controller failure on some hardware?
Do you have a git repository or something similar where we can look at the code? There is likely something amiss in your code or it is making assumptions that it shouldn't be making. There are suggestions that with some BIOSes that ES must match the segment in a DAP packet (although I haven't seen that on recent hardware, or on hardware I have used in the past). Are you sure the drive you are accessing supports Int 13h MS extensions (ie AH=42h) on the BIOS you are using?
Virtual environments are far more forgiving than real systems and often assumptions made made not apply to real environments.
Virtual environments are far more forgiving than real systems and often assumptions made made not apply to real environments.
-
- Member
- Posts: 797
- Joined: Fri Aug 26, 2016 1:41 pm
- Libera.chat IRC: mpetch
Re: Int 13h returns controller failure on some hardware?
I assume that you are booting as hard drive or hard drive emulated media (and not floppy drive or floppy drive emulated media) on real hardware since you are apparently able to use extended BIOS extensions. If you were booting as floppy emulated media especially on USB media I could think of another issue.