default: #ifdef	BIOS_DEBUG if (debug) { for (p = bd_errors; p < &bd_errors[bd_nents] && p->bd_id != error; p++); printf("\nBIOS error %x (%s)\n", p->bd_id, p->msg); } #endif continue;
biosstrategy(void *devdata, int rw,	daddr_t blk, size_t size, void *buf, size_t *rsize){	u_int8_t error = 0;	register struct biosdisk *bd = (struct biosdisk *)devdata;	register size_t i, nsect, n;	register const struct bd_error *p = bd_errors;	nsect = (size + DEV_BSIZE-1) / DEV_BSIZE;	if (rsize != NULL)		blk += bd->disklabel.			d_partitions[B_PARTITION(bd->bsddev)].p_offset;#ifdef	BIOS_DEBUG	if (debug)		printf("biosstrategy(%p,%s,%u,%u,%p,%p), dev=%x:%x\nbiosread:",		       bd, (rw==F_READ?"reading":"writing"), blk, size,		       buf, rsize, bd->biosdev, bd->bsddev);#endif	for (i = 0; error == 0 && i < nsect;	     i += n, blk += n, buf += n * DEV_BSIZE) {		register int	cyl, hd, sect, j;		void *bb;		btochs(blk, cyl, hd, sect, 			BIOSNHEADS(bd->dinfo), BIOSNSECTS(bd->dinfo));		if ((sect + (nsect - i)) >= BIOSNSECTS(bd->dinfo))			n = BIOSNSECTS(bd->dinfo) - sect;		else			n = nsect - i;				/* use a bounce buffer to not to cross 64k DMA boundary */		if ((((u_int32_t)buf) & ~0xffff) !=		    (((u_int32_t)buf + n * DEV_BSIZE) & ~0xffff)) {			bb = alloc(n * DEV_BSIZE);			if (rw != F_READ)				bcopy (buf, bb, n * DEV_BSIZE);		} else			bb = buf;#ifdef	BIOS_DEBUG		if (debug)			printf(" (%d,%d,%d,%d)@%p", cyl, hd, sect, n, bb);#endif		for (error = 1, j = 5; error && j--;) {			error = (rw == F_READ)?				  biosread (bd->biosdev, cyl, hd, sect, n, bb)				: bioswrite(bd->biosdev, cyl, hd, sect, n, bb);			switch (error) {			case 0x06:	/* disk changed */				printf ("disk changed\n");			default:				continue;			case 0x11:	/* ECC corrected */				error = 0;				break;			}		}		if (bb != buf) {			if (rw == F_READ)				bcopy (bb, buf, n * DEV_BSIZE);			free (bb, n * DEV_BSIZE);		}	}#ifdef	BIOS_DEBUG	if (debug) {		if (error != 0) {			for (p = bd_errors; p < &bd_errors[bd_nents] &&			     p->bd_id != error; p++);			printf("=%x(%s)", p->bd_id, p->msg);		}		putchar('\n');	}#endif	if (rsize != NULL)		*rsize = i * DEV_BSIZE;	return p->unix_id;}