#249 USB Serial work-around

open
nobody
None
5
2013-11-24
2011-08-03
Adam Connell
No

Many USB serial ports do not support a 5 bits per byte configuration however when
configuring a serial port under DOS it is fairly common practice to simply set the
serial ports LCR register to 0x80 to set the DLAB bit before setting the LCR to the
actually desired value. This patch is a hack to work around the problem with these
adapters at the cost of disabling the 9600 baud 5.N,1 configuration.

Discussion

  • Adam Connell
    Adam Connell
    2011-08-03

     
  • guly
    guly
    2012-10-25

    First, compliments for the beautiful project...I am an Italian boy I speak a little English (sorry ahead for my English)

    I have the need to run a 16-bit program on my winzoz seven 64 bit...(in win xp 32 bit work perfectly)

    I have a usb to serial port converter to communicate from PC to a machine tool with CNC..

    The 16-bit program works perfectly in dosbox 0.74, but the serial port NO!

    I set from the configuration file:

    serial1=directserial realport:COM2
    serial2=disabled
    serial3=disabled
    serial4=disabled

    But when I start dosbox appears:

    Serial1: Opening COM2
    Serial1: Desired serial mode not supported (9600,5,n,1)

    Exactly this problem!

    How do I install this patch? in dosbox 0.74...
    Where do I put the file "dosbox_ignore_5N1.patch"?

    Thanks in advance to all...

    By Guly

     
  • Adam Connell
    Adam Connell
    2012-10-28

    Guly,

    Using the patch requires the project be built from source.
    1) You will need a build environment. Get MinGW http://www.mingw.org/ if
    you do not have it.
    2) Download the source of DosBox.
    3) Extract the source from the archive
    4) Apply the patch with the command:
    patch -p0 < patchname.diff
    5) Build the software with the commands:
    ./configure
    make

    Regards,
    Adam

    On Thu, Oct 25, 2012 at 10:14 AM, guly gguly@users.sf.net wrote:

    First, compliments for the beautiful project...I am an Italian boy I speak
    a little English (sorry ahead for my English)

    I have the need to run a 16-bit program on my winzoz seven 64 bit...(in
    win xp 32 bit work perfectly)

    I have a usb to serial port converter to communicate from PC to a machine
    tool with CNC..

    The 16-bit program works perfectly in dosbox 0.74, but the serial port NO!

    I set from the configuration file:

    serial1=directserial realport:COM2
    serial2=disabled
    serial3=disabled
    serial4=disabled

    But when I start dosbox appears:

    Serial1: Opening COM2
    Serial1: Desired serial mode not supported (9600,5,n,1)

    Exactly this problem!

    How do I install this patch? in dosbox 0.74...
    Where do I put the file "dosbox_ignore_5N1.patch"?

    Thanks in advance to all...

    By Guly

    • patches:249 USB Serial work-around*

    Status: open Created: Wed Aug 03, 2011 12:45 PM UTC by Adam Connell Last
    Updated:
    Fri Sep 07, 2012 11:35 AM UTC Owner: nobody

    Many USB serial ports do not support a 5 bits per byte configuration
    however when
    configuring a serial port under DOS it is fairly common practice to simply
    set the
    serial ports LCR register to 0x80 to set the DLAB bit before setting the
    LCR to the
    actually desired value. This patch is a hack to work around the problem
    with these
    adapters at the cost of disabling the 9600 baud 5.N,1 configuration.


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/dosbox/patches/249/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/prefs/

     
  • BARTHES
    BARTHES
    2013-09-06

    Adam,

    Could you rebuild Dosbox with this patch for me ?
    I can't do it myself. I've no competence about MinGw ...

    It's very important for me because I use a very old application to communicate with PLCs (rs232 with 9600,8,n,1 only ...).

    Thanks a lot

    Best regards

     
  • northern
    northern
    2013-10-02

    Adam,

    I rather dislike having someone else do my work, but I'm afraid I am in the same boat as Barthes. The fix that is proposed here is also precisely what I need. Would you be able/willing to make the necessary modification to Dosbox for us? Thank you!

     
  • northern
    northern
    2013-10-02

    Just playing around, I was able to execute the patch command, but the patch failed. Just goes to show the level of my incompetence... I renamed the patch file to d.patch and then ran:
    patch -p0 dosbox.exe d.patch

    The response was:
    Hunk#1 FAILED at 230
    1 out of 1 hunk FAILED

    Any help is truly appreciated.

     
  • northern
    northern
    2013-10-02

    So this time I extracted the Dosbox executable with Univeral Extractor program....but the resulting files make no sense to me and where/how to apply the patch eludes me...

     
  • Allan
    Allan
    2013-11-01

    I too have not been able to correctly get MinGW installed and working to add this patch in. I can compile in VS 2008 but then I don't know how to add in the patch.

    Can someone post a patched exe or instructions on how to add the patch to a VS 2008 compile or tell me which source to edit to fix this? I'm using a USB to serial converter and cannot get it to work.

     
  • Joseph Lane
    Joseph Lane
    2013-11-24

     
    Last edit: Joseph Lane 2013-11-24
  • Joseph Lane
    Joseph Lane
    2013-11-24

    I was able to apply the patch without issue but can't seem to build an exe with MinGW. I am able to provide a copy of the patched source though. You should be able to build it with VisualStudio or whatever. Please post an exe, if you are able, for other users. I hope this can help someone.

    dosbox-074.zip