[ros-diffs] [ros-arm-bringup] 34660: - 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.

ros-arm-bringup at svn.reactos.org ros-arm-bringup at svn.reactos.org
Tue Jul 22 08:31:32 CEST 2008


Author: ros-arm-bringup
Date: Tue Jul 22 01:31:31 2008
New Revision: 34660

URL: http://svn.reactos.org/svn/reactos?rev=34660&view=rev
Log:
- 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.

Modified:
    trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c

Modified: trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c?rev=34660&r1=34659&r2=34660&view=diff
==============================================================================
--- trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/class/ramdisk/ramdisk.c [iso-8859-1] Tue Jul 22 01:31:31 2008
@@ -289,7 +289,7 @@
     // Calculate the actual offset in the drive
     //
     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);
     
     //
@@ -328,10 +328,7 @@
     //
     MappedBase = MmMapIoSpace(PhysicalAddress, ActualLength, MmCached);
     DPRINT1("Mapped at: %p\n", MappedBase);
-    
-    UNIMPLEMENTED;
-    while (TRUE);
-    return NULL;
+    return MappedBase;
 }
 
 PVOID
@@ -360,7 +357,7 @@
     PVOID Buffer;
     WCHAR LocalBuffer[16];
     UNICODE_STRING SymbolicLinkName, DriveString, GuidString, DeviceName;
-    PPACKED_BIOS_PARAMETER_BLOCK Parameters;
+    PPACKED_BOOT_SECTOR BootSector;
     ULONG BytesPerSector, SectorsPerTrack, Heads, BytesRead;
     PVOID BaseAddress;
     LARGE_INTEGER CurrentOffset;
@@ -616,10 +613,10 @@
                 //
                 // Get the data
                 //
-                Parameters = (PPACKED_BIOS_PARAMETER_BLOCK)BaseAddress;
-                BytesPerSector = Parameters->BytesPerSector[0];
-                SectorsPerTrack = Parameters->SectorsPerTrack[0];
-                Heads = Parameters->Heads[0];
+                BootSector = (PPACKED_BOOT_SECTOR)BaseAddress;
+                BytesPerSector = BootSector->PackedBpb.BytesPerSector[0];
+                SectorsPerTrack = BootSector->PackedBpb.SectorsPerTrack[0];
+                Heads = BootSector->PackedBpb.Heads[0];
                 
                 //
                 // Save it
@@ -648,6 +645,17 @@
         }
         
         //
+        // 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
         //
         if ((DriveExtension->BytesPerSector == 0) ||
@@ -676,7 +684,7 @@
                 DriveExtension->NumberOfHeads = 16;
             }
         }
-                
+                       
         //
         // Acquire the disk lock
         //



More information about the Ros-diffs mailing list