Home Page

Serial support in SDLMESS

Posted By: tlindner

Serial support in SDLMESS - 10/18/10 02:53 AM

After finishing with the last rounds of bug fixes I wanted to try to see if I could get some sort of bidirectional serial support in SLDMESS.

I took a look at the bitbanger implementation the CoCo uses and quickly discovered it was unidirectional. So I had to add bidirectional support to it and hook all the new bits into the CoCo. I did loose the neat auto baud detection it had, I could not get it to work above 2400 baud. Now there is some UI to select the baud.

I don't have many real serial devices here to test with so took a short cut. I decided to add psuedo terminal support to the Mac OS X version of SDLMESS. I added a test in sdlfile.c for '/dev/pty*'. This non existing device triggers a call to openpty(). I also set a flag to read and write using read(2) and write(2), not pread and pwrite. The man page suggested pread/pwrite would work with a psuedo terminal, but in actuality it doesn't. I think it is an OS bug.

I made a movie to show it all off: PsuedoTerminalSDLMESS.mp4

So far the fastest i've tested the new bitbanger port is at 9600. But I know a real CoCo 3 (in double speed mode) is capable of 115,200 baud (using a special block I/O scheme). I plan to test that soon. Also I'll implement full I/O on the Deluxe RS-232 pak, and the Direct Connect modem pak. Thoes are UART based devices. It will be much nicer dealing with whole bytes.

I'd like to talk about getting this integrated into the official SDLMESS.

Here is the patch: pttysdlmess.patch.zip
Posted By: R. Belmont

Re: Serial support in SDLMESS - 10/18/10 03:25 AM

That's pretty cool. I'll definitely take a look at the patch.
Posted By: tlindner

Re: Serial support in SDLMESS - 10/18/10 05:42 AM


BTW: there is a patch here sdlmess-coco-dwsck-ffe0.patch
This patch opens a socket (inet) connection and hooks it directly to the address bus of the CoCo. Obviously something that would never make mainline.

I'm told the implementation works on Mac, Linux and WIndows. Maybe this could also be fit into sdlfile.c. Either in addition to the pseudo terminal, or as a replacement to the pseudo terminal.
Posted By: Micko

Re: Serial support in SDLMESS - 10/18/10 09:21 AM

This looks quite nice and as general thing it can replace pseudo terminal (main reason why it is added was that we missed things like this).

Good thing is that by this we can make two MESS drivers actually talk to each other.
Posted By: tlindner

Re: Serial support in SDLMESS - 10/18/10 04:09 PM

For those of you who watched the movie, I just solved my little netcat problem:

nc -l 6809 0<>/dev/ttys001 >&0

I have to use <> to open the device for reading and writing. Previously I was opening the device only for reading.
© 2020 Forums