How to get the hard disk mode?(CHS/LBA/LARGE)

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
User avatar
david
Member
Member
Posts: 93
Joined: Tue Aug 21, 2007 4:22 am
Location: Beijing.China
Contact:

How to get the hard disk mode?(CHS/LBA/LARGE)

Post by david »

bios detects hard disk, and then set hard disk's work mode,(chs/lba/large)
how to get the mode in an os's loader?
Just For Fun
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: How to get the hard disk mode?(CHS/LBA/LARGE)

Post by bewing »

That disk mode setting is strictly internal to the BIOS. It only tells the bios which ATA command parameters and CHS/LBA conversion formulas to use when the software calls INT 13. It does not set anything in the disk, or the disk controller, when you change the setting.

That setting is chosen manually, and then downgraded by the BIOS if the results of the ATA IDENTIFY command show that the drive does not support the selected setting.

In your OS disk detection code, you can do the same thing. Assume 48bit LBA for the disk, and then downgrade if the disk does not support (or need) that mode.
Post Reply