- Fix CDROM device registration: don't hardcode it to 0xE0, but register whatever device FreeLdr starts and which is not reported by BIOS as a hardisk. Fixes setupldr2.

svn path=/trunk/; revision=40676
This commit is contained in:
Aleksey Bragin 2009-04-24 12:08:56 +00:00
parent d3748c04be
commit d425e6c2ee

View file

@ -772,7 +772,8 @@ DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey,
ULONG DiskCount;
ULONG Size;
ULONG i;
BOOLEAN Changed;
BOOLEAN Changed, BootDriveReported = FALSE;
CHAR BootPath[512];
/* Count the number of visible drives */
DiskReportError(FALSE);
@ -846,6 +847,9 @@ DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey,
Int13Drives = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST));
for (i = 0; i < DiskCount; i++)
{
if (BootDrive == 0x80 + i)
BootDriveReported = TRUE;
if (MachDiskGetDriveGeometry(0x80 + i, &Geometry))
{
Int13Drives[i].DriveSelect = 0x80 + i;
@ -890,8 +894,16 @@ DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey,
SetHarddiskIdentifier(DiskKey, 0x80 + i);
}
/* Also add one cdrom drive */
FsRegisterDevice("multi(0)disk(0)cdrom(224)", &DiskVtbl);
/* Get the drive we're booting from */
MachDiskGetBootPath(BootPath, sizeof(BootPath));
/* Add it, if it's a floppy or cdrom */
if ((BootDrive >= 0x80 && !BootDriveReported) ||
DiskIsDriveRemovable(BootDrive))
{
/* TODO: Check if it's really a cdrom drive */
FsRegisterDevice(BootPath, &DiskVtbl);
}
}
static VOID