Thanks a lot for the information on A20.
Combuster wrote:You can begin by looking up the error code
here
What you should at least take into account is that some floppy drives fail to work on the first few tries, so in some cases you will have to try again several times until it does work.
I thought of that, and at one point I had it looping to check the status over and over again, but it always returned something other than 0.
AJ wrote:Hi,
What's the error? Is the value always the same or does it vary? Is DL valid (what value is passed in DL from the BIOS at boot time)? Do you even need to be using function 0x01, when the reset operation should return a status value in AH? What is the value of CF after each operation?
For the record, CF is not set after either operation.
DL is set to 0, which is apparently the identifier for the first floppy drive. As far as I know, that's fine.
In terms of testing the value, I was writing out a table of tests to do so, but it wasn't the most efficient way of doing so. It was like this:
Code: Select all
cmp al, 0
je code_00
cmp al, 0x01
je code_01
; This repeats for every possible error code, and jumps to...
code_00:
mov byte[0x0B0000], 0x41
jmp $
code_01:
mov byte[0x0B0000], 0x42
jmp $
; And so on.
The idea was that for each different error code, a different character would be put into the video memory, and then I could look up which error code was associated with that character. Can anyone suggest a faster way (if possible) of doing this? I haven't finished writing this out, due to the multitude of possible error codes. There must be a better way...
Just in case anyone suggests it, the issue isn't with a damaged floppy drive, because I have identical results whether I try this in QEMU or with a real, physical machine.