Page 1 of 1

Bootloader: Reading sectors from a floppy

Posted: Mon Sep 06, 2004 4:34 pm
by chris
Anybody know where I can get some information on how to do this?

Re:Bootloader: Reading sectors from a floppy

Posted: Mon Sep 06, 2004 6:04 pm
by chris
After searching through a bit of code I've found:

Code: Select all

            mov ax, 1000h       ; ES:BX = 1000:0000
            mov es, ax          ;
            mov bx, 0           ;

            mov ah, 2           ; Load disk data to ES:BX
            mov al, 5           ; Load 5 sectors
            mov ch, 0           ; Cylinder=0
            mov cl, 2           ; Sector=2
            mov dh, 0           ; Head=0
            mov dl, 0           ; Drive=0
            int 13h             ; Read!

Re:Bootloader: Reading sectors from a floppy

Posted: Tue Sep 07, 2004 1:01 am
by Pype.Clicker
yep. that's the most basic way, featuring the good old INT13 from the BIOS. See RalfBrown's interrupt list (RBIL) for details. It will only work in real/unreal mode though ...

Re:Bootloader: Reading sectors from a floppy

Posted: Tue Sep 07, 2004 11:53 am
by Neo
Check out some existing bootloaders such as mine here
The 'read' & 'trans_address' function are the ones which would interest you the most. I think they are rather well commented so should be easy to understand (hopefully ;-))

Re:Bootloader: Reading sectors from a floppy

Posted: Tue Sep 07, 2004 4:44 pm
by chris
Thanks for your replies. I'll make sure to check your bootloader out, Neo.