summaryrefslogtreecommitdiffstats
path: root/src/arch
diff options
context:
space:
mode:
authorMichael Brown2009-03-31 07:26:51 +0200
committerMichael Brown2009-03-31 07:26:51 +0200
commitb0c818d7b57202ee937e6de2efb8cedcc70b5e96 (patch)
treed5b663047ab68f9b8d607aa5dd2dd35ae4cca352 /src/arch
parent[segment] Add "Requested memory not available" error message (diff)
downloadipxe-b0c818d7b57202ee937e6de2efb8cedcc70b5e96.tar.gz
ipxe-b0c818d7b57202ee937e6de2efb8cedcc70b5e96.tar.xz
ipxe-b0c818d7b57202ee937e6de2efb8cedcc70b5e96.zip
[int13] Improve debugging messages
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/i386/interface/pcbios/int13.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/arch/i386/interface/pcbios/int13.c b/src/arch/i386/interface/pcbios/int13.c
index 2e9de5cb..04f9cdf5 100644
--- a/src/arch/i386/interface/pcbios/int13.c
+++ b/src/arch/i386/interface/pcbios/int13.c
@@ -98,6 +98,7 @@ static int int13_rw_sectors ( struct int13_drive *drive,
unsigned long lba;
unsigned int count;
userptr_t buffer;
+ int rc;
/* Validate blocksize */
if ( blockdev->blksize != INT13_BLKSIZE ) {
@@ -122,8 +123,10 @@ static int int13_rw_sectors ( struct int13_drive *drive,
head, sector, lba, ix86->segs.es, ix86->regs.bx, count );
/* Read from / write to block device */
- if ( io ( blockdev, lba, count, buffer ) != 0 )
+ if ( ( rc = io ( blockdev, lba, count, buffer ) ) != 0 ) {
+ DBG ( "INT 13 failed: %s\n", strerror ( rc ) );
return -INT13_STATUS_READ_ERROR;
+ }
return 0;
}
@@ -248,6 +251,7 @@ static int int13_extended_rw ( struct int13_drive *drive,
uint64_t lba;
unsigned long count;
userptr_t buffer;
+ int rc;
/* Read parameters from disk address structure */
copy_from_real ( &addr, ix86->segs.ds, ix86->regs.si, sizeof ( addr ));
@@ -259,8 +263,10 @@ static int int13_extended_rw ( struct int13_drive *drive,
addr.buffer.segment, addr.buffer.offset, count );
/* Read from / write to block device */
- if ( io ( blockdev, lba, count, buffer ) != 0 )
+ if ( ( rc = io ( blockdev, lba, count, buffer ) ) != 0 ) {
+ DBG ( "INT 13 failed: %s\n", strerror ( rc ) );
return -INT13_STATUS_READ_ERROR;
+ }
return 0;
}
@@ -387,7 +393,7 @@ static __asmcall void int13 ( struct i386_all_regs *ix86 ) {
/* Negative status indicates an error */
if ( status < 0 ) {
status = -status;
- DBG ( "INT13 failed with status %x\n", status );
+ DBG ( "INT 13 returning failure status %x\n", status );
} else {
ix86->flags &= ~CF;
}
@@ -652,7 +658,8 @@ int int13_boot ( unsigned int drive ) {
/* Jump to boot sector */
if ( ( rc = call_bootsector ( 0x0, 0x7c00, drive ) ) != 0 ) {
- DBG ( "INT 13 drive %02x boot returned\n", drive );
+ DBG ( "INT 13 drive %02x boot returned: %s\n",
+ drive, strerror ( rc ) );
return rc;
}