Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Loading multiple sectors using int 13h?

Loading multiple sectors using int 13h?

Loading multiple sectors using int 13h?

I'm in the process of developing an OS with my friends. I've written the boot code and was able to load a kernel less than 512 bytes. When I tried loading a kernel of size more than 512 bytes the system reboots. I used int 13h with ah = 0x02. When I try to read more than one sector using int 13 it reboots. Could you please help me to write code to load a kernel more than 512 bytes. I would be thankful to you if someone could help me out with a small code snippet(commented please:) to load a kernel which would span more than one sector. I would also be thankful if you could suggest me a link where I could get some information on this.

RE: Loading multiple sectors using int 13h?


your example:

;---------------------------- cut here
org 0100h

push    cs    ; Get ES segment for buffer
pop    es
mov    ax,0203h; Function 2, read sector (3 sectors)
mov    bx,offset buffer    ; address to buffer
mov    cx,1        ; starting from track 0 sector 1
mov    dx,0            ; head 0 drive 0 (A)
int    13h            ; go
ret                ; return to DOS
buffer    db 1536 dup(0)        ; buffer for 3 sectors

    end    start
;---------------------------- cut here

If I remember correctly, many BIOS'es won't load something correctly if you try to read something that requires it to switch heads or tracks.
I looked the parameters for the function up in Ralf Brown's interrupt list

Wouter Dijkslag

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close