mirror of
https://github.com/FDOS/kernel.git
synced 2025-07-28 16:24:08 +02:00
Read partition tables using CHS methods unless instructed to do otherwise.
Fixes problems with some older boot sector managers like PROT. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@1319 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
c20a106569
commit
7d18a16081
@ -995,7 +995,15 @@ int Read1LBASector(struct DriveParamS *driveParam, unsigned drive,
|
|||||||
for (num_retries = 0; num_retries < N_RETRY; num_retries++)
|
for (num_retries = 0; num_retries < N_RETRY; num_retries++)
|
||||||
{
|
{
|
||||||
regs.d.b.l = drive | 0x80;
|
regs.d.b.l = drive | 0x80;
|
||||||
if (driveParam->descflags & DF_LBA)
|
LBA_to_CHS(&chs, LBA_address, driveParam);
|
||||||
|
/* Some old "security" software (PROT) traps int13 and assumes non
|
||||||
|
LBA accesses. This statement causes partition tables to be read
|
||||||
|
using CHS methods even if LBA is available unless CHS can't reach
|
||||||
|
them. This can be overridden using kernel config parameters and
|
||||||
|
the extended LBA partition type indicator.
|
||||||
|
*/
|
||||||
|
if ((driveParam->descflags & DF_LBA) &&
|
||||||
|
(InitKernelConfig.ForceLBA || ExtLBAForce || chs.Cylinder > 1023))
|
||||||
{
|
{
|
||||||
dap.number_of_blocks = 1;
|
dap.number_of_blocks = 1;
|
||||||
dap.buffer_address = buffer;
|
dap.buffer_address = buffer;
|
||||||
@ -1009,7 +1017,6 @@ int Read1LBASector(struct DriveParamS *driveParam, unsigned drive,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ /* transfer data, using old bios functions */
|
{ /* transfer data, using old bios functions */
|
||||||
LBA_to_CHS(&chs, LBA_address, driveParam);
|
|
||||||
/* avoid overflow at end of track */
|
/* avoid overflow at end of track */
|
||||||
|
|
||||||
if (chs.Cylinder > 1023)
|
if (chs.Cylinder > 1023)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user