.long 0
_biosdisk_retrycount:
.byte 0
+_biosdisk_error_code:
+ .byte 0
EXTERN(_BiosInt13Read)
.code32
_biosdisk_error:
+ movb %ah,_biosdisk_error_code// Save the error code
+
cmpb $0x11,%ah // Check and see if it was a corrected ECC error
je _biosdisk_done // If so then the data is still good, if not fail
_int13_extended_error:
+ movb %ah,_biosdisk_error_code // Save the error code
+
cmpb $0x11,%ah // Check and see if it was a corrected ECC error
je _int13_extended_done // If so then the data is still good, if not fail
pop %ebp
ret
+/*
+ * ULONG BiosInt13GetLastErrorCode(VOID);
+ */
+EXTERN(_BiosInt13GetLastErrorCode)
+ .code32
+
+ movzbl _biosdisk_error_code,%eax // Get return value
+
+ ret
+
/*
* int getyear(void);
*/
BOOL BiosInt13Read(ULONG Drive, ULONG Head, ULONG Track, ULONG Sector, ULONG SectorCount, PVOID Buffer); // Implemented in asmcode.S
BOOL BiosInt13ReadExtended(ULONG Drive, ULONG Sector, ULONG SectorCount, PVOID Buffer); // Implemented in asmcode.S
BOOL BiosInt13ExtensionsSupported(ULONG Drive);
+ULONG BiosInt13GetLastErrorCode(VOID);
void stop_floppy(void); // Implemented in asmcode.S
int get_heads(int drive); // Implemented in asmcode.S
VOID DiskError(PUCHAR ErrorString)
{
- DbgPrint((DPRINT_DISK, "%s\n", ErrorString));
+ UCHAR ErrorCodeString[80];
+
+ sprintf(ErrorCodeString, "%s\nError Code: 0x%x", ErrorString, BiosInt13GetLastErrorCode());
+
+ DbgPrint((DPRINT_DISK, "%s\n", ErrorCodeString));
if (UserInterfaceUp)
{
- MessageBox(ErrorString);
+ MessageBox(ErrorCodeString);
}
else
{
- printf("%s", ErrorString);
+ printf("%s", ErrorCodeString);
printf("\nPress any key\n");
getch();
}