What's the point of resetting a floppy?
Posted: Sun Nov 16, 2014 1:48 am
I'm learning to read data from a floppy disk according to this tutorial( http://www.brokenthorn.com/Resources/OSDev5.html ), I just don't understand, what's the meaning by "reset"? What would happen if I don't reset it?
Thank you.
Thank you.
Code: Select all
.Reset: ; <--why should I reset it?
mov ah, 0 ; reset floppy disk function
mov dl, 0 ; drive 0 is floppy drive
int 0x13 ; call BIOS
jc .Reset ; If Carry Flag (CF) is set, there was an error. Try resetting again
mov ax, 0x1000 ; we are going to read sector to into address 0x1000:0
mov es, ax
xor bx, bx
.Read:
mov ah, 0x02 ; function 2
mov al, 1 ; read 1 sector
mov ch, 1 ; we are reading the second sector past us, so its still on track 1
mov cl, 2 ; sector to read (The second sector)
mov dh, 0 ; head number
mov dl, 0 ; drive number. Remember Drive 0 is floppy drive.
int 0x13 ; call BIOS - Read the sector
jc .Read ; Error, so try again
jmp 0x1000:0x0 ; jump to execute the sector!