Bootloader: Reading sectors from a floppy

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.
Post Reply
chris

Bootloader: Reading sectors from a floppy

Post by chris »

Anybody know where I can get some information on how to do this?
chris

Re:Bootloader: Reading sectors from a floppy

Post 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!
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Bootloader: Reading sectors from a floppy

Post 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 ...
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:Bootloader: Reading sectors from a floppy

Post 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 ;-))
Only Human
chris

Re:Bootloader: Reading sectors from a floppy

Post by chris »

Thanks for your replies. I'll make sure to check your bootloader out, Neo.
Post Reply