OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Apr 23, 2024 5:26 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How to use INT 13h to load from HDD instead of floppy?
PostPosted: Thu Feb 28, 2019 6:43 pm 
Offline
Member
Member

Joined: Wed Nov 01, 2017 7:41 pm
Posts: 35
I can't find good docs about this so I resolved to ask here, dudes, how to load from HDD? From floppy we use that CHS model and for HDD? And even for flash medias (SSD)?

_________________
OS Development is awesome!

|AetherOS Project|


Top
 Profile  
 
 Post subject: Re: How to use INT 13h to load from HDD instead of floppy?
PostPosted: Thu Feb 28, 2019 7:12 pm 
Offline
Member
Member

Joined: Wed Dec 12, 2018 12:16 pm
Posts: 119
AwfulMint wrote:
I can't find good docs about this so I resolved to ask here, dudes, how to load from HDD? From floppy we use that CHS model and for HDD? And even for flash medias (SSD)?

Do you mean load your kernel from HDD? Anyways, maybe you can use int 13h DL=80h for reading the HDD.
DL = 00h First floppy drive (A:)
DL = 01h Second floppy drive (B:)
DL = 80h First HDD
DL = 81h Second HDD
DL = E0h CD/DVD
DL = FFh Last HDD supported by the BIOS


Top
 Profile  
 
 Post subject: Re: How to use INT 13h to load from HDD instead of floppy?
PostPosted: Thu Feb 28, 2019 8:30 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 22, 2014 6:33 pm
Posts: 934
Location: USA
As hextakatt states, the DL register specifies which drive you are booting from. However, you do not hard code this at all. This is given at POST. i.e.: at the time your code receives control the DL register is already set to the value of the media it is booting from.

However, to read from a hard drive, especially one larger than 500meg, you will need to use LBA addressing instead of CHS addressing.

To do so, you can use the MS Extension services which allow up to 64-bits of LBA addressing (though it may not actually support all 64-bits).

Search for the services where AH starts with 4xh, i.e.: AH = 42h is the read service. You will need to check for the support of these services as well.

Ben
- http://www.fysnet.net/osdesign_book_series.htm


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 109 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group