From: H. Peter Anvin Date: Wed, 30 Jun 2010 16:53:46 +0000 (-0700) Subject: core, diskio: put the error code in dprintf and printable messages X-Git-Tag: syslinux-4.01-pre1~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d4516833b61c52809048edcdfc25d5e610270b64;p=platform%2Fupstream%2Fsyslinux.git 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 --- diff --git a/core/fs/diskio.c b/core/fs/diskio.c index 176c5bc..b186af6 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 */