summaryrefslogtreecommitdiff
path: root/sys/arch/i386/stand/libsa/biosdev.c
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1997-04-18 01:28:03 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1997-04-18 01:28:03 +0000
commit8d1b05a6e9371d9d069481e2f754854ebaffde8e (patch)
tree354f5d547ab51a086acb6a3873e7717edcb24688 /sys/arch/i386/stand/libsa/biosdev.c
parente14b75bf16e5c8203eb2f5117f77b9e45e1d9556 (diff)
no more 60k limit!
no more explicit real<-->prot switching! fix 2.88 floppy drives..... kbd fixes coming soon! test it!
Diffstat (limited to 'sys/arch/i386/stand/libsa/biosdev.c')
-rw-r--r--sys/arch/i386/stand/libsa/biosdev.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/arch/i386/stand/libsa/biosdev.c b/sys/arch/i386/stand/libsa/biosdev.c
index 696a37611d8..e6ee0edd8c7 100644
--- a/sys/arch/i386/stand/libsa/biosdev.c
+++ b/sys/arch/i386/stand/libsa/biosdev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: biosdev.c,v 1.8 1997/04/17 19:03:20 weingart Exp $ */
+/* $OpenBSD: biosdev.c,v 1.9 1997/04/18 01:28:01 mickey Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -263,7 +263,7 @@ biosstrategy(void *devdata, int rw,
{
u_int8_t error = 0;
register struct biosdisk *bd = (struct biosdisk *)devdata;
- register size_t i, nsect, n;
+ register size_t i, nsect, n, spt;
register const struct bd_error *p = bd_errors;
nsect = (size + DEV_BSIZE-1) / DEV_BSIZE;
@@ -278,15 +278,20 @@ biosstrategy(void *devdata, int rw,
buf, rsize, bd->biosdev, bd->bsddev);
#endif
+ /* handle floppies w/ different from drive geometry */
+ if (!(bd->biosdev & 0x80))
+ spt = bd->disklabel.d_nsectors;
+ else
+ spt = BIOSNSECTS(bd->dinfo);
+
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;
+ btochs(blk, cyl, hd, sect, BIOSNHEADS(bd->dinfo), spt);
+ if ((sect + (nsect - i)) >= spt)
+ n = spt - sect;
else
n = nsect - i;