Previous Thread
Next Thread
Print Thread
Serial support in SDLMESS #65107 10/18/10 02:53 AM
Joined: Feb 2000
Posts: 207
T
tlindner Offline OP
Senior Member
OP Offline
Senior Member
T
Joined: Feb 2000
Posts: 207
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


tim lindner
tlindner@macmess.org
Re: Serial support in SDLMESS [Re: tlindner] #65109 10/18/10 03:25 AM
Joined: Mar 2001
Posts: 16,273
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,273
That's pretty cool. I'll definitely take a look at the patch.

Re: Serial support in SDLMESS [Re: R. Belmont] #65112 10/18/10 05:42 AM
Joined: Feb 2000
Posts: 207
T
tlindner Offline OP
Senior Member
OP Offline
Senior Member
T
Joined: Feb 2000
Posts: 207
Thanks!

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.


tim lindner
tlindner@macmess.org
Re: Serial support in SDLMESS [Re: tlindner] #65113 10/18/10 09:21 AM
Joined: Feb 2008
Posts: 326
M
Micko Offline
Senior Member
Offline
Senior Member
M
Joined: Feb 2008
Posts: 326
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.

Re: Serial support in SDLMESS [Re: Micko] #65135 10/18/10 04:09 PM
Joined: Feb 2000
Posts: 207
T
tlindner Offline OP
Senior Member
OP Offline
Senior Member
T
Joined: Feb 2000
Posts: 207
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.


tim lindner
tlindner@macmess.org

Who's Online Now
2 registered members (mixmaster, 1 invisible), 84 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,673
Posts113,788
Members4,852
Most Online418
Aug 14th, 2019
Powered by UBB.threads™ PHP Forum Software 7.7.3