Re: Dynamically loading a static C library (Updated; also compiler suggestion?)

Hello all! (this is continuation of discussion of my problem in comp.lang.c; I thought that it may belong to here also)

I am programming a microcontroller, ICPDAS i-8411 to be exact.

formatting link
Microcontroller not in the sense of "Embedded CPU" but "a small box". A box has slots: one for CPU board and several more for I/O boards. From the programmer's point of view microcontroller is a PC. It has:

- i186-compatible CPU; 512K RAM

- 512K flash-based disk with simple filesystem

- DOS-compatible OS in boot sector

- some specific devices

Manufacturer suggests using one of the following compilers: - Borland C++ 3.1~5.02 - MSC 6.0 - MSVC (before version 1.52) - TC 2.01 (*available for free) - TC++ 1.01 (*available for free) and supplies a system library for their controller for use with one of the above compilers. Library doesn't have source and comes as .lib and .h files. I also have some of the above compilers .

So, the proposed design cycle looks like this: I write my program in 'C' and link against the manufacturer's library with one of recommended compilers, on Windows PC (maybe even in a DOS box). Then I transfer binary file to microcontroller using manufacturer's terminal program. I run it. Repeat until satisfied with result.

There are 2 major problems for me:

  1. Proposed compilers are all old cruft. I would like to use more up-to-date tools for programming my embedded PC. I want something that is at least either (a) non-proprietary or (b) modern, or both. The best I saw is Borland C++ 5.02 (in the modern department, but still it could use some improvement) And how do you obtain license for the compilers _that_ old? Will Borland or Microsoft grant me license for them tomorrow? (or even today) Will DOS compilers run on my computers tomorrow? (or even today)

  1. No debugging. It doesn't need explaining, I guess. Debugging is good.

So I started to think about using a Forth system on this controller. I can choose a free as in freedom Forth for DOS, put it on controller's disk and if I find a way to use system library from it, I'll be fine. With a little modification, I hope, I will have a license-free development environment with debugging. I'll also have the bonus of the compiler on the target, just in case.

I want to use the supplied library because as opposed to microcontroller as "Embedded CPU", I don't have the datasheet for all my hardware. I don't get schematics, it's not practiced in the case of microcontrollers in the sense of "small box". Instead, I get system library that should fit a lineup of controllers.

So, I thought that maybe I should dynamically load the system library and gain acess to its functions. From what I gather LIB is a collection of OBJ files in the OMF format, developed by Microsoft, but later standardized. I found a bunch of information here, on the 'D' community forum:

formatting link
Seems that if no one else, developers of exotic languages confront this problem?

Either that, or I could use a better devel> I am programming an embedded controller that has a 'C' library for using

its system functions (I/O, timers, all the specific devices). The > supplied library has .LIB and .H files. > > How can I dynamically load a LIB file and access all its functions? > Surely someone has solved similar task? > > My intention is to use a Forth system for programming the controller, > calling library functions from it.
Reply to
Loading thread data ...

Do you still have some sort of print access? If so you still have debugging, just not breakpoints and single step easily set up but certainly sufficient for most things.

Well Borland used to have a remote dubug utility that ran under DOS. It provided all the standard debug over a serial port using a small TSR utility on the remote machine with the full debug program on the local machine. Worked reasonably well as I recall.

I think the gdb stubs work in a similar fashion.


Posted via a free Usenet account from
Reply to
Robert Adsett

Yes, I can use serial port for debugging I/O. This is not bad, but it would be nice to have finer grained control like breakpoints and single stepping.

Sounds good. How do I find it, I wonder.

Does gnu tool set support DOS? If so, then it could be great solution for me. I haven't used gcc/gdb yet.

Reply to
Nickolai Leschov

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.