So I ran BochsDbg, and found it was stuck in the LBA to CHS area, on this instruction
I have also probed the memory area 0x7C3F and found it to be equal to 2 (as expected), the number of heads on the floppy drive. The entire section of code is:(0) [0x00007cab] 0000:7cab (unk. ctxt): div al, byte ptr ds:0x7c3f ; f6363f7c
Code: Select all
;Sector = LBA%SectorsPerTrack + 1
div BYTE [SectorsPerTrack] ;LBA%SectorsPerTrack
inc dx ;Increase remainder (add 1)
mov BYTE [Counter0], dl ;Save Sector Number
;Cylinder= (LBA/SectorsPerTrack)%Heads
;AX is already (LBA/SectorsPerTrack)
xor dx, dx ;Make it 0
div BYTE [NumHeads] ;Divide by NumHeads (2)
mov BYTE [Counter1], dl ;Save value (remainder)
;Head = (LBA/SectorsPerTrack)/Heads
;AX is already (LBA/SectorsPerTrack/Heads)
mov dh, ah ;Put Head (qoutient) in BIOS arg.