Article View: comp.os.xinu
Article #5Another bug fix
From: John Reed
Date: Wed, 05 Aug 1992 21:42
Date: Wed, 05 Aug 1992 21:42
77 lines
2909 bytes
2909 bytes
Several days ago I posted about a problem I was having in getting
Xinu up on a 3/60. It came up OK, but I couldn't get any input
into the shell, and Xinu in-general was behaving "weird".
After about 1 day of working on this problem, I have discovered the
solution.
1st of all, the board in question was NOT a 3/60, but was a 3/50.
(I had ordered a couple of 3/50's from a reseller, and they packaged
them in a 3/60 case. They really were 3/50's).
Now this fact really made me curious, becuase Xinu runs pretty
well on a 3/50.
Just for kicks I brought up SunOS 4.1.1 on each new 3/50 CPU board
and they ran fine. But Xinu would still not run correctly.
Hmmmmmmmm?
I examined the CPU boards really close against the known-working
3/50 board. The only real difference I could spot was (substantially)
different labeling on the Zilog serial chips. Checking the Zilog
data manuals didn't provide any help as I could find no information
that distinguished the differing chips.
So I debugged awhile, and pretty much "accidentally" found the bug.
The bug is in ttyiin(), the tty input routine. There is a place
in the code where the character is read from zscc_data, then
IMMEDIATELY afterwords, zscc_control is set to 1. The solution
was to insert a DELAY() between these 2 statements:
INTPROC ttyiin(devm)
long devm;
{
STATWORD ps;
register struct tty *iptr;
register struct zscc_device *zptr;
register int ch;
int err;
int cerr;
int ct;
iptr = &tty[devm];
zptr = iptr->ioaddr;
ch = zptr->zscc_data;
DELAY(2); /* Add DELAY here to fix bug on some 3/50's)
/* get the contents of RR1 */
zptr->zscc_control = 1;
DELAY(2);
err = zptr->zscc_control;
---------end code segment---------
Evidently, there is some timing sensitivity with some versions of
the Zilog chip.
JR
--
/------------------------------------------------------------------\
| John Reed {ucsd,uunet}!pacdata!johnr |
| Pacific Data Products johnr%pacdata.uucp@ucsd.edu |
| --------------------- |
| George Herbert Walker Bush, with the letters re-arranged spells: |
| |
| Huge Berserk Rebel Warthog |
| -- From Cosmic Trigger II |
\------------------------------------------------------------------/
Technical Details
Message-ID:
<1992Aug5.214211.18067@pacdata.uucp>Path:
arc1-ca.pugleaf.net!sparky!uunet!pacdata!johnrShow Full Headers
Complete Article Headers
Newsgroups: comp.os.xinu Path: arc1-ca.pugleaf.net!sparky!uunet!pacdata!johnr From: johnr@pacdata.com (John Reed) Subject: Another bug fix Message-ID: <1992Aug5.214211.18067@pacdata.uucp> Sender: johnr@pacdata.uucp (John Reed) Organization: Pacific Data Products Date: Wed, 5 Aug 1992 21:42:11 GMT Lines: 77