Path: utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!pasteur!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!ukc!reading!onion!cf-cm!ralph From: ralph@computing-maths.cardiff.ac.uk (Ralph Martin) Newsgroups: comp.sys.mac.programmer Subject: Serial I/O Message-ID: <478@cf-cm.UUCP> Date: 20 Jul 88 08:14:22 GMT Organization: Univ. Coll. Cardiff, Cardiff, WALES, UK. Lines: 50 Posting-Front-End: GNU Emacs 18.47.1 of Mon Nov 23 1987 on v1 (berkeley-unix) Please not that I am posting this for Sak Wathanasin, and replies should go to him, not to me. Thanks, Ralph. I'm encountering a curious problem when using the modem and AppleTalk ports simultaneously. This problem only occurs when running with the 64K roms; in essence, I get a "hardware overrun error" (SerStatus returns 0x20 in cumErrs). It doesn't always happen but when it does I have a PAPWrite outstanding (i.e., the write has been issued but not completed). The reason for my doing this is to fill a second buffer from the serial line while the LW is busy (if you haven't already guessed, the program takes PostScript from the modem port and puts it out on AppleTalk). If I understand IM Vol 2 correctly, a hardware overrun should only occur if interrupts have been turned off too long. What is turning interrupts off? (I don't do this in my code directly; I do however call the PAP routines.) I am using the SERD and AppleTalk drivers from the June'87(?) Software supplement (the last I ever got from Apple), with XON/XOFF and (via a call to SerSetBuf) an input buffer 1K big and two 4K buffers for the PAP output (all buffers are static data, and therefore locked). When all drivers have been loaded, I have about 2K bytes free in a 128K Mac (not a lot, but everything I need is now allocated and in memory - I think). Oh yes, and I'm using System 2.1 (!) on the 128K Mac. The PAP routines come from the LW 3.1 driver (loaded using the technique described in MacTutor). If I issue XON/XOFF sequences in the appropriate places so that the double-buffering effectively does not take place, the problem goes away. This would point at something in my code, but I'm completely stumped because the program runs without problems on a Mac+ (and Mac II) and under MF in a 70K partition to boot (I have also run with TMON strict discipline and heap scramble in that configuration with no problems). Also if I define "showpage" in the PS stream so that it does nothing ("/showpage {} def" at the beginning of the job), the whole thing works; i.e. the problem only occurs if the LW actually prints. Can anyone help? Hints, and suggestions of things to try all gratefully received. It already works with the 128K roms, but we would like this to work with the 128K Mac as well 'cos it's ideal for this job. (And, yes, I'll post the program to the net when I've sorted out the problem.) Thanks in advance, Sak Wathanasin uucp: ...!ukc!kernel!sw JANET: sw%kernel.uucp@uk.ac.ukc BITNET: sw%kernel.uucp%ukc.ac.uk@ukacrl.bitnet other: sw%kernel.uucp@ukc.ac.uk phone: (+44) 532 444566 snail: Kernel Technology Ltd, 46 The Calls, Leeds LS2 7EY