mirror of https://github.com/ipxe/ipxe.git
[int13] Improve debugging messages
parent
f7d2168c8e
commit
b0c818d7b5
|
@ -98,6 +98,7 @@ static int int13_rw_sectors ( struct int13_drive *drive,
|
||||||
unsigned long lba;
|
unsigned long lba;
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
userptr_t buffer;
|
userptr_t buffer;
|
||||||
|
int rc;
|
||||||
|
|
||||||
/* Validate blocksize */
|
/* Validate blocksize */
|
||||||
if ( blockdev->blksize != INT13_BLKSIZE ) {
|
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 );
|
head, sector, lba, ix86->segs.es, ix86->regs.bx, count );
|
||||||
|
|
||||||
/* Read from / write to block device */
|
/* 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 -INT13_STATUS_READ_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -248,6 +251,7 @@ static int int13_extended_rw ( struct int13_drive *drive,
|
||||||
uint64_t lba;
|
uint64_t lba;
|
||||||
unsigned long count;
|
unsigned long count;
|
||||||
userptr_t buffer;
|
userptr_t buffer;
|
||||||
|
int rc;
|
||||||
|
|
||||||
/* Read parameters from disk address structure */
|
/* Read parameters from disk address structure */
|
||||||
copy_from_real ( &addr, ix86->segs.ds, ix86->regs.si, sizeof ( addr ));
|
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 );
|
addr.buffer.segment, addr.buffer.offset, count );
|
||||||
|
|
||||||
/* Read from / write to block device */
|
/* 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 -INT13_STATUS_READ_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -387,7 +393,7 @@ static __asmcall void int13 ( struct i386_all_regs *ix86 ) {
|
||||||
/* Negative status indicates an error */
|
/* Negative status indicates an error */
|
||||||
if ( status < 0 ) {
|
if ( status < 0 ) {
|
||||||
status = -status;
|
status = -status;
|
||||||
DBG ( "INT13 failed with status %x\n", status );
|
DBG ( "INT 13 returning failure status %x\n", status );
|
||||||
} else {
|
} else {
|
||||||
ix86->flags &= ~CF;
|
ix86->flags &= ~CF;
|
||||||
}
|
}
|
||||||
|
@ -652,7 +658,8 @@ int int13_boot ( unsigned int drive ) {
|
||||||
|
|
||||||
/* Jump to boot sector */
|
/* Jump to boot sector */
|
||||||
if ( ( rc = call_bootsector ( 0x0, 0x7c00, drive ) ) != 0 ) {
|
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;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue