[SOLVED] Floppy read problems (with fdc) on different...
Posted: Sat Aug 05, 2023 11:07 am
I already have an ATA drive, so I thought why not make a floppy?
The problem occurs when trying to read from a floppy with another size than a 1.44Mb floppy.
If this was real hardware, I would expect all sorts of issues, but I'm having this same problem on both QEMU and Virtualbox
E.g. on VirtualBox if I change the attached floppy to anything else than 1.44Mb it will cause an error
In this post I have omitted my initialization code as it is fairly long.
However, during initialization I:
1 Reset controller
2 Send sense interrupts
3 Set transfer speed
4 spin up drives
5 Configure
6 Recalibrate (which should seek to 0)
Then finally I first select and then read with this code:
On anything other than 1.44Mb the 6th bit in st0 is set (decimal 64) which according to:
https://www.ardent-tool.com/floppy/Flop ... mming.html
is an error
The value in st1 is also 1 which according to the same site is a "no address mark error"
I'm really stuck, have not idea why it doesn't work and would appreciate help greatly!
The problem occurs when trying to read from a floppy with another size than a 1.44Mb floppy.
If this was real hardware, I would expect all sorts of issues, but I'm having this same problem on both QEMU and Virtualbox
E.g. on VirtualBox if I change the attached floppy to anything else than 1.44Mb it will cause an error
In this post I have omitted my initialization code as it is fairly long.
However, during initialization I:
1 Reset controller
2 Send sense interrupts
3 Set transfer speed
4 spin up drives
5 Configure
6 Recalibrate (which should seek to 0)
Then finally I first select and then read with this code:
Code: Select all
push 20
call allocate_mem
mov eax, esi
push word 0x46
push dword 0x20000
push word 512 ;The dma should stop it right?
call initialize_dma_floppy
mov byte [es:0x8006], 0
;Send read
mov byte [es:esi], 01000000b | 0x6
mov byte [es:esi+1], 0 ;Head number+drive
mov byte [es:esi+2], 0 ;C
mov byte [es:esi+3], 0 ;H
mov byte [es:esi+4], 1 ;S
mov byte [es:esi+5], 2 ;Size
mov byte [es:esi+6], 8 ;Eot
mov byte [es:esi+7], 0x1B ;Gap lenght
mov byte [es:esi+8], 0xFF ;DTL
push word 0x3F0
push esi
push word 9
call write_entire_command_floppy
;Wait for interrupt
read_test_wait_irq:
cmp byte [es:0x8006], 0
je read_test_wait_irq
push word 0x3F0
push esi
push word 7
call read_entire_data_floppy
movzx eax, byte [es:esi]
push eax
push word 0x09
call write_uint
movzx eax, byte [es:esi+1]
push eax
push word 0x09
call write_uint
https://www.ardent-tool.com/floppy/Flop ... mming.html
is an error
The value in st1 is also 1 which according to the same site is a "no address mark error"
I'm really stuck, have not idea why it doesn't work and would appreciate help greatly!