public inbox for linux-msdos@vger.kernel.org
 help / color / mirror / Atom feed
* Dosemu serial port problem
@ 2008-06-28 10:03 Horváth András
  2008-06-28 14:18 ` James Courtier-Dutton
  0 siblings, 1 reply; 10+ messages in thread
From: Horváth András @ 2008-06-28 10:03 UTC (permalink / raw)
  To: linux-msdos

Hi,

I'm having a problem regarding Dosemu. I had been searching on the net
but found nothing appropriate.

There is a hardware that needs to talk to a dos program running inside
dosemu through the com (serial) ports. This is a telephone register
program. The serial cable is connected to COM1 and the
/etc/dosemu/dosemu.conf is setup with $_com1 = /dev/ttyS0 (ttyS0 exists
in the dev folder).

Unfortunately it doesn't seem to work. Though i worked ONLY ONCE! :) The
developer of this particular dos program checked the serial port with
another dos program that tests if it works, and it did. Only in this
Telephone register program it doesn't work.

Could anyone point me out to the right direction or forum to ask for
help, or give me any ideas?

Even tried to create a lock directory and set up $_ttylocks, even tried
to run dosemu as root, but nothing.

My system: Ubuntu Gutsy 7.10 with dosemu v1.4.0.0


Thank You in advance for any help-
Andras Horvath


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: DOSemu serial port problem
@ 2003-11-03 11:37 Edenyard
  0 siblings, 0 replies; 10+ messages in thread
From: Edenyard @ 2003-11-03 11:37 UTC (permalink / raw)
  To: linux-msdos

On Sun, 2 Nov 2003 10:54:32 -0800 (PST), Robert Komar wrote:

>
> The fuser command might help you find out if another process
> is using /dev/ttyS0.
>

   I tried fuser and it reported that the only PID using /dev/ttyS0 was
the one that was shown by ps as running dosemu.bin.

   I have written a very simple piece of Turbo Basic code running in
DOS under DOSemu that I've put together to drive 'COM1'. I've made
an interesting discovery:

   1.  I can write a 1 or a 0 to bit 1 of the UART's MCR register to
       control the RTS line and the actual hardware output line (as
       measured on the D-type connector with an oscilloscope) faithfully
       follows whatever I write to the MCR bit.

   2.  Having set the RTS bit in the MCR to 1 or 0, I can read the
       contents of the MCR back and check that the bit that I've just
       written is correct.

   So far, so good. But....

   3.  Having set the RTS bit in the MCR to 1, subsequently writing a
       character to the TX register results in the actual hardware RTS
       line from the UART being reset as the character comes out of
       the hardware TX line.

   4.  Now if I read back the value from the MCR register, it STILL
       indicates that RTS is set, although the actual hardware has
       reset it.

   Assuming that COM1 as seen by DOS programmes running under DOSemu
(with the settings as I have them in  /etc/dosemu/dosemu.conf) is an
emulated UART, it seems that DOSemu is actually NOT emulating the
operation of the UART correctly, but is corrupting the content of the
hardware UART's MCR register (and therefore the RTS output) somehow as
it transmits.

   The same piece of code run under native DOS on a DOS box works
exactly as expected, with the RTS line staying as set whilst characters
are transmitted.

   Now I'm stuck!! Please could someone look into this UART emulation
part of DOSemu and confirm what my experiments indicate? Best of all,
please, PLEASE could it be fixed?

   Any help will be very gratefully accepted, as I'm getting desperate
to get this DOS thing running under Linux!

   Cheers,

      Gerald.


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: DOSemu serial port problem
@ 2003-10-31 16:22 Edenyard
  2003-11-02 13:30 ` Dr. Claudia Neumann
  0 siblings, 1 reply; 10+ messages in thread
From: Edenyard @ 2003-10-31 16:22 UTC (permalink / raw)
  To: Dr. Claudia Neumann; +Cc: linux-msdos

   Many thanks for your help, Claudia!

   You suggested:

>
> try:
> $_com1 = "/dev/ttyS0"
> no entries in $_ports and $irqpassing.
> make sure you have right access to /var/lock or make a directory
> /home/user/dosemu/lock and say in .dosemurc
> $_ttylocks = "/home/user/dosemu/lock"
>

   I tried that and I find that I can send data from my DOS programme
