Porting libmodbus to 16-bit DOS

Discussion in 'C Programming' started by nleschov@gmail.com, Dec 13, 2007.

  1. Guest

    Hello,

    I'm working on a project that involves embedded controllers
    communicating over modbus. I would like to use a well-written modbus
    library to add modbus functionality to my project and I found
    libmodbus:
    https://launchpad.net/libmodbus/

    My controllers are in fact embedded PCs running DOS-compatible OS, CPU
    is Intel 80188-compatible. My compiler is Borland C++ 5.02 on Windows,
    generating 16-bit DOS code.

    When I tried to drop-in the library to my project, I got the following
    errors:

    Info :Building...
    Info :Compiling Z:\WORK\ICP\libmodb\modbus.c
    Error: modbus.c(30,2):Unable to open include file 'TERMIO.H'
    Error: modbus.c(31,2):Unable to open include file 'SYS\TIME.H'
    Error: modbus.c(32,2):Unable to open include file 'UNISTD.H'
    Error: modbus.c(34,2):Unable to open include file 'GLIB.H'
    Error: modbus.c(38,2):Unable to open include file 'SYS\SOCKET.H'
    Error: modbus.c(39,2):Unable to open include file 'SYS\IOCTL.H'
    Error: modbus.c(40,2):Unable to open include file 'NETINET\IN.H'
    Error: modbus.c(41,2):Unable to open include file 'NETINET\IP.H'
    Error: modbus.c(42,2):Unable to open include file 'NETINET\TCP.H'
    Error: modbus.c(44,2):Unable to open include file 'MODBUS.H'
    Error: modbus.c(125,44):'modbus_param_t' cannot start a parameter
    declaration
    Error: modbus.c(129,69):Type name expected
    Warn : modbus.c(982,13):Constant is long
    Warn : modbus.c(985,13):Constant is long
    Warn : modbus.c(988,13):Constant is long

    How do I resolve these problems?
    Can Borland C++ 5.02 be considered good enough compiler today?

    Sincerely,
    Nickolai Leschov
    , Dec 13, 2007
    #1
    1. Advertising

  2. jacob navia Guest

    wrote:
    > Hello,
    >
    > I'm working on a project that involves embedded controllers
    > communicating over modbus. I would like to use a well-written modbus
    > library to add modbus functionality to my project and I found
    > libmodbus:
    > https://launchpad.net/libmodbus/
    >
    > My controllers are in fact embedded PCs running DOS-compatible OS, CPU
    > is Intel 80188-compatible. My compiler is Borland C++ 5.02 on Windows,
    > generating 16-bit DOS code.
    >
    > When I tried to drop-in the library to my project, I got the following
    > errors:
    >
    > Info :Building...
    > Info :Compiling Z:\WORK\ICP\libmodb\modbus.c


    [snip errors]

    > How do I resolve these problems?


    The compiler can't find the include files mentioned in the very
    explicit error messages.

    Use the -I directive to instruct the compiler where to find those files.

    > Can Borland C++ 5.02 be considered good enough compiler today?
    >


    For generating 16 bit DOS code probably yes...

    --
    jacob navia
    jacob at jacob point remcomp point fr
    logiciels/informatique
    http://www.cs.virginia.edu/~lcc-win32
    jacob navia, Dec 13, 2007
    #2
    1. Advertising

  3. >
    > Use the -I directive to instruct the compiler where to find those files.
    >

    Thank you. Can you tell where are those files supposedly be found?
    (except glib; I know that I need to install it by myself)

    I.e. what are the files contained in the sys/ and netinet/ directories?
    Are they to be provided by the OS, compiler or otherwise?
    What are termio.h and unistd.h ?
    Nickolai Leschov, Dec 13, 2007
    #3
  4. Mark Bluemel Guest

    Nickolai Leschov wrote:
    >>
    >> Use the -I directive to instruct the compiler where to find those files.
    >>

    > Thank you. Can you tell where are those files supposedly be found?
    > (except glib; I know that I need to install it by myself)


    > I.e. what are the files contained in the sys/ and netinet/ directories?
    > Are they to be provided by the OS, compiler or otherwise?


    These are likely to be Unix-specific and relate to the networking
    implementation provided.

    > What are termio.h and unistd.h ?


    These are Unix-specific.

    A quick view of the original site shows that the package you are looking
    at is explicitly for Linux. Porting it to another unix-like platform is
    likely to be reasonably straightforward, but porting it elsewhere could
    be quite a challenge.

    You are probably heading out of the scope of this group.

    You should probably try to find assistance specifically related to
    libmodbus - is there a mailing list or forum?

    Alternatively you could look at whether cygwin would help you get
    this package running under DOS.
    Mark Bluemel, Dec 13, 2007
    #4
  5. jacob navia Guest

    Nickolai Leschov wrote:
    >>
    >> Use the -I directive to instruct the compiler where to find those files.
    >>

    > Thank you. Can you tell where are those files supposedly be found?
    > (except glib; I know that I need to install it by myself)
    >
    > I.e. what are the files contained in the sys/ and netinet/ directories?
    > Are they to be provided by the OS, compiler or otherwise?
    > What are termio.h and unistd.h ?


    Well, <unistd.h> are unix standard functions... Unlikely to be
    present in your DOS 16 bit system.

    You are attempting to compile code that was written for another,
    completely different environment. You will have to port it
    to your 16 bit DOS environment.

    Good luck.

    (You will need it)


    --
    jacob navia
    jacob at jacob point remcomp point fr
    logiciels/informatique
    http://www.cs.virginia.edu/~lcc-win32
    jacob navia, Dec 13, 2007
    #5
  6. santosh Guest

    Mark Bluemel wrote:

    > Nickolai Leschov wrote:
    >>>
    >>> Use the -I directive to instruct the compiler where to find those
    >>> files.
    >>>

    >> Thank you. Can you tell where are those files supposedly be found?
    >> (except glib; I know that I need to install it by myself)

    >
    >> I.e. what are the files contained in the sys/ and netinet/
    >> directories? Are they to be provided by the OS, compiler or
    >> otherwise?

    >
    > These are likely to be Unix-specific and relate to the networking
    > implementation provided.
    >
    >> What are termio.h and unistd.h ?

    >
    > These are Unix-specific.
    >
    > A quick view of the original site shows that the package you are
    > looking at is explicitly for Linux. Porting it to another unix-like
    > platform is likely to be reasonably straightforward, but porting it
    > elsewhere could be quite a challenge.
    >
    > You are probably heading out of the scope of this group.
    >
    > You should probably try to find assistance specifically related to
    > libmodbus - is there a mailing list or forum?
    >
    > Alternatively you could look at whether cygwin would help you get
    > this package running under DOS.


    Not Cygwin but it *could* be possible with DJGPP.
    <http://www.delorie.com/>

    Provided necessary network drivers, TCP/IP stack etc. are added for DOS
    (third party software is available for all this).

    The OP's best bet is to seek assistance in a DOS newsgroup.
    santosh, Dec 14, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Imayam

    How to use 64 bit integer in 16 Bit Dos ?

    Imayam, Jun 15, 2006, in forum: C Programming
    Replies:
    3
    Views:
    398
    Mark McIntyre
    Jun 15, 2006
  2. Replies:
    4
    Views:
    1,056
    Jim Langston
    Nov 17, 2005
  3. Replies:
    5
    Views:
    695
  4. Pallav singh
    Replies:
    0
    Views:
    334
    Pallav singh
    Apr 1, 2009
  5. Pallav singh
    Replies:
    5
    Views:
    381
    Jorgen Grahn
    Apr 3, 2009
Loading...

Share This Page