Author: fireball
Date: Fri Apr 24 16:08:56 2009
New Revision: 40676
URL:
http://svn.reactos.org/svn/reactos?rev=40676&view=rev
Log:
- 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.
Modified:
trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] Fri Apr 24
16:08:56 2009
@@ -772,7 +772,8 @@
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 @@
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 @@
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