[comp.os.minix] PC and Ferranti Hard Disk Errors

lyo@cheviot.UUCP (04/27/87)

After several weeks of problems with my hard disc both on an 8088 PC/XT
and on my Ferranti 8086 clone, I have found what appears to be the errors
in the code.

The first error which I posted a couple of weeks ago was to include
hand-shaking in the transfer of command bytes.  Subsequently I managed
to get the winchester working but, like most others, had problems with
disc errors.  This problem appears to stem from the collection and
interpretation of the status byte.  In the present code a call to
unlock() is made prior to collecting, if the command signifies either a
read or a write, the value of the register can change before the return
from the call.  Changing the code to retrieve the value before the call
to unlock() erradicates the problem.  I am not certain why the error
occurs when the disc is filling - but I'm sure someone will have the
answer. 

The following should be inserted at line 546 in wini.c to replace the
existing code.  Make sure the old code is removed cleanly.

	lock();
	for (i=0; i<6; i++) {
		if (( r = hd_wait(1)) == ERR) {
			unlock();
			return(ERR);
		}
		port_out(WIN_DATA, command[i]);
	}
	port_in(WIN_STATUS, &r);
	unlock();

I hope it works for you!

------------------------------------------------------------------------
SENDER 	: "James E Lyons"		PHONE	: +44 091-232 9233
POST	: Computing Lab, University of Newcastle upon Tyne, UK, NE1 7RU
ARPA	: "lyo"%cheviot.newcastle.ac.uk@ucl-cs.arpa
JANET	: "lyo"@uk.ac.newcastle.cheviot
UUCP	: <UK>!ukc!cheviot!"lyo"