summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-06-30 09:53:46 -0700
committerH. Peter Anvin <hpa@zytor.com>2010-07-01 07:13:09 -0700
commitd4516833b61c52809048edcdfc25d5e610270b64 (patch)
tree0253d0ed374569807c46769c6a8541f205f25010 /core
parent42b6e55bce2915c8ba3eba0b4f664add19f0504e (diff)
downloadsyslinux-d4516833b61c52809048edcdfc25d5e610270b64.tar.gz
core, diskio: put the error code in dprintf and printable messages
When we print an error message to the screen, include the error number. Furthermore, dprintf it on retries. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'core')
-rw-r--r--core/fs/diskio.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/fs/diskio.c b/core/fs/diskio.c
index 176c5bcc..b186af64 100644
--- a/core/fs/diskio.c
+++ b/core/fs/diskio.c
@@ -79,6 +79,8 @@ static int chs_rdwr_sectors(struct disk *disk, void *buf,
if (retry--)
continue;
+ dprintf("CHS: error AX = %04x\n", oreg.eax.w[0]);
+
/* For any starting value, this will always end with ..., 1, 0 */
chunk >>= 1;
if (chunk) {
@@ -87,7 +89,8 @@ static int chs_rdwr_sectors(struct disk *disk, void *buf,
ireg.eax.b[0] = chunk;
continue;
} else {
- printf("CHS: Error %s sector %llu (%u/%u/%u)\n",
+ printf("CHS: Error %04x %s sector %llu (%u/%u/%u)\n",
+ oreg.eax.w[0],
is_write ? "writing" : "reading",
lba, c, h, s+1);
}
@@ -179,6 +182,8 @@ static int edd_rdwr_sectors(struct disk *disk, void *buf,
if (retry--)
continue;
+ dprintf("EDD: error AX = %04x\n", oreg.eax.w[0]);
+
/* For any starting value, this will always end with ..., 1, 0 */
chunk >>= 1;
if (chunk) {
@@ -188,7 +193,8 @@ static int edd_rdwr_sectors(struct disk *disk, void *buf,
}
/*** XXX: Consider falling back to CHS here?! ***/
- printf("EDD: Error %s sector %llu\n",
+ printf("EDD: Error %04x %s sector %llu\n",
+ oreg.eax.w[0],
is_write ? "writing" : "reading",
lba);
return done; /* Failure */