Subject: Re: Problem Apple printers
To: Bill Studenmund <wrstuden@loki.stanford.edu>
From: Bob Nestor <rnestor@metronet.com>
List: port-mac68k
Date: 04/22/1996 18:38:32
Bill wrote in reference to hangs in the boot sequence with some Apple 
printers:

>Well, Ken's problem (modem saying "NO CARRIER" when DTR goes up, which
>sets up an echo loop) is kinda "the way it's supposed to work."
>Serial ports are "supposed" to echo everything back out, since there's
>supposed to be a terminal on the other end. Modems aren't supposed to
>speak unless spoken to.

I don't think you'd want the serial port to echo everything back if the 
terminal was set for "local echo".  That would cause every character 
typed to appear on the terminal twice.  On modems this is usually called 
"Command Echo" and can be enabled/disabled via one of the 
Hayes-compatible modem commands.  On my Supra it's the "E" command.

If it's just this character re-echo that is confusing the printer because 
it doesn't expect to see the Command/Status/Character it sends echoed 
back, how do I set the "noecho" attribute for the line so that it's setup 
*before* the call to "settyflags" in the boot process?  Should I define 
/dev/tty01 as a unique terminal type in /etc/ttys with a corresponding 
entry for that terminal type in the termcaps file?

>I'll try & hurry this beast up. Though we'll also need some changes in the
>booter to support this stuff.

Don't hurry on my account.  It's not that difficult to turn off the 
printer before I boot, although it'd be nice to see Booter V1.9 
officially "released" as it's use is mandatory for booting NetBSD on some 
Macs like my Performa-550.

>> ..., I tried commenting out the references to DCD in lines 262, 1471, 
>> and 1472 but got the same results.  On boot I hang in set ttyflags.   A 
>> traceback shows the code to be "serstop" called from "seropen", etc.
>
>Weird. Could you check closely on the trace? seropen isn't supposed
>to call serclose directly. ??

Here is the traceback from a Kernel built from sources SUPed last 
weekend.  The printer in question is an Apple Personal 300 Laserwriter 
with the Energy Saving feature.

-Debugger...
_nmi(2404,5,47,5a00,2104) + 26
_lev7intr(?)
_zshard(0) + 12
_lev4intr(?)
_serstop(7000a00,7000a82,5,c,c01) + e
_seropen(c01,5,2000,7051a00) + b0
_spec_open(886e20) + 14c
_vn_open(886ee8,5,0) + 320
_sys_open(7051a00,886f88,886f80) + 72
_syscall(5) + 13c
_trap0() + e

Hope this helps, if not let me know what Debug options you'd like me to 
enable in the Serial Module.  Since you're already working on a new 
Serial Module it doesn't make much sense to fix the current one.  But if 
it can be used to gain a better understanding of what's going on in hopes 
of avoiding the same problems in your current effort, then I think it 
might be time well spent.

-bob