Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/utils/sysinst When converting from relsecs to chs, i...



details:   https://anonhg.NetBSD.org/src/rev/86e4d3a56bdf
branches:  trunk
changeset: 486710:86e4d3a56bdf
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Sat May 27 18:41:36 2000 +0000

description:
When converting from relsecs to chs, if the value exceeds the maxmimum
that can be specified with CHS, truncate it to the maximum values that
the BIOS provided, not 1023*255*63. Some BIOSs get awfully cranky when
you do that.

diffstat:

 distrib/utils/sysinst/mbr.c |  11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diffs (28 lines):

diff -r add4ebfb7207 -r 86e4d3a56bdf distrib/utils/sysinst/mbr.c
--- a/distrib/utils/sysinst/mbr.c       Sat May 27 18:24:50 2000 +0000
+++ b/distrib/utils/sysinst/mbr.c       Sat May 27 18:41:36 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mbr.c,v 1.21 2000/03/14 22:42:48 fvdl Exp $ */
+/*     $NetBSD: mbr.c,v 1.22 2000/05/27 18:41:36 fvdl Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -505,14 +505,13 @@
 {
        unsigned int tcyl, temp, thead, tsec;
 
+       temp = cyl * head * sec - 1;
+       if (relsecs >= temp)
+               relsecs = temp;
+
        temp = head * sec;
        tcyl = relsecs / temp;
 
-       if (tcyl >= 1024) {
-               *cylp = *headp = *secp = 0xff;
-               return;
-       }
-
        relsecs %= temp;
        thead = relsecs / sec;
 



Home | Main Index | Thread Index | Old Index