TARP file API specification
(too old to reply)
2014-05-02 15:37:06 UTC
Raw Message

I want to debug 16-bit image for embedded system based on 80186.
I know I have to create specific TRAP file for this purpose.
Where could I find TRAP API help file ? Or maybe someone else already
have an experience with ?

Wilton Helm
2014-05-02 23:04:52 UTC
Raw Message
I am using Watcom regularly for debugging 186 embedded code. I have used
the AM186ER with a PROMJet and the Lantronix (Grid Connect) DSTni LX and EX
with a serial port.

Obviously trap files are going to be somewhat specific to the hardware
environment. I can supply you my source files for these. They are derived
for OW trap files. I'm not the greatest at working with makefiles and the
build environment so some of it is command line driven and some of it is IDE
driven. Also I'm not really Windows programmer, so I made minimal changes
to the host side of things, and what I did may not be the best.

I made some design changes, that I thought made sense, at least in my
I modified the trap interface a bit. From the host side it appears the
but what actually is transferred across the link has been trimmed down
only what a 186 class processor would need to save communication time.

I did my own serial link protocol. I didn't need modem handling or a
bunch of error correction, because I was working with short physical
cables. Again this saved some time.

Since the target had no file system, I included code loading across the
link in the process.

Somewhere along the line, changes to the interface have rendered the
link partially inoperative. It can't restart. I haven't had time to
see what
has changed and why it adversely affected my code.

I also created a modified version of the IDE config files to support
16 bit embedded development. I would be happy to share that information
with you as well, if it is of use. You may want my modified printf
of functions, also which eliminate DOS INT dependencies and target a
serial port. Again, you may have to modify them, but at least it would
only be at the lowest level (cout()). I did not target scanf, as I
don't find
it terribly useful, nor did I address malloc and friends, as no sane
developer would use dynamic memory allocation anyway.

The OW tools already include absolute linking capability and output of
hex or binary files, as well as code relocation and initialized data
copying. Those are documented in the linker manual. I added them
ten years ago and have been using them regularly. There is still a bug
the linker that was introduced since then that causes problems in
cases (overflow of group AUTO). If you run into that, I can get you a
copy of the 1.4 beta linker that I've been using, or you can download
a version from around that time before the bug was introduced.

If you would like startup code that works from a reset vector and copies
the initialized data back into place (from a ROM image), I would be
to share that, also.

There is a document about trap files. It is buried in the source code tree
somewhere. I don't recall exactly where right now. If you have access to
the source tree, you can look for it. It is part of a section that has a
number of developer documents in it. If not, let me know and I will go
looking for it. I don't know if I have a copy of the tree on any computer
right now, so I might have to create one to find it. I haven't done
anything with the source tree in a few years.

2014-05-04 17:29:10 UTC
Raw Message
Hello Wilton,

Thank you very much for your detailed answer!

Actually I have a few 3rd party embedded boards based on INTEL 80C186.
My goal is to improve the firmware by adding some new features
and to fix some bugs.

I spent a lot of time to find appropriate IDE with C compiler and
assembler with ability to produce 16-bit raw binary image.
Against of you, I'm a Windows programmer :-) And many years I used
Microsoft Visual Studio, but never OW. Unfortunately, Microsoft linker
is not accepted linker script with absolute segments location.
That's why I've choose OW. And right from start of using it I faced
the challenge with WLINK bug. There is my topic on github/open-watcom:
Jiri Malak suggested me to contact you on the OW contributor news group.

Eventually I made a project with a right (?) linker script, ASM startup
code and CPP main body. It's not a chance to find/buy 80186 In-Circuit
emulator somewhere, so I made PROM emulator based on ALTERA DE0-Nano
FPGA from Terasic.
Post by Wilton Helm
I also created a modified version of the IDE config files to support
16 bit embedded development.
Is it possible to debug 16-bit code on x64 environment (Windows 7)
with that modification now ?

I'll be very grateful if you can share 80186 TRAP file sources and
a sample of 80186 OW project with a linker script and startup code.

With the Best Regards,
Ion Tihi