Porting libmodbus to 16-bit DOS

N

nleschov

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
 
J

jacob navia

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...
 
N

Nickolai Leschov

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 ?
 
M

Mark Bluemel

Nickolai said:
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.
 
J

jacob navia

Nickolai said:
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)
 
S

santosh

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


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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top