VOGONS


DirectSerial in linux?

Topic actions

  • This topic is locked. You cannot reply or edit posts.

First post, by mrvi

User metadata
Rank Newbie
Rank
Newbie

I have an old device that measures amount of oxygen in a closed chamber. It is connected to PC through COM port. Program, that display data was written for DOS, and it works perfectly in DosBox7.0 under WindowsXP. It connects to com through "serial1=directserial realport:com1" line in dosbox.conf.
In linux line "serial1=directserial realport:ttys0" doesn't work. On startup I get messages:
Serial1: Opening /dev/ttys0
Serial1: Serial Port "/dev/ttys0" could not be opened.
Errno 5 occurred.
Here is my kernel config:

# CONFIG_PARPORT_SERIAL is not set
CONFIG_MOUSE_SERIAL=y
# CONFIG_SERIAL_NONSTANDARD is not set
CONFIG_SERIAL_8250=y
# CONFIG_SERIAL_8250_CONSOLE is not set
CONFIG_SERIAL_8250_PCI=y
CONFIG_SERIAL_8250_PNP=y
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
# CONFIG_SERIAL_8250_MANY_PORTS is not set
# CONFIG_SERIAL_8250_SHARE_IRQ is not set
# CONFIG_SERIAL_8250_DETECT_IRQ is not set
# CONFIG_SERIAL_8250_RSA is not set
CONFIG_SERIAL_CORE=y
# CONFIG_SERIAL_JSM is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_USB_SERIAL is not set

I tried cvs-build, it doesn't work too. Where is my mistake?

Reply 2 of 4, by mrvi

User metadata
Rank Newbie
Rank
Newbie

Thank you! You are right! ttyS0 works, but there is a lot of strange bugs with mouse, after i turn on the device and start my program in dosbox. Program randomly skips some data points and writes NaN instead of data. Also dosbox wrights :

Serial1: Errors occured: Framing 0, Parity 0, Overrun 6 (IF0:0), Break 1

Why mouse lags? I reconfigured my kernel, and excluded serial mouse support, but it didn't help. How dosbox's directserial option works? Do I need to configure serial under linux somehow?
There are a lot of questions. May be you can point me or right manual?

Reply 3 of 4, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I wrote it under a default Ubuntu install... my test applications worked there. Can't tell you any more as my Linux knowledge is limited.

But you can try to change the speed settings in dosbox.conf.
core=dynamic and cycles=[a value that makes DOSBox not use 100% of your CPU]. Or ctrl+F11 / ctrl+F12 while DOSBox is running.
And if nothing helps try
serial1=directserial .... rxdelay:x
The default for x is 100, try something higher.

1+1=10

Reply 4 of 4, by Becuz

User metadata
Rank Newbie
Rank
Newbie

I'm using Fedora 38 with Dosbox version 0.80.1 and had the same problem with serial port failing to connect.
I got Com 1 to work by changing "directserial" to just "direct" in the dosbox.conf settings.
e.g. serial1=direct realport:ttyS0
I also gave myself permission in the dialout group in /etc/group just in case.

Hopefully this info helps someone out there.