[comp.os.minix] rs232 stuff

eholley@cs.utexas.edu (Ed Holley) (11/25/88)

For anyone that is having trouble with the serial port driver:

My serial driver absolutely refused to do anything at all.  I eventually
found that this was due to the transmit/receive buffer not being
read after the modem was set up.  By adding the following line to
the bottom of procedure config_rs232 in rs232.c, I got my modem to work.

  port_in(base + RS232_TRANSMIT_HOLDING,&value);

where value is declared as as integer.

This clears out any interrupts the port thinks have occured, allowing
more interrupts to occur.  I hope this helps somebody else out there.

Incidently, after spending all the time to figure this out, I discovered
that this driver is not very usable, at least on my poor old slow PC
compatable.  But it does work.

	Ed Holley (eholley@cs.utexas.edu)

dtynan@sultra.UUCP (Der Tynan) (11/29/88)

Here are a couple of things I've been struggling with...

    1/	The RS-232 channel is not flushed at any stage between an open()
	and a close().  What this means, is my dialer program (which works
	just fine under SysV) fails, because it finds junk still on the
	line.  The tty_open() routine should flush the buffer.

    2/	There is no modem control, or support for SIGHUP, which makes
	using the port as a dialin line difficult.  Also, I would like
	to share the line between dialin and dialout.  As it stands, this
	is impossible.

I don't know if these problems are from V7, or from Minix, but they are
troublesome.  I am implementing a tty_open() and tty_close() scheme to
alleviate some of these difficulties.  Film at eleven.  For those people
who have asked that I post the diffs for eliminating the RAMDISK, please
be patient.  I spent most of the holidays (in the US) trying to generate
the correct order for libc.a, as well as fixing some other problems.  I
think I may have found a bug in malloc().  A program I am porting to
Minix would hang during an fopen() call.  I traced it to a call to malloc().
I turned on the DEBUG option in malloc, and the problem went away.  Any
comments?  Another pet project when I get all this done, is to add shared
text to the PC version.  I believe that MINIX-ST already has this (perhaps,
all I have to do is remove some #ifdef's?).  I keep running out of space
from exec()'s.  In the UN*X world, everyone does a popen() or system() as
a quick and dirty way to execute a child.  Unfortunately, under Minix,
this results in yet another copy of the shell.  Comments?
						- Der
-- 
	dtynan@zorba.Tynan.COM  (Dermot Tynan @ Tynan Computers)
	{apple,mips,pyramid,uunet}!Tynan.COM!dtynan

 ---  If the Law is for the People, then why do we need Lawyers? ---