Floppy Disk Controller's Main Status Register
Floppy Disk Controller's Main Status Register
Do we have to have a TIMEOUT for the MRQ bit (Bit #7) in the MSR of the Floppy Disk Controller to become 1 before attempting to reset the drive? I'd appreciate your responses.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.
Do you mean this example from DexOS floppy driver, if so then yes, but you just return with error and error-code, then like in int 13h, you should try to read/write 3 times, with a reset.
Code: Select all
;----------------------------------------------------;
; FdcSendByteReady ;floppy control sendbyte ready ;
;----------------------------------------------------;
FdcSendByteReady:
push eax
push edx
mov [Timer],30 ; 20 = about 1 second,we use (1.5 seconds).
mov [TimerOn],1 ; start couting.
FdcSendByteReadyLoop:
mov al,[TimerOn] ; we test if
or al,al ; timeout is up yet?.
jz FdcSendByteReadyError ; if it is we exit,with error.
mov dx,MsReg ; check status reg
in al,dx
and al,11000000b
cmp al,10000000b ; are we ok to write
jnz FdcSendByteReadyLoop ; if not do another loop.
pop edx
pop eax
clc ; we end here if we write:-)
ret
FdcSendByteReadyError: ; we end up here if we run out of time:-(.
pop edx
pop eax
stc
ret
Thank you Dex, that code really helped me understand some points. My question now is that when I attempt to send the Fix Drive Data command to th FDD, I get this error message by Bochs:
Thanks in advance.
Well command 0x08 is for Check Interrupt Status which I have sent before Fix Drive Data but what does that message mean. Does it mean that the FDD has not yet processed my first command? Do I have to wait for a certain amount of time before it processes my request?Bochs wrote:write 0x03f5: receiving new command 0x03, old one (0x08) pending
Thanks in advance.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.
Here is my full floppy code it is commented to go with the per-do code in the Intel floppy controller pdf.
Also try to do has much testing on real floppy drives, because alot of time it works OK in emulators, but not on real PC, eg: delays are more important on real floppy drives than emulators.
Also try to do has much testing on real floppy drives, because alot of time it works OK in emulators, but not on real PC, eg: delays are more important on real floppy drives than emulators.
- Attachments
-
- Fdd.asm
- (31.23 KiB) Downloaded 50 times
-
- FddInfo.asm
- (2.25 KiB) Downloaded 51 times
-
- DMA.asm
- (6.94 KiB) Downloaded 21 times
Thank you so much Dex. I think for now there is something much more important for me to implement in my kernel which is paging. Then I will be able to use DMA and thus implement the floppy driver.
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.
Pages as referred to in the DMA code is more like real mode segments and has nothing to do with paging. DMA code works fine without paging enabled, all you have to do is chose an address below 16mb for DMA buffer.
Last edited by bubach on Wed Mar 28, 2007 10:58 am, edited 1 time in total.