out of the port and also receive data to my programme from the port,
when I remove the $_ports and $irqpassing entries. I also no longer
get any error messages. But...

   Unfortunately, all is still not well: the programme has to drive
the port's RTS line to control an RS232 to RS485 convertor (the
equipment at the other end is RS485). The RTS line has to be made high
whilst the PC is transmitting and then set low immediately after
transmision so that the remote equipment can send its response.

    Now I find with the settings that you suggest that, although the
transmit and receive data is getting through, something other than my
programme is controlling the RTS line. The result of this is that my
programme cannot now transmit along the RS485 cable, because something
is resetting RTS low after my programme has set it high but just
before my programme's transmission starts.

   I have checked and Xwindows is not trying to use the port (as far as
I can tell) for a mouse. My mouse is on /dev/psaux. There is a modem on
/dev/ttyS1 but, as far as Linux is concerned, /dev/ttys0 is unused.

   Please could you suggest something that I can do to stop this.
I don't understand why the system would let me transmit and receive
using the port but at the same time interfere with just the RTS line....
Do I need something to actually block the rest of the system from taking
an interest in /dev/ttyS0, perhaps? What might be trying to use just the
RTS line?

   Thanks again for your help!

   Cheers,

      Gerald.


^ permalink raw reply	[flat|nested] 10+ messages in thread
* DOSemu serial port problem
@ 2003-10-31  9:36 Edenyard
  2003-10-31 12:09 ` Dr. Claudia Neumann
  0 siblings, 1 reply; 10+ messages in thread
From: Edenyard @ 2003-10-31  9:36 UTC (permalink / raw)
  To: linux-msdos

   I'd very much appreciate help with this serial port problem:

   I've installed DOSemu V1.1.99 from source an an Athlon and have
got it running quite well on Slackware 9.1 (2.4.22 kernel). It
recognises the DOS partition on the HDD, boots from the IBM DOS there
and will run programmes like Xtree and Wordstar without any problems.

   However, I have a programme written in Turbo Basic that accesses the
DOS COM1 serial port hardware (UART registers, etc.) directly and I'm
having trouble getting it to talk to the port properly under DOSemu.
The port is a standard 16550A UART on the motherboard and works
correctly under Linux.

   This is the error message I get as DOSemu is coming up:

      ERROR: PORT: conflicting devices: COM1 & std port io

   The programme appears to be able to send out of the port but cannot
get any data coming back in. I've set /etc/dosemu/dosemu.conf to deal
with the COM1 port like this:

      $_com1 = "/dev/ttyS0 irq 4"
      $_ports = " device /dev/ttyS0 fast range 0x3f8,0x3ff"
      $_irqpassing = "4"

   but I can't stop the 'conflict' message or get any data from the
port into my programme. The remainder of the programme appears to work
properly, even printing to what it thinks is LPT1.

   I'm running DOSemu as root (which I believe I have to do in order to
gget access to the UART at /dev/ttyS0 - is this true?) and it's running
in an Xterm window.  I've an idea that I need to tell Linux to ignore
COM1 (ttyS0) so that the DOS programme can have it, but I don't know
whether this idea is sensible and, if so, how to do this. Is there
a parameter to give to a module or the kernel at boot time, or
something like that?

   I've tried DOSemu V1.0.2 and get the same problem, so I'm sure it's
something I'm doing that's messing it up, rather than a DOSemu bug.

   Hope this isn't a dumb question I'm asking. Thanks for any help
on this!

      Gerald.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-06-28 14:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-28 10:03 Dosemu serial port problem Horváth András
2008-06-28 14:18 ` James Courtier-Dutton
  -- strict thread matches above, loose matches on Subject: below --
2003-11-03 11:37 DOSemu " Edenyard
2003-10-31 16:22 Edenyard
2003-11-02 13:30 ` Dr. Claudia Neumann
2003-11-02 16:39   ` Ged Haywood
2003-11-02 18:54     ` Robert Komar
2003-11-02 19:07     ` Stas Sergeev
2003-10-31  9:36 Edenyard
2003-10-31 12:09 ` Dr. Claudia Neumann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox