mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[FREELDR] Workaround for BIOSes that report unusual geometry for CD-ROMs
This is needed for ISO filesystem driver to work correctly, as it assumes 2048 bytes per sector for CD-ROM media. Happens on 86Box with board `[i430FX] ASUS P/I-P55TP4XE`, Bochs emulator with `01/17/97-i440FX-2A69HV3CC-00` BIOS, and some other real machines. CORE-20640
This commit is contained in:
@@ -90,6 +90,7 @@ DiskOpen(CHAR* Path, OPENMODE OpenMode, ULONG* FileId)
|
||||
GEOMETRY Geometry;
|
||||
ULONGLONG SectorOffset;
|
||||
ULONGLONG SectorCount;
|
||||
static BOOLEAN PrintForce = FALSE;
|
||||
|
||||
if (DiskReadBufferSize == 0)
|
||||
{
|
||||
@@ -141,6 +142,16 @@ DiskOpen(CHAR* Path, OPENMODE OpenMode, ULONG* FileId)
|
||||
if (!Context)
|
||||
return ENOMEM;
|
||||
|
||||
if (DriveType == CdromController && SectorSize != 2048)
|
||||
{
|
||||
/* Workaround for CORE-20640 */
|
||||
if (!PrintForce)
|
||||
{
|
||||
ERR("BIOS reports BytesPerSector = %d for CD-ROM, forcing 2048\n", SectorSize);
|
||||
PrintForce = TRUE;
|
||||
}
|
||||
SectorSize = 2048;
|
||||
}
|
||||
Context->DriveNumber = DriveNumber;
|
||||
Context->IsFloppy = (DriveType == FloppyDiskPeripheral);
|
||||
Context->SectorSize = SectorSize;
|
||||
|
||||
Reference in New Issue
Block a user