Having a hard limit to ensure that OpenBSD will be able to boot on
i386 and amd64 has smoked out at least some people who were
successfully booting past that limit. So back off the error to a
warning for now.

ok? (Only compile tested on amd64 so far)

.... Ken

Index: amd64/stand/installboot/installboot.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/stand/installboot/installboot.c,v
retrieving revision 1.22
diff -u -p -r1.22 installboot.c
--- amd64/stand/installboot/installboot.c       5 Jul 2011 18:34:10 -0000       
1.22
+++ amd64/stand/installboot/installboot.c       18 Jul 2011 22:35:26 -0000
@@ -243,12 +243,12 @@ write_bootblocks(int devfd, struct diskl
                        errx(1, "no OpenBSD partition");
        }
 
-       if (start + (protosize / dl->d_secsize) > BOOTBIOS_MAXSEC)
-               errx(1, "invalid location: all of /boot must be < sector %u.",
-                   BOOTBIOS_MAXSEC);
-
        if (verbose)
                fprintf(stderr, "/boot will be written at sector %u\n", start);
+
+       if (start + (protosize / dl->d_secsize) > BOOTBIOS_MAXSEC)
+               warnx("/boot extends beyond sector %u. OpenBSD may not boot.",
+                   BOOTBIOS_MAXSEC);
 
        if (!nowrite) {
                if (lseek(devfd, (off_t)start * dl->d_secsize, SEEK_SET) < 0)
Index: amd64/stand/libsa/biosdev.c
===================================================================
RCS file: /cvs/src/sys/arch/amd64/stand/libsa/biosdev.c,v
retrieving revision 1.15
diff -u -p -r1.15 biosdev.c
--- amd64/stand/libsa/biosdev.c 17 Mar 2011 12:53:44 -0000      1.15
+++ amd64/stand/libsa/biosdev.c 18 Jul 2011 22:35:26 -0000
@@ -216,10 +216,6 @@ EDD_rw(int rw, int dev, u_int32_t daddr,
        int rv;
        volatile static struct EDD_CB cb;
 
-       /* Some (most?) BIOSen get confused by i/o above 2 ^ 28 - 1 sector. */
-       if ((daddr + nblk) > BOOTBIOS_MAXSEC)
-               return (1); /* Invalid function/parameter. */
-
        /* Zero out reserved stuff */
        cb.edd_res1 = 0;
        cb.edd_res2 = 0;
Index: i386/stand/installboot/installboot.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/stand/installboot/installboot.c,v
retrieving revision 1.65
diff -u -p -r1.65 installboot.c
--- i386/stand/installboot/installboot.c        5 Jul 2011 18:34:10 -0000       
1.65
+++ i386/stand/installboot/installboot.c        18 Jul 2011 22:35:26 -0000
@@ -239,12 +239,12 @@ write_bootblocks(int devfd, struct diskl
                        errx(1, "no OpenBSD partition");
        }
 
-       if (start + (protosize / dl->d_secsize) > BOOTBIOS_MAXSEC)
-               errx(1, "invalid location: all of /boot must be < sector %u.",
-                   BOOTBIOS_MAXSEC);
-
        if (verbose)
                fprintf(stderr, "/boot will be written at sector %u\n", start);
+
+       if (start + (protosize / dl->d_secsize) > BOOTBIOS_MAXSEC)
+               warnx("/boot extends beyond sector %u. OpenBSD may not boot.",
+                   BOOTBIOS_MAXSEC);
 
        if (!nowrite) {
                if (lseek(devfd, (off_t)start * dl->d_secsize, SEEK_SET) < 0)
Index: i386/stand/libsa/biosdev.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/stand/libsa/biosdev.c,v
retrieving revision 1.83
diff -u -p -r1.83 biosdev.c
--- i386/stand/libsa/biosdev.c  17 Mar 2011 12:53:44 -0000      1.83
+++ i386/stand/libsa/biosdev.c  18 Jul 2011 22:35:26 -0000
@@ -217,10 +217,6 @@ EDD_rw(int rw, int dev, u_int32_t daddr,
        int rv;
        volatile static struct EDD_CB cb;
 
-       /* Some (most?) BIOSen get confused by i/o above 2 ^ 28 - 1 sector. */
-       if ((daddr + nblk) > BOOTBIOS_MAXSEC)
-               return (1); /* Invalid function/parameter. */
-
        /* Zero out reserved stuff */
        cb.edd_res1 = 0;
        cb.edd_res2 = 0;

Reply via email to