*BSD News Article 2582


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel!munnari.oz.au!mips!mips!newsun!gateway.novell.com!terry
From: terry@npd.Novell.COM (Terry Lambert)
Subject: Re: 386bsd-0.1: primary bootstrap (wdbootblk.c) problem & fix.
Message-ID: <1992Jul27.172708.3363@gateway.novell.com>
Keywords: 386bsd boot bootstrap wdbootblk.c
Sender: news@gateway.novell.com (NetNews)
Nntp-Posting-Host: thisbe.eng.sandy.novell.com
Organization: Novell NPD -- Sandy, UT
References: <greg.712111605@hibp1.ecse.rpi.edu>
Date: Mon, 27 Jul 1992 17:27:08 GMT

In article <greg.712111605@hibp1.ecse.rpi.edu> greg@ecse.rpi.edu (Greg) writes:
>   In a recent post I described a booting problem I was having: I could only
>boot about 20% of the time in high speed mode. I tried all the latest patches,
>but the problem persisted. By putting a printf at the top of boot.c, I          determined that it was not making it out of wdbootblk.c.

[ ... code describing delay loop deleted ... ]

Folks, *DON'T FIX IT THIS WAY!*

the correct fix is to either use the patched boot files in the "unofficial"
directory on Agate (new "dist.fs"), or to do the following (which only
partially recreates the patch):


Robert Thrush says:

-------------------------------------------------------------------------
	  Most of the credit goes to Jim Huber (jbh@aii.com) for sweating
	through comparing and finding this difference between the AT bios and
	the 386bsd boot code.

	  Here's the diff to feed to patch as follows:

	cd /sys/i386/stand
	patch <following-patch

	*** wd.c        Wed Jul 22 12:58:32 1992
	--- wd.c-       Sun Jun 28 00:20:53 1992
	***************
	*** 299,305 ****
		DELAY(1000);
		outb(wdc+wd_ctlr,2);
		DELAY(1000);
	!       while(inb(wdc+wd_status) & WDCS_BUSY);
		outb(wdc+wd_ctlr,8);
	  
		/* set SDH, step rate, do restore to recalibrate drive */
	--- 299,305 ----
		DELAY(1000);
		outb(wdc+wd_ctlr,2);
		DELAY(1000);
	!       while(inb(wdc+wd_altsts) & WDCS_BUSY);
		outb(wdc+wd_ctlr,8);
	  
		/* set SDH, step rate, do restore to recalibrate drive */
-------------------------------------------------------------------------

Note that wd_status was being checked (incorrectly) instead of wd_altsts
(the correct answer) when waiting for the controller to come ready.

This is in the FAQ, but there are a several fixes in Chris' code on agate
for which there is not yet a source patch.  This is the reason I have not
advocated this fix.

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