Possible to use RS232 emulation to talk to real RS232 port?

By tschak909

Rookie (26)

tschak909's picture

03-10-2018, 07:36

I am currently porting a piece of software to MSX, and I need emulation with a functional serial port. Does OpenMSX allow talking to a real serial port device?

-Thom

Login or register to post comments

By Manuel

Ascended (14782)

Manuel's picture

03-10-2018, 11:26

No, the only thing you can plug into an emulated RS-232C interface is a device called 'rs232-tester'. As the description says: "Reads all data from file specified with the 'rs-232-inputfilename' setting. Writes all data to the file specified with the 'rs232-outputfilename setting."
So, you can use it to test your RS-232C code on openMSX, but not via a host serial port device.

By wouter_

Champion (399)

wouter_'s picture

03-10-2018, 13:43

On a unix system (Linux, OSX, ...) you may be able to specify device files like '/dev/ttyS0' for the input/output files of the 'rs232-tester' device to write to the real serial port device instead of to a regular file.
I vaguely remember someone using this method to connect openMSX to the internet. Never tried myself though.

By tschak909

Rookie (26)

tschak909's picture

04-10-2018, 05:09

in lieu of that, I'd ask for the ability to emulate e.g. an ObsoNet or equivalent UNAPI ethernet interface. I am developing a new terminal program, and really need something usable to test.

-Thom

By Grauw

Enlighted (7525)

Grauw's picture

04-10-2018, 08:49

You could test with MIDI...

By mth

Champion (475)

mth's picture

06-10-2018, 21:49

A long time ago I made openMSX running UZIX talk to pppd on Linux via a named pipe (mkfifo). Since that worked, I imagine a serial port (/dev/ttyS*) should work as well, provided you set it up correctly using Linux' setserial first.

If you're on Windows, you could try whether the old DOS devices still exist and use "COM1" or "COM2" as the output file.

By tschak909

Rookie (26)

tschak909's picture

06-10-2018, 22:56

Basically, that won't work on Windows, because the posix file i/o functions in win32 explicitly do not allow you to use the vestigial MS-DOS device names (COM1, etc.), even when \\ escaped... Microsoft went out of their way to prevent this...for whatever #($(@# reason.

So it would need to be patched to allow this....

That's okay, because I can run openmsx in a VM for now.

Does anyone know if the Spectravideo SVI-805 RS232 adapter is supported on OpenMSX? It is essentially an 8250 hung off the I/O bus.

-Thom

By mth

Champion (475)

mth's picture

06-10-2018, 23:33

We don't have a dedicated Windows coder, but patches are welcome.

The 8250 UART isn't implemented yet, since the MSX RS232 expansions use 8251 + 8254.

By Grauw

Enlighted (7525)

Grauw's picture

06-10-2018, 23:43

Grauw wrote:

You could test with MIDI...

To elaborate, piping MIDI to external ports is supported on all desktop platforms (afaik), and as MIDI is really just a serial connection like RS232 but with a different baud rate (31250 Hz)… it may serve your purposes.

By mth

Champion (475)

mth's picture

06-10-2018, 23:49

The Windows MIDI code we have is a bit dodgy though, please test whether it actually works with MIDI devices (real or soft synths) before you go and solder special cables.

By Grauw

Enlighted (7525)

Grauw's picture

06-10-2018, 23:55

May be useful, a MIDI to RS232 bridge: http://projectgus.github.io/hairless-midiserial/

My MSX profile