Page 1 of 1
How to get the hard disk mode?(CHS/LBA/LARGE)
Posted: Tue Mar 10, 2009 9:26 pm
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?
Re: How to get the hard disk mode?(CHS/LBA/LARGE)
Posted: Wed Mar 11, 2009 12:53 am
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.