From 8d1b05a6e9371d9d069481e2f754854ebaffde8e Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Fri, 18 Apr 1997 01:28:03 +0000 Subject: no more 60k limit! no more explicit real<-->prot switching! fix 2.88 floppy drives..... kbd fixes coming soon! test it! --- sys/arch/i386/stand/libsa/biosdev.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'sys/arch/i386/stand/libsa/biosdev.c') 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; -- cgit v1.2.3