[comp.os.minix] Gettin' there with Evans stuff...

jnall%FSU.BITNET@cornellc.cit.cornell.edu (John Nall 904-644-5241) (06/11/89)

OK...I've spent the last 9 hours putting in all of the changes of
the Bruce Evans 286 Protected Mode stuff (and backing up my present
configuration, of course.  OF COURSE!!) At this time, it seems to
work, with two minor problems, which I think are related:

  (1)  If I put "/usr/bin/date `readclock` </dev/tty" in my
( /etc/rc file, it locks the system up tight.  However,
( using the old, reliable "/usr/bin/date -q </dev/tty"
( works fine.
  (2)  I was using 384 (mkfs /dev/hd3 384) as the size of my root
( partition before, so that it would load into the 384K of
( extended memory that I have.  This works fine with MINIX286.
( But since the partition is actually 912K, I decided to do a
( mkfs /dev/hd3 912 on it, copy the root from floppy, and boot
( up MINIX286.  Hangs the same way as #1 above (symptoms are
( absolute refusal to accept any keyboard input, including
( ctrl-alt-del).

I think these may be related, and am going to try to gun them out.
But if someone already knows the answer, I'm sure not too proud to
accept suggestions......e-mail or public, whichever is your pleasure.

BTW
     Add to the list of (a) don't tug on superman's cape, (b) don't
spit in the wind, (c) don't fool around with the lone ranger. and
(d) don't mess with Jim one more:

(   don't argue with Henry Spencer.

John Nall
Computer Science Department
Florida State University
Tallahassee, FL
nall@nu.cs.fsu.edu  (Arpa/Internet)

jnall%FSU.BITNET@cornellc.cit.cornell.edu (John Nall 904-644-5241) (06/15/89)

I wrote:
>>  (1)  If I put /usr/bin `readclock` </dev/tty in my /etc/rc file
>>       it locks the system up tight....

Bruce Evans replied:
>  Did you recompile readclock?

Yes, I did recompile readclock, with the readclock.c.cd changes in it.
The problem (on my system, anyway) turns out to be the following:

  Almost the first statement in main() of readclock has a statement of
the form  if(peek(CPU_TYPE_SEGMENT, CPU_TYPE,OFFSET) != PC_AT), and if
the statement is true (it does not pull FC from location 0xffffe) then
it outputs a -q and does an exit(1).  Unfortunately, the routine peek
returns an integer (not unsigned) and the FC becomes FFFC, which does
not compare with PC_AT (defined as 0xFC).  If this happens when the
statement is as given in my original comment, it locks the system up.
If one does a "readclock" later on, however, it just outputs the -q and
runs OK.  So there is something sinister in having it happen in /etc/rc.
I leave that to others of greater talent and curiousity.

It is easily cured by making the statement:

  if ( (unsigned) peek(CPU_TYPE_SEGMENT, CPU_TYPE_OFFSET) != PC_AT)

John Nall