How to use INT 13h to load from HDD instead of floppy?
How to use INT 13h to load from HDD instead of floppy?
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|
|AetherOS Project|
-
- Member
- Posts: 119
- Joined: Wed Dec 12, 2018 12:16 pm
Re: How to use INT 13h to load from HDD instead of floppy?
Do you mean load your kernel from HDD? Anyways, maybe you can use int 13h DL=80h for reading the HDD.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)?
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
Re: How to use INT 13h to load from HDD instead of floppy?
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
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