I have been following this book, and I got to the "Reading the Disk" part, where they used int 13h with ah=2 to read sectors from the disk. However, for me it always keeps failing - the carry flag is always set to 1, and the ah register is set to 0x1, which according to this page translates to "bad command passed to driver".
I have uploaded my code here.
I'm on Windows. I am compiling my assembly code with nasm, and I run the image with VirtualBox, where the image is loaded as a floppy disk. Everything was working fine until now.
[SOLVED] int 13h/2 always fails
[SOLVED] int 13h/2 always fails
Last edited by steveRoll on Wed Nov 25, 2020 8:39 am, edited 1 time in total.
Re: int 13h/2 always fails
You are asking the interrupt to read 0 sectors from the disk, which is probably not what you intended.
Re: int 13h/2 always fails
Oh wow, thanks!! I didn't even noticeiansjack wrote:You are asking the interrupt to read 0 sectors from the disk, which is probably not what you intended.
For anyone else wondering, dh was a parameter to diskLoad, but also a parameter to int 13h/2 to specify which side of the disk to read, and I set it to 0 before actually copying dh to al, so its original value was lost.