*BSD News Article 19606


Return to BSD News archive

Newsgroups: comp.os.386bsd.bugs
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!overload.lbl.gov!dog.ee.lbl.gov!hellgate.utah.edu!fcom.cc.utah.edu!cs.weber.edu!terry
From: terry@cs.weber.edu (A Wizard of Earth C)
Subject: Re: bad144 problem?
Message-ID: <1993Aug17.174835.979@fcom.cc.utah.edu>
Sender: news@fcom.cc.utah.edu
Organization: Weber State University, Ogden, UT
References: <9322908.27770@mulga.cs.mu.OZ.AU> <1993Aug16.180751.16931@crash> <24qnlt$s4p@hrd769.brooks.af.mil>
Date: Tue, 17 Aug 93 17:48:35 GMT
Lines: 51

In article <24qnlt$s4p@hrd769.brooks.af.mil> burgess@hrd769.brooks.af.mil (Dave Burgess) writes:
[ ... ]
>With a full disk configuration, your bad sector table should be the last
>track.  There have been problems identified with disk drives that
>physically have more than 1023 cylinders (which I think the disk in
>question has), but I don't recall if this is specifically for those
>units that have DOS loaded on them or not.

The problem occurs when using BIOS-based boot blocks -- which are *required*
on translated drives with more than one OS on them, like DOS and *BSD.

The issue is only important if the kernel gets written out to the disk on
a location that *is* or *is forwarded to* a location beyond the 1023 cylinder
boundry.  If that happens, BIOS reads can no longer find the kernel to load
it!

A similar -- but less likely -- scenario is possible if the boot partition
exists partially (or fully) beyound the 1023 boundry, in which case again,
the BIOS reads will fail tobe able to load the kernel.  This is less likely
because of default and recommended partition sizes, and typical DOS partition
sizes (and that fact that DOS partitions tend to be placed on the front of
the drive).


As long as the partition itself (and therefore the initial boot code) is not
on the wrong side of 1023, a soloution exists, but has not been implemented
(at least publically and by someone who can release the code).

The idea is that the first and second stage boots are built such that the
BIOS-apparent drive parameters are passed to the second stage boot by the
first stage boot, and *then* the second stage boot goes into protected mode
and uses direct controller I/O, reads the partition table, and does the
math using the passed values.  This allows the second stage boot to see the
bad track table and the kernel, even if it has blocks that live past 1023.

A consequence of the parameters being available to the kernel is that the
kernel can make them available via ioctl() to the fdisk and disklabel
programs, and all the math can be done for the user automatically  (ie:
no more using translated calculated values for offsets, no running of
pfdisk, etc. when using a drive that does translation) instead of using
the procedures I have posted for NetBSD several times in the past.

Note tha none of Tsgt Burgess' instructions on bad sector handling are
invalidated by any of this, so his advice is still sound.


					Terry Lambert
					terry@icarus.weber.edu
---
Any opinions in this posting are my own and not those of my present
or previous employers.