Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-4]: src/sbin/fdisk Pull up revision 1.40 (requested by fvdl):
details: https://anonhg.NetBSD.org/src/rev/eb247ead6245
branches: netbsd-1-4
changeset: 470629:eb247ead6245
user: he <he%NetBSD.org@localhost>
date: Thu Jun 01 17:36:12 2000 +0000
description:
Pull up revision 1.40 (requested by fvdl):
Fix a booting problem when int13 extensions are used (> 8GB),
and CHS values in MBRs were written from sysinst or fdisk that
some BIOSes (Adaptec SCSI BIOS 2.20 in particular) didn't like.
diffstat:
sbin/fdisk/fdisk.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diffs (39 lines):
diff -r 468135fbab3c -r eb247ead6245 sbin/fdisk/fdisk.c
--- a/sbin/fdisk/fdisk.c Thu Jun 01 17:35:20 2000 +0000
+++ b/sbin/fdisk/fdisk.c Thu Jun 01 17:36:12 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdisk.c,v 1.33.2.3 1999/06/22 14:26:32 perry Exp $ */
+/* $NetBSD: fdisk.c,v 1.33.2.4 2000/06/01 17:36:12 he Exp $ */
/*
* Mach Operating System
@@ -29,7 +29,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: fdisk.c,v 1.33.2.3 1999/06/22 14:26:32 perry Exp $");
+__RCSID("$NetBSD: fdisk.c,v 1.33.2.4 2000/06/01 17:36:12 he Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -1179,6 +1179,11 @@
unsigned char *cylinderp, *headp, *sectorp;
{
int cylinder, head;
+ int biosmaxsec;
+
+ biosmaxsec = dos_cylinders * dos_heads * dos_sectors - 1;
+ if (sector > biosmaxsec)
+ sector = biosmaxsec;
cylinder = sector / dos_cylindersectors;
@@ -1187,8 +1192,6 @@
head = sector / dos_sectors;
sector -= head * dos_sectors;
- if (cylinder >= MAXCYL)
- cylinder = MAXCYL - 1;
*cylinderp = DOSCYL(cylinder);
*headp = head;
*sectorp = DOSSECT(sector + 1, cylinder);
Home |
Main Index |
Thread Index |
Old Index