@@ -171,7 +171,6 @@ static VOID DiskError(PCSTR ErrorString, ULONG ErrorCode)
171171 ErrorString , ErrorCode , DiskGetErrorCodeString (ErrorCode ));
172172
173173 ERR ("%s\n" , ErrorCodeString );
174-
175174 UiMessageBox (ErrorCodeString );
176175}
177176
@@ -276,14 +275,18 @@ DiskInt13ExtensionsSupported(IN UCHAR DriveNumber)
276275 return FALSE;
277276 }
278277
278+ #if DBG
279+ TRACE ("Drive 0x%x: INT 13h Extended version: 0x%02x, API bitmap: 0x%04x\n" ,
280+ DriveNumber , RegsOut .b .ah , RegsOut .w .cx );
281+ #endif
279282 if (!(RegsOut .w .cx & 0x0001 ))
280283 {
281284 /*
282285 * CX = API subset support bitmap.
283286 * Bit 0, extended disk access functions (AH=42h-44h,47h,48h) supported.
284287 */
285- WARN ("Suspicious API subset support bitmap 0x%x on device 0x%lx \n" ,
286- RegsOut .w .cx , DriveNumber );
288+ WARN ("Drive 0x%x: Suspicious API subset support bitmap 0x%04x \n" ,
289+ DriveNumber , RegsOut .w .cx );
287290 return FALSE;
288291 }
289292
@@ -333,37 +336,37 @@ DiskGetExtendedDriveParameters(
333336 RtlCopyMemory (Buffer , Ptr , BufferSize );
334337
335338#if DBG
336- TRACE ("size of buffer: %x\n" , Ptr [0 ]);
337- TRACE ("information flags: %x\n" , Ptr [1 ]);
338- TRACE ("number of physical cylinders on drive: %u\n" , * (PULONG )& Ptr [2 ]);
339- TRACE ("number of physical heads on drive: %u\n" , * (PULONG )& Ptr [4 ]);
340- TRACE ("number of physical sectors per track: %u\n" , * (PULONG )& Ptr [6 ]);
341- TRACE ("total number of sectors on drive: %I64u\n" , * (PULONGLONG )& Ptr [8 ]);
342- TRACE ("bytes per sector: %u\n" , Ptr [12 ]);
339+ TRACE ("Size of buffer: 0x %x\n" , Ptr [0 ]);
340+ TRACE ("Information flags: 0x %x\n" , Ptr [1 ]);
341+ TRACE ("Number of physical cylinders on drive: %u\n" , * (PULONG )& Ptr [2 ]);
342+ TRACE ("Number of physical heads on drive: %u\n" , * (PULONG )& Ptr [4 ]);
343+ TRACE ("Number of physical sectors per track: %u\n" , * (PULONG )& Ptr [6 ]);
344+ TRACE ("Total number of sectors on drive: %I64u\n" , * (PULONGLONG )& Ptr [8 ]);
345+ TRACE ("Bytes per sector: %u\n" , Ptr [12 ]);
343346 if (Ptr [0 ] >= 0x1e )
344347 {
345348 // Ptr[13]: offset, Ptr[14]: segment
346349 TRACE ("EDD configuration parameters: %x:%x\n" , Ptr [14 ], Ptr [13 ]);
347350 if (Ptr [13 ] != 0xffff && Ptr [14 ] != 0xffff )
348351 {
349352 PUCHAR SpecPtr = (PUCHAR )(ULONG_PTR )((Ptr [14 ] << 4 ) + Ptr [13 ]);
350- TRACE ("SpecPtr: %x\n" , SpecPtr );
351- TRACE ("physical I/O port base address: %x\n" , * (PUSHORT )& SpecPtr [0 ]);
352- TRACE ("disk -drive control port address: %x\n" , * (PUSHORT )& SpecPtr [2 ]);
353- TRACE ("drive flags: %x\n" , SpecPtr [4 ]);
354- TRACE ("proprietary information : %x\n" , SpecPtr [5 ]);
353+ TRACE ("SpecPtr: 0x %x\n" , SpecPtr );
354+ TRACE ("Physical I/O port base address: 0x %x\n" , * (PUSHORT )& SpecPtr [0 ]);
355+ TRACE ("Disk -drive control port address: 0x %x\n" , * (PUSHORT )& SpecPtr [2 ]);
356+ TRACE ("Head register upper nibble: 0x %x\n" , SpecPtr [4 ]);
357+ TRACE ("BIOS Vendor-specific : 0x %x\n" , SpecPtr [5 ]);
355358 TRACE ("IRQ for drive: %u\n" , SpecPtr [6 ]);
356- TRACE ("sector count for multi-sector transfers: %u\n" , SpecPtr [7 ]);
357- TRACE ("DMA control: %x\n" , SpecPtr [8 ]);
358- TRACE ("programmed I/O control: %x\n" , SpecPtr [9 ]);
359- TRACE ("drive options: %x\n" , * (PUSHORT )& SpecPtr [10 ]);
359+ TRACE ("Sector count for multi-sector transfers: %u\n" , SpecPtr [7 ]);
360+ TRACE ("DMA control: 0x %x\n" , SpecPtr [8 ]);
361+ TRACE ("Programmed I/O control: 0x %x\n" , SpecPtr [9 ]);
362+ TRACE ("Drive options: 0x %x\n" , * (PUSHORT )& SpecPtr [10 ]);
360363 }
361364 }
362365 if (Ptr [0 ] >= 0x42 )
363366 {
364- TRACE ("signature : %x\n" , Ptr [15 ]);
367+ TRACE ("Signature : 0x %x\n" , Ptr [15 ]);
365368 }
366- #endif
369+ #endif // DBG
367370
368371 return TRUE;
369372}
@@ -393,11 +396,13 @@ InitDriveGeometry(
393396 "Cylinders : 0x%x\n"
394397 "Heads : 0x%x\n"
395398 "Sects/Track: 0x%x\n"
399+ "Total Sects: 0x%llx\n"
396400 "Bytes/Sect : 0x%x\n" ,
397401 DriveNumber ,
398402 DiskDrive -> ExtGeometry .Cylinders ,
399403 DiskDrive -> ExtGeometry .Heads ,
400404 DiskDrive -> ExtGeometry .SectorsPerTrack ,
405+ DiskDrive -> ExtGeometry .Sectors ,
401406 DiskDrive -> ExtGeometry .BytesPerSector );
402407 }
403408
@@ -444,7 +449,7 @@ InitDriveGeometry(
444449 DiskDrive -> Geometry .Cylinders = Cylinders ;
445450 DiskDrive -> Geometry .Heads = RegsOut .b .dh + 1 ;
446451 DiskDrive -> Geometry .SectorsPerTrack = RegsOut .b .cl & 0x3F ;
447- DiskDrive -> Geometry .BytesPerSector = 512 ; /* Just assume 512 bytes per sector */
452+ DiskDrive -> Geometry .BytesPerSector = 512 ; /* Just assume 512 bytes per sector */
448453
449454 DiskDrive -> Geometry .Sectors = (ULONGLONG )DiskDrive -> Geometry .Cylinders *
450455 DiskDrive -> Geometry .Heads *
@@ -453,12 +458,14 @@ InitDriveGeometry(
453458 TRACE ("Regular Int13h(0x%x) returned:\n"
454459 "Cylinders : 0x%x\n"
455460 "Heads : 0x%x\n"
456- "Sects/Track: 0x%x (original 0x%x)\n"
461+ "Sects/Track: 0x%x\n"
462+ "Total Sects: 0x%llx\n"
457463 "Bytes/Sect : 0x%x\n" ,
458464 DriveNumber ,
459465 DiskDrive -> Geometry .Cylinders ,
460466 DiskDrive -> Geometry .Heads ,
461- DiskDrive -> Geometry .SectorsPerTrack , RegsOut .b .cl ,
467+ DiskDrive -> Geometry .SectorsPerTrack ,
468+ DiskDrive -> Geometry .Sectors ,
462469 DiskDrive -> Geometry .BytesPerSector );
463470
464471 return Success ;
@@ -616,7 +623,7 @@ PcDiskReadLogicalSectorsLBA(
616623
617624 /* If we get here then the read failed */
618625 DiskError ("Disk Read Failed in LBA mode" , RegsOut .b .ah );
619- ERR ("Disk Read Failed in LBA mode: %x (%s) (DriveNumber: 0x%x SectorNumber: %I64d SectorCount: %d )\n" ,
626+ ERR ("Disk Read Failed in LBA mode: %x (%s) (DriveNumber: 0x%x SectorNumber: %I64u SectorCount: %u )\n" ,
620627 RegsOut .b .ah , DiskGetErrorCodeString (RegsOut .b .ah ),
621628 DriveNumber , SectorNumber , SectorCount );
622629
@@ -719,7 +726,7 @@ PcDiskReadLogicalSectorsCHS(
719726 if (RetryCount >= 3 )
720727 {
721728 DiskError ("Disk Read Failed in CHS mode, after retrying 3 times" , RegsOut .b .ah );
722- ERR ("Disk Read Failed in CHS mode, after retrying 3 times: %x (%s) (DriveNumber: 0x%x SectorNumber: %I64d SectorCount: %d )\n" ,
729+ ERR ("Disk Read Failed in CHS mode, after retrying 3 times: %x (%s) (DriveNumber: 0x%x SectorNumber: %I64u SectorCount: %u )\n" ,
723730 RegsOut .b .ah , DiskGetErrorCodeString (RegsOut .b .ah ),
724731 DriveNumber , SectorNumber , SectorCount );
725732 return FALSE;
@@ -750,7 +757,7 @@ PcDiskReadLogicalSectors(
750757{
751758 PPC_DISK_DRIVE DiskDrive ;
752759
753- TRACE ("PcDiskReadLogicalSectors() DriveNumber: 0x%x SectorNumber: %I64d SectorCount: %d Buffer: 0x%x\n" ,
760+ TRACE ("PcDiskReadLogicalSectors() DriveNumber: 0x%x SectorNumber: %I64u SectorCount: %u Buffer: 0x%x\n" ,
754761 DriveNumber , SectorNumber , SectorCount , Buffer );
755762
756763 /* 16-bit BIOS addressing limitation */
0 commit comments