loader: biosdisk should report IO error from INT13

We should be more verbose about read errors from biosdisk, except filter
out the floppy controller errors, which apparently are resulting from
read attempt from device without the media present.

Reviewed by:	allanjude
Approved by:	allanjude (mentor)
Differential Revision:	https://reviews.freebsd.org/D10032
This commit is contained in:
Toomas Soome 2017-03-16 21:34:14 +00:00
parent 6c10e0ba0b
commit 429528f376
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=315427

View File

@ -559,7 +559,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size,
{
struct disk_devdesc *dev = (struct disk_devdesc *)devdata;
uint64_t disk_blocks;
int blks;
int blks, rc;
#ifdef BD_SUPPORT_FRAGS /* XXX: sector size */
char fragbuf[BIOSDISK_SECSIZE];
size_t fragsize;
@ -616,8 +616,12 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size,
case F_READ:
DEBUG("read %d from %lld to %p", blks, dblk, buf);
if (blks && bd_read(dev, dblk, blks, buf)) {
DEBUG("read error");
if (blks && (rc = bd_read(dev, dblk, blks, buf))) {
/* Filter out floppy controller errors */
if (BD(dev).bd_flags != BD_FLOPPY || rc != 0x20) {
printf("read %d from %lld to %p, error: 0x%x", blks, dblk,
buf, rc);
}
return (EIO);
}
#ifdef BD_SUPPORT_FRAGS /* XXX: sector size */
@ -676,7 +680,9 @@ bd_edd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest,
v86.ds = VTOPSEG(&packet);
v86.esi = VTOPOFF(&packet);
v86int();
return (V86_CY(v86.efl));
if (V86_CY(v86.efl))
return (v86.eax >> 8);
return (0);
}
static int
@ -710,7 +716,9 @@ bd_chs_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest,
v86.es = VTOPSEG(dest);
v86.ebx = VTOPOFF(dest);
v86int();
return (V86_CY(v86.efl));
if (V86_CY(v86.efl))
return (v86.eax >> 8);
return (0);
}
static int
@ -797,7 +805,7 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, int write)
DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x,
dblk, p, VTOP(p), result ? "failed" : "ok");
if (result) {
return(-1);
return (result);
}
if (!write && bbuf != NULL)
bcopy(bbuf, p, x * BD(dev).bd_sectorsize);