public inbox for linux-msdos@vger.kernel.org
 help / color / mirror / Atom feed
* 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

* Re: DOSemu serial port problem
  2003-10-31  9:36 DOSemu serial port problem Edenyard
@ 2003-10-31 12:09 ` Dr. Claudia Neumann
  0 siblings, 0 replies; 10+ messages in thread
From: Dr. Claudia Neumann @ 2003-10-31 12:09 UTC (permalink / raw)
  To: Edenyard; +Cc: DOSemu Mailingliste

Hi!

Am Freitag, 31. Oktober 2003 10:36 schrieb Edenyard:
>    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"

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"
>
>    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?) 
Don't run DOSemu as root. You don't have to. Give your user access to 
/dev/ttyS0 for example
crw-rw-rw-    1 root     dialout    4,  64 2003-10-31 12:42 /dev/ttyS0
and asign the user to the group dialout.

If it doesn't work, look for some programm, which blocks the /dev/ttyS0. I 
experienced the same problem, because XWindows wanted to asign a serial mouse 
to the COM port. After I commented out the lines in XF86Config-4, I could 
work with the COM port.

Regards

Claudia

^ 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

* Re: DOSemu serial port problem
  2003-10-31 16:22 Edenyard
@ 2003-11-02 13:30 ` Dr. Claudia Neumann
  2003-11-02 16:39   ` Ged Haywood
  0 siblings, 1 reply; 10+ messages in thread
From: Dr. Claudia Neumann @ 2003-11-02 13:30 UTC (permalink / raw)
  To: Edenyard; +Cc: DOSemu Mailingliste

Hi Edenyard,

Am Freitag, 31. Oktober 2003 17:22 schrieben Sie:
>    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?

I am lost here. I don't know what a RTS line is. 

The only suggestion I can make is:
make a

find /etc -type f -exec grep -l /dev/ttyS0 { } \;

and you get a list of files which have an entry of /dev/ttyS0. Look at every 
file and find out if some other program uses /dev/ttyS0.

Or make the same with /var/log.

Hope that helps

cu

Claudia

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

* Re: DOSemu serial port problem
  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
  0 siblings, 2 replies; 10+ messages in thread
From: Ged Haywood @ 2003-11-02 16:39 UTC (permalink / raw)
  To: Dr. Claudia Neumann; +Cc: Edenyard, DOSemu Mailingliste

Hi there,

On Sun, 2 Nov 2003, Dr. Claudia Neumann wrote:

> > 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?
> 
> I am lost here. I don't know what a RTS line is. 

Request To Send.  See the EIA232 specifications.  Maybe there's something
in /etc/inittab which should be commented out.  Hree are the entries in
one of the distributions (Slackware I think):

#----------------------------------------------------------------------
# Local serial lines:
#s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100
#s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100

# Dialup lines:
#d1:12345:respawn:/sbin/agetty -mt60 38400,19200,9600,2400,1200 ttyS0 vt100
#d2:12345:respawn:/sbin/agetty -mt60 38400,19200,9600,2400,1200 ttyS1 vt100
#----------------------------------------------------------------------

> find /etc -type f -exec grep -l /dev/ttyS0 { } \;

That won't find the inittab entry. :)

73,
Ged.


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

* Re: DOSemu serial port problem
  2003-11-02 16:39   ` Ged Haywood
@ 2003-11-02 18:54     ` Robert Komar
  2003-11-02 19:07     ` Stas Sergeev
  1 sibling, 0 replies; 10+ messages in thread
From: Robert Komar @ 2003-11-02 18:54 UTC (permalink / raw)
  To: DOSemu Mailingliste

On Sun, 2 Nov 2003, Ged Haywood wrote:

> > find /etc -type f -exec grep -l /dev/ttyS0 { } \;
>
> That won't find the inittab entry. :)

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

Cheers,
Rob Komar

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

* Re: DOSemu serial port problem
  2003-11-02 16:39   ` Ged Haywood
  2003-11-02 18:54     ` Robert Komar
@ 2003-11-02 19:07     ` Stas Sergeev
  1 sibling, 0 replies; 10+ messages in thread
From: Stas Sergeev @ 2003-11-02 19:07 UTC (permalink / raw)
  To: DOSEMU users mailing list

Hello.

--- Ged Haywood <ged@www2.jubileegroup.co.uk> wrote:
> Maybe there's something
> in /etc/inittab which should be commented out.  Hree
Wont work. The main problem here is that people keep
using an "alternate" dirs for lock files like
$_ttylocks = "/home/user/dosemu/lock"
which cheats dosemu to think it uses the ser port
exclusively, while it does not. For some reasons this
always keeps being suggested here and no surprise this
causes problems like the above one.
In general I used to simply put the leavedos() calls
in the appropriate places when such things are being
done by people, but in this particular case this won't
help so I am not sure what is the proper way of
preventing that to be done (removing the $_ttylocks
option entirely is not very good either).

> > find /etc -type f -exec grep -l /dev/ttyS0 { } \;
> That won't find the inittab entry. :)
Surely, but you can use lsof instead, it should find.

__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

^ 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

* 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
  2008-06-28 10:03 Dosemu " Horváth András
@ 2008-06-28 14:18 ` James Courtier-Dutton
  0 siblings, 0 replies; 10+ messages in thread
From: James Courtier-Dutton @ 2008-06-28 14:18 UTC (permalink / raw)
  To: Horváth András; +Cc: linux-msdos

Horváth András wrote:
> 
> 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?
> 

Try the same program with dosbox    http://www.dosbox.com/

I have found dosbox to have much better serial port control than dosemu.
For example, on one program I have, dosemu hangs trying to access the 
serial port, but dosbox works fine with it.
On closer inspection, I discovered that dosemu tends to work ok with dos 
programs that use the serial fifo. For dos programs that do not use the 
fifo, dosemu fails.

Kind Regards

James


--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ 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 --
2003-10-31  9:36 DOSemu serial port problem Edenyard
2003-10-31 12:09 ` Dr. Claudia Neumann
  -- strict thread matches above, loose matches on Subject: below --
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-11-03 11:37 Edenyard
2008-06-28 10:03 Dosemu " Horváth András
2008-06-28 14:18 ` James Courtier-Dutton

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