summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-12-08 09:33:00 +0000
committerphk <phk@FreeBSD.org>1999-12-08 09:33:00 +0000
commit551bfa2f51cfd055117aec7f1a0f17294cfbc260 (patch)
tree50da86bbbf154ce5c4d4932b562730a10096f3ab /sys/boot
parent224ba89395ce157c152e89a1113bab7205c0dcf9 (diff)
downloadFreeBSD-src-551bfa2f51cfd055117aec7f1a0f17294cfbc260.zip
FreeBSD-src-551bfa2f51cfd055117aec7f1a0f17294cfbc260.tar.gz
Remove BAD144 support, it has already been disabled for some time.
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/alpha/libalpha/srmdisk.c1
-rw-r--r--sys/boot/arc/lib/arcdisk.c1
-rw-r--r--sys/boot/i386/libi386/biosdisk.c1
-rw-r--r--sys/boot/pc98/boot2/boot.c2
-rw-r--r--sys/boot/pc98/boot2/disk.c117
-rw-r--r--sys/boot/pc98/libpc98/biosdisk.c1
6 files changed, 2 insertions, 121 deletions
diff --git a/sys/boot/alpha/libalpha/srmdisk.c b/sys/boot/alpha/libalpha/srmdisk.c
index 9c2ce09..516bba4 100644
--- a/sys/boot/alpha/libalpha/srmdisk.c
+++ b/sys/boot/alpha/libalpha/srmdisk.c
@@ -35,7 +35,6 @@
* - NetBSD libi386/biosdisk.c
* - FreeBSD biosboot/disk.c
*
- * XXX Todo: add bad144 support.
*/
#include <stand.h>
diff --git a/sys/boot/arc/lib/arcdisk.c b/sys/boot/arc/lib/arcdisk.c
index 2b54854..4b5e2cb 100644
--- a/sys/boot/arc/lib/arcdisk.c
+++ b/sys/boot/arc/lib/arcdisk.c
@@ -35,7 +35,6 @@
* - NetBSD libi386/biosdisk.c
* - FreeBSD biosboot/disk.c
*
- * XXX Todo: add bad144 support.
*/
#include <stand.h>
diff --git a/sys/boot/i386/libi386/biosdisk.c b/sys/boot/i386/libi386/biosdisk.c
index 2b5ba09..c379cd6 100644
--- a/sys/boot/i386/libi386/biosdisk.c
+++ b/sys/boot/i386/libi386/biosdisk.c
@@ -34,7 +34,6 @@
* - NetBSD libi386/biosdisk.c
* - FreeBSD biosboot/disk.c
*
- * XXX Todo: add bad144 support.
*/
#include <stand.h>
diff --git a/sys/boot/pc98/boot2/boot.c b/sys/boot/pc98/boot2/boot.c
index 4dced19..9aad557 100644
--- a/sys/boot/pc98/boot2/boot.c
+++ b/sys/boot/pc98/boot2/boot.c
@@ -346,7 +346,7 @@ loadprog(void)
* because no str*() functions are available. The file has to be
* copied to &disklabel for userconfig. It can't be loaded there
* directly because the label is used late in readfile() in some
- * unusual cases, e.g., for bad144 handling.
+ * unusual cases.
*/
s = name;
t = kernel_config_namebuf;
diff --git a/sys/boot/pc98/boot2/disk.c b/sys/boot/pc98/boot2/disk.c
index f264117..8899ceb 100644
--- a/sys/boot/pc98/boot2/disk.c
+++ b/sys/boot/pc98/boot2/disk.c
@@ -42,9 +42,6 @@
*/
#include "boot.h"
-#ifdef DO_BAD144
-#include <sys/dkbad.h>
-#endif DO_BAD144
#include <sys/disklabel.h>
#include <sys/diskslice.h>
@@ -55,11 +52,6 @@
#define SPT(di) ((di)&0xff)
#define HEADS(di) (((di)>>8)&0xff)
-#ifdef DO_BAD144
-static struct dkbad dkb;
-static int do_bad144;
-static int bsize;
-#endif DO_BAD144
static int spt, spc;
@@ -79,7 +71,6 @@ static int ra_dev;
static int ra_end;
static int ra_first;
-static int badsect(int sector);
static char *Bread(int dosdev, int sector);
int
@@ -161,54 +152,6 @@ devopen(void)
#endif
-#ifdef DO_BAD144
- do_bad144 = 0;
- if (dl->d_flags & D_BADSECT) {
- /* this disk uses bad144 */
- int i;
- int dkbbnum;
- struct dkbad *dkbptr;
-
- /* find the first readable bad sector table */
- /* some of this code is copied from ufs/ufs_disksubr.c */
- /* including the bugs :-( */
- /* read a bad sector table */
-
-#define BAD144_PART 2 /* XXX scattered magic numbers */
-#define BSD_PART 0 /* XXX should be 2 but bad144.c uses 0 */
- if (dl->d_partitions[BSD_PART].p_offset != 0)
- dkbbnum = dl->d_partitions[BAD144_PART].p_offset
- + dl->d_partitions[BAD144_PART].p_size;
- else
- dkbbnum = dl->d_secperunit;
- dkbbnum -= dl->d_nsectors;
-
- if (dl->d_secsize > DEV_BSIZE)
- dkbbnum *= dl->d_secsize / DEV_BSIZE;
- else
- dkbbnum /= DEV_BSIZE / dl->d_secsize;
- i = 0;
- do_bad144 = 0;
- do {
- /* XXX: what if the "DOS sector" < 512 bytes ??? */
- p = Bread(dosdev_copy, dkbbnum + i);
- dkbptr = (struct dkbad *) p;
-/* XXX why is this not in <sys/dkbad.h> ??? */
-#define DKBAD_MAGIC 0x4321
- if (dkbptr->bt_mbz == 0 &&
- dkbptr->bt_flag == DKBAD_MAGIC) {
- dkb = *dkbptr; /* structure copy */
- do_bad144 = 1;
- break;
- }
- i += 2;
- } while (i < 10 && (unsigned)i < dl->d_nsectors);
- if (!do_bad144)
- printf("Bad bad sector table\n");
- else
- printf("Using bad sector table at %d\n", dkbbnum+i);
- }
-#endif /* DO_BAD144 */
}
#endif /* RAWBOOT */
return 0;
@@ -228,7 +171,7 @@ devread(char *iodest, int sector, int cnt)
for (offset = 0; offset < cnt; offset += BPS)
{
dosdev_copy = dosdev;
- p = Bread(dosdev_copy, badsect(sector++));
+ p = Bread(dosdev_copy, sector++);
bcopy(p, iodest+offset, BPS);
}
}
@@ -270,61 +213,3 @@ Bread(int dosdev, int sector)
}
return (ra_buf + (sector - ra_first) * BPS);
}
-
-static int
-badsect(int sector)
-{
-#if defined(DO_BAD144) && !defined(RAWBOOT)
- int i;
- if (do_bad144) {
- u_short cyl;
- u_short head;
- u_short sec;
- int newsec;
- struct disklabel *dl = &disklabel;
-
- /* XXX */
- /* from wd.c */
- /* bt_cyl = cylinder number in sorted order */
- /* bt_trksec is actually (head << 8) + sec */
-
- /* only remap sectors in the partition */
- if (sector < boff || sector >= boff + bsize) {
- goto no_remap;
- }
-
- cyl = (sector-boff) / dl->d_secpercyl;
- head = ((sector-boff) % dl->d_secpercyl) / dl->d_nsectors;
- sec = (sector-boff) % dl->d_nsectors;
- sec = (head<<8) + sec;
-
- /* now, look in the table for a possible bad sector */
- for (i=0; i<126; i++) {
- if (dkb.bt_bad[i].bt_cyl == cyl) {
- /* found same cylinder */
- if (dkb.bt_bad[i].bt_trksec == sec) {
- /* FOUND! */
- break;
- }
- } else if (dkb.bt_bad[i].bt_cyl > cyl) {
- i = 126;
- break;
- }
- }
- if (i == 126) {
- /* didn't find bad sector */
- goto no_remap;
- }
- /* otherwise find replacement sector */
- if (dl->d_partitions[BSD_PART].p_offset != 0)
- newsec = dl->d_partitions[BAD144_PART].p_offset
- + dl->d_partitions[BAD144_PART].p_size;
- else
- newsec = dl->d_secperunit;
- newsec -= dl->d_nsectors + i + 1;
- return newsec;
- }
- no_remap:
-#endif
- return sector;
-}
diff --git a/sys/boot/pc98/libpc98/biosdisk.c b/sys/boot/pc98/libpc98/biosdisk.c
index 4bc91ae..ac3ed3f 100644
--- a/sys/boot/pc98/libpc98/biosdisk.c
+++ b/sys/boot/pc98/libpc98/biosdisk.c
@@ -34,7 +34,6 @@
* - NetBSD libi386/biosdisk.c
* - FreeBSD biosboot/disk.c
*
- * XXX Todo: add bad144 support.
*/
#include <stand.h>
OpenPOWER on IntegriCloud