Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
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?
.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!
That code is not something you should learn from. A reset should be done after few unsuccessful read tries. Then few read tries and another reset if still unsuccessful. This loop should be run few times and if still unsuccessful, an error message should be displayed. No endless read loops!