Subject: Re: Strange characters when using cu
To: MacBSD General Mailing List <>
From: Brad Grantham in Convenient Vinyl Pouch <>
List: macbsd-general
Date: 02/12/1994 22:36:05 (Starman) wrote:
> 	I'm running MacBSD on a IIcx w/20 meg RAM. I have a SupraModem
> at 14.4 V.32 bis connected to a Silicon Graphics Iris 4D over the phone
> [...] if the number of files exceeds about 25 or 30, MacBSD
> starts sending a random pattern of ^G and # characters. [...]

Yes.  This used to happen to me fairly often if I was trying to type ahead
of screen updates in VI or ELM.  If you look at the serial driver code
(I know not everyone wants to bother) it prints a '#' if the driver's
input buffer overflows.  The driver's interrupt routine just sticks the
received character into a FIFO that the software can quietly process
later, when the cpu isn't under exclusive control of the interrupt
routine.  If too many characters arrive at once, the FIFO can overflow.

I've only recently started getting '^G's, but maybe it has to do with 
XON/XOFF flow control?  Brad Parker would have a better idea; he's the one
who skillfully rebuilt the original serial crap so that it works.

The easy kludge^H^H^H^H^H^Hfix is to up the size of the input buffer to,
say, 3000 bytes and re-compile the kernel.  This is enough to receive an
entire screen update.  (This is what I've done.)  If you're going to try
this, change the type of the head and length of the FIFO from "char" to
"integer."  I'm not sure this will show up in the next release because
it IS such a kludge.  If anyone wants me to make a patch, just send me

The eventual fix is to replace the splhigh()s in the console driver and
other systems with exclusive software locking.  It may also be possible to
optimize the serial driver, but probably not much.

Brad Grantham, ---------- Happily slaved to NetBSD/Mac68k!
Please don't put me under undue stress; I'm in a support group for people who
--------------------- buy their watches from Radio Shack. --------------------
!!! UNIX forever, NT never, UNIX forever, NT never, UNIX forever, NT never !!!