- Fail: was using the wrong structure (the boot sector is a BOOT_SECTOR which contains the BIOS Parameter Block, not a BPB directly).

- Fix wrong debug print too.

svn path=/trunk/; revision=34660
This commit is contained in:
ReactOS Portable Systems Group 2008-07-22 06:31:31 +00:00
parent d543929a55
commit 04dfc992a1

View file

@ -289,7 +289,7 @@ RamdiskMapPages(IN PRAMDISK_DRIVE_EXTENSION DeviceExtension,
// Calculate the actual offset in the drive // Calculate the actual offset in the drive
// //
ActualOffset.QuadPart = DeviceExtension->DiskOffset + Offset.QuadPart; ActualOffset.QuadPart = DeviceExtension->DiskOffset + Offset.QuadPart;
DPRINT1("Disk offset is: %I64d and Offset is: %I64d. Total: %I64d\n", DPRINT1("Disk offset is: %d and Offset is: %I64d. Total: %I64d\n",
DeviceExtension->DiskOffset, Offset, ActualOffset); DeviceExtension->DiskOffset, Offset, ActualOffset);
// //
@ -328,10 +328,7 @@ RamdiskMapPages(IN PRAMDISK_DRIVE_EXTENSION DeviceExtension,
// //
MappedBase = MmMapIoSpace(PhysicalAddress, ActualLength, MmCached); MappedBase = MmMapIoSpace(PhysicalAddress, ActualLength, MmCached);
DPRINT1("Mapped at: %p\n", MappedBase); DPRINT1("Mapped at: %p\n", MappedBase);
return MappedBase;
UNIMPLEMENTED;
while (TRUE);
return NULL;
} }
PVOID PVOID
@ -360,7 +357,7 @@ RamdiskCreateDiskDevice(IN PRAMDISK_BUS_EXTENSION DeviceExtension,
PVOID Buffer; PVOID Buffer;
WCHAR LocalBuffer[16]; WCHAR LocalBuffer[16];
UNICODE_STRING SymbolicLinkName, DriveString, GuidString, DeviceName; UNICODE_STRING SymbolicLinkName, DriveString, GuidString, DeviceName;
PPACKED_BIOS_PARAMETER_BLOCK Parameters; PPACKED_BOOT_SECTOR BootSector;
ULONG BytesPerSector, SectorsPerTrack, Heads, BytesRead; ULONG BytesPerSector, SectorsPerTrack, Heads, BytesRead;
PVOID BaseAddress; PVOID BaseAddress;
LARGE_INTEGER CurrentOffset; LARGE_INTEGER CurrentOffset;
@ -616,10 +613,10 @@ RamdiskCreateDiskDevice(IN PRAMDISK_BUS_EXTENSION DeviceExtension,
// //
// Get the data // Get the data
// //
Parameters = (PPACKED_BIOS_PARAMETER_BLOCK)BaseAddress; BootSector = (PPACKED_BOOT_SECTOR)BaseAddress;
BytesPerSector = Parameters->BytesPerSector[0]; BytesPerSector = BootSector->PackedBpb.BytesPerSector[0];
SectorsPerTrack = Parameters->SectorsPerTrack[0]; SectorsPerTrack = BootSector->PackedBpb.SectorsPerTrack[0];
Heads = Parameters->Heads[0]; Heads = BootSector->PackedBpb.Heads[0];
// //
// Save it // Save it
@ -647,6 +644,17 @@ RamdiskCreateDiskDevice(IN PRAMDISK_BUS_EXTENSION DeviceExtension,
} }
} }
//
// Sanity check for debugging
//
DPRINT1("[RAMDISK] Loaded...\n"
"Bytes per Sector: %d\n"
"Sectors per Track: %d\n"
"Number of Heads: %d\n",
DriveExtension->BytesPerSector,
DriveExtension->SectorsPerTrack,
DriveExtension->NumberOfHeads);
// //
// Check if the drive settings haven't been set yet // Check if the drive settings haven't been set yet
// //