summaryrefslogtreecommitdiffstats
path: root/sys/i386/boot/biosboot/disk.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-06-23 01:42:42 +0000
committerache <ache@FreeBSD.org>1995-06-23 01:42:42 +0000
commit47923b93de901730ae213bf03f7ab90884c03ee0 (patch)
tree2884a27241cc268d3c6a8e96a2c0d1a3a3900c4f /sys/i386/boot/biosboot/disk.c
parent215845d698e3fd79f01c55d8f15b61d453eeae0d (diff)
downloadFreeBSD-src-47923b93de901730ae213bf03f7ab90884c03ee0.zip
FreeBSD-src-47923b93de901730ae213bf03f7ab90884c03ee0.tar.gz
1) Enable boot from root partition which end > cyl 1023, it isn't criminal
2) Produce hard error when Bread attempts to read cyl >1023 Reviewed by: bde
Diffstat (limited to 'sys/i386/boot/biosboot/disk.c')
-rw-r--r--sys/i386/boot/biosboot/disk.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/i386/boot/biosboot/disk.c b/sys/i386/boot/biosboot/disk.c
index 7a605f4..e6f3e5d 100644
--- a/sys/i386/boot/biosboot/disk.c
+++ b/sys/i386/boot/biosboot/disk.c
@@ -24,7 +24,7 @@
* the rights to redistribute these changes.
*
* from: Mach, Revision 2.2 92/04/04 11:35:49 rpd
- * $Id: disk.c,v 1.12 1995/05/21 03:27:13 phk Exp $
+ * $Id: disk.c,v 1.13 1995/05/30 07:58:31 rgrimes Exp $
*/
/*
@@ -86,7 +86,9 @@ devopen(void)
struct disklabel *dl;
int dosdev = inode.i_dev;
int i, sector = 0, di;
+#if 0 /* Save space, already have hard error for cyl > 1023 in Bread */
u_long bend;
+#endif
di = get_diskinfo(dosdev);
spc = (spt = SPT(di)) * HEADS(di);
@@ -134,12 +136,11 @@ devopen(void)
/* This is a good idea for all disks */
bsize = dl->d_partitions[part].p_size;
+#if 0 /* Save space, already have hard error for cyl > 1023 in Bread */
bend = boff + bsize - 1 ;
- if (bend / spc > 1024) {
- printf("partition is out of reach from the bios\n");
- return 1;
- }
-
+ if (bend / spc >= 1024) {
+ printf("boot partition end >= cyl 1024, BIOS can't load kernel stored beyond this limit\n");
+#endif
#ifdef DO_BAD144
do_bad144 = 0;
if (dl->d_flags & D_BADSECT) {
@@ -212,6 +213,10 @@ Bread(int dosdev, int sector)
int cyl, head, sec, nsec;
cyl = sector/spc;
+ if (cyl > 1023) {
+ printf("Error: C:%d > 1023 (BIOS limit)\n", cyl);
+ for(;;); /* loop forever */
+ }
head = (sector % spc) / spt;
sec = sector % spt;
nsec = spt - sec;
OpenPOWER on IntegriCloud