I've been trying to write a bootloader (I've used GRUB but want to do this as a learning experience :p) and I've been using Ralphs Browns Interrupt List (HTML format) to help me along the way.
Well I setup my segment segisters (DS, ES, SS, SP)
Now I know that to read from the floppy I must first reset my floppy disk and that it may fail several times. I managed (using RBIL) to write this bit of code to reset the floppy.
Code: Select all
reset_floppy:
; Here we want to reset our floppy so that we can perform read operations on it
; INT 13h Parameters: None
mov ah, 00h
mov dl, 0
int 13h
jc reset_floppy ; Retry if an error occurs
ret
Now to actually read from the floppy I use int 13h with ah being 02h
Code: Select all
read_floppy:
; Here we want to read sectors off our floppy disk to load our kernel
; INT 13h Parameters: None
mov ax, 1000h
mov es, ax ; Load 1000h into ES
mov bx, 0 ; Load 0 into BX
mov ah, 2 ; 02h Function
mov al, 5 ; Read 5 Sectors
mov ch, 0 ; Cyclinder
mov cl, 1 ; Sector
mov dh, 0 ; Head
mov dl, 0 ; Drive
int 13h
jc read_floppy ; Retry if an error occurs
ret
Code: Select all
jmp 1000h:0000 ; Jump to our kernel
Now when I boot up my OS, and my video cursor skips one line and it just hangs there.
Any ideas?