Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Porting libmodbus to 16-bit DOS

Reply
Thread Tools

Porting libmodbus to 16-bit DOS

 
 
nleschov@gmail.com
Guest
Posts: n/a
 
      12-13-2007
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
 
Reply With Quote
 
 
 
 
jacob navia
Guest
Posts: n/a
 
      12-13-2007
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
 
Reply With Quote
 
 
 
 
Nickolai Leschov
Guest
Posts: n/a
 
      12-13-2007
>
> 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 ?
 
Reply With Quote
 
Mark Bluemel
Guest
Posts: n/a
 
      12-13-2007
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.
 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      12-13-2007
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
 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      12-14-2007
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Porting from DOS to W32 - COM port Martins C++ 3 06-19-2006 03:23 PM
IOS DoS defense causes DoS to itself:) Igor Mamuziæ Cisco 2 05-19-2006 11:59 PM
[newbie]How to install python under DOS and is there any Wxpython can be installed under dos? john san Python 19 02-18-2005 12:05 PM
Unable to run MS-DOS in Windows and DOS properties tabs missing Don Computer Support 5 02-11-2004 07:20 PM
Executing DOS (yes, DOS) program from within Python? Ben Fairbank Python 2 10-07-2003 08:51 AM



Advertisments