I understand I need a locator as well?
Again is there a free one?
Where can I get startup code? The book I have is Programming Embedded
Systems by Michael Barr, and he says that you could use libgloss, but I
can't find it anywhere on the internet!!
http://www.openwatcom.org/ can target 186 and is free. It creates .exe's
however that run on top of DOS and it sounds like you just have a bare
board. However the compiler source code is available so if nothing else you
might be able to get the startup code. There are free DOS versions around
should that make it easier for you.
Looking at your email address - Philips and x86?
IIRC, libgloss is included with newlib.
"So often times it happens, that we live our lives in chains
and we never even know we have the key."
The Eagles, "Already Gone"
The Beatles were wrong: 1 & 1 & 1 is 1
You can download TurboC 2.01 from Borland's museum. This includes the
startup code. YOu would have to avoid most of the library stuff if you
aren't using DOS in any form.
You will need a locator; I'd Google for one. I found several articles on
them a couple of years ago.
My first choice -- because I have it -- is the ancient Borland C++ v3.1
which you can probably find on eBay for a song or two. I've used it in
years past to create stand-alone programs that ran on an 80188 but it takes
some custom startup code to get rid of the dependency on DOS. Second choice
would be Microsoft C++ v1.5x with the same caveats. You might even be able
to get by with the DJGPP MS-DOS compiler if you can limit the processor
target to 8086/186. Again you'll have to write your own startup code.
As for startup code, decades ago the company I worked for bought a product
called C_Thru_ROM which was a library of startup and simple
CRTL-substitutions to enable writing embedded software for x86 processors
with commercial (MS-DOS) compilers. It was rare then and I haven't seen any
in the years since but you might find a copy. Also, the company that makes
it -- http://www.datalight.com -- now makes a ROM-able MS-DOS emulator.
bcc (Bruce's C Compiler) would do that.
GCC i not targeted for 16 bit 80x86 code.
Why 80186 (or 80188)? The architecture is obsolete, so
I'd avoid it in new designs. An ARM could do the same
with modern tools and plenty of more power.
The 80186 startup code is much dependent on the hardware
environment - the first thing is to open up the ROM
chip select so the whole chip is available, and next,
to open the other chip selects.
tauno voipio (at) iki fi
>I am new to all this but I am about to try my first embedded design using
>an 80C186 processor.
>Is there a free C compiler available?
IIRC, there was a book on programming embedded DOS systems that
included a Borland 3.something C compiler. You might look in the
Borland Museum as well, though I think that stuff is older.
Someone else mentioned OpenWatcom, which might work as well.
>Am I correct in thinking gcc can't target the 80186 processor?
That's my understanding.
>I understand I need a locator as well?
>Again is there a free one?
John Fine has written jloc which should do what you want. He calls it
"zero price shareware," which means he wants you to register it if you
use it, but he dosn't charge you anything for it. See
http://my.execpc.com/~geezer/johnfine/ for more info.
>Where can I get startup code? The book I have is Programming Embedded
>Systems by Michael Barr, and he says that you could use libgloss, but I
>can't find it anywhere on the internet!!
The 80C186 user's manual from Intel (if you can find one) pretty much
describes most of what you need for the chip. And it's important for
things like setting up the chip selects. libgloss I suspect is for
handling C initialization requirements and to call main.
With a locator, you don't necessarily have to do all that, just jump
to a routine called "_start" or some such. Although you should
probably have a routine to zero static RAM, etc. That means you'll
have to explicitly initialize static variables in your code (rather
than declaring them with an initializer), but usually that's a small
price to pay (as long as you don't forget...)
Change is inevitable, progress is not.
The next release of Openwatcom (1.4) has specific support for embedded work,
you do not need a locator anymore, the linker will do it for you.
Note that OW is a cross-compiler, you can use it to create embedded code
whether you run the Windows, OS/2 or DOS.
That is good news. I just had a quick look on the site and cannot see a
release date mentioned. Do you know roughly when this might be?
>> The next release of Openwatcom (1.4) has specific support for embedded
>> you do not need a locator anymore, the linker will do it for you.
>That is good news. I just had a quick look on the site and cannot see a
>release date mentioned. Do you know roughly when this might be?
"if it's finished" is the common answer. I don't think there's a specific
date set, but my feeling that it's near.
For the 'locator' functions, the enhancements were only in the linker. I
think the linker will not change between now and the release, I can mail you
the new linker if you want to try it. Mail be privately at my (mangled) email
address in the header.
I would not call it obsolete, it is a mature core with mature tools
very suitable for small non-battery operrated embedded systems and
components. There exist various mutations still in production and one
can also see on Lantronix website that this core is successfuly used in
new products (like XPort and WiPort).
Speaking of Lantronix, I quite like their DSTni-EX for the optimized
instruction set and high amount of integrated prefipherals. However, I
did not use it myself, just read the datashet.
Rue McLanahan is a mature actress, but I wouldn't choose her to play
the part of sex kitten in a new movie.
Programming the 186 gets you all the disadvantages of real-mode x86
programming with none of the advantages of, well, anything really. ARM
tools are mature and readily available, operating systems abound, and
peers to ask for help are everywhere.
Ahhh, it always comes back to sex. ;-)
What of the real mode intimidates you ? Name some.
> programming with none of the advantages of, well, anything really. ARM
> tools are mature and readily available, operating systems abound, and
> peers to ask for help are everywhere.
However, ARM is off-topic in this thread.
Well damn, I don't need to go anywhere past the memory model or the
scarce and narrow registers to make my point more than adequately. It's
the 21st century now, I have my VIC-20s for nostalgia but don't use
them for any production purpose.
> However, ARM is off-topic in this thread.
Welcome to the Internet, lad - here's a lemon-scented towel and a
coupon good for two bananas and a ferret. Once you redeem it, maybe you
can come back and see if you have any better luck controlling what is
"on-topic" in a Usenet group, particularly when the content of the
message is utterly appropriate to the group and merely doesn't agree
with what you were thinking in a particular thread.
Anyway, anyone asking about coming up on the 186 in this day and age
had better be supporting a legacy project or working with an ASIC that
has a 186 inside it. At a stretch, I could swallow a short-run design
intended to use up a huge drawer full of dusty 186 parts. But there are
so many other products so much better in so many ways that
intentionally selecting a 186 except in the sorts of circumstances I
illustrated is quite insane.
Know any ARM operating systems that can boot
If I recall correctly there was a discussion on boot times for
embedded Linux on comp.os.linux.embedded a while ago.
Someone pointed to some work done by Samsung on shortning
the boot time of Linux on their ARMs. They got this down to below
500ms. Most other OSes available for ARM should boot much
faster than this.
I agree with larwe. Choosing a 186 for a new design if there are not
some sort of unusual circumstances is insane.
As Rziak were saying there are lots of good development tools available for
the 86/186 not to mention the enormous amount of legacy code, also to test
your code just open a DOS box on your 64bits desktop and run the code, works
like a charm :-)
I might be biased... http://www.ht-lab.com/freecores/cpu8086/cpu86.html :-)
PS I didn't know who Rue Mcclanhan was, but after a quick google search
guess what? she played the sexy one in the Golden Girls TV series, so I
guess given the success of the series she was a good choice :-)
"larwe" <zwsd...@gmail.com> wrote in message
>> > Programming the 186 gets you all the disadvantages of real-mode x86
>> What of the real mode intimidates you ? Name some.
>Well damn, I don't need to go anywhere past the memory model or the
>scarce and narrow registers to make my point more than adequately.
While I agree that programming a large single thread application in
real mode can become quite messy, but using some kind of RTOS and
allocating separate code, data and stack segments for each task and
keeping each of them below 64 KiB should not be too hard in most
Common library calls would have to use far calls, but would
automatically use task specific static data and stack areas etc. The
task switching in the OS would be slightly more complicated and the
communication between tasks would go through OS supplied communication
primitives (which is usually considered a good thing rather than
poking around in a foreign task data space :-).
So if I can summarize this argument: "Yes, working with this core is
like jumping through blazing hoops but, really, they're not blazing
quite as vigorously as it appears from a distance, and you'd be
surprised at just how much pain a human can endure before blacking
You seem to have already plenty of responses.
Why I'm thinking of the core being obsolete?
After using the 80186's for nearly 20 years successfully,
many of my customers had to change the processor, as the
chip manufacturers announced EOL for the parts.
Though it may be OT: After 2 years of search for
a replacement, I found the Atmel AT91 series ARMs
with functionality covering well that of an 80186.
As an example: Porting the software of a real-time
controller with 40 kbytes of 80186 code to the ARM
took a week, as both were programmed with C without
ant dirty tricks used. Surprisingly, the code size
was about the same (40064 bytes vs. 40036 bytes). The
compilers used were Borland C v. 4.5 and GCC v. 3.2.1
in Thumb mode.
Even as I used the 8086 family chips from the very
beginning (I still have one in engineering sample 8088's),
I definitely advise against making any new designs
based on a plain 16 bit 80x86.
Please think that for a successful embedded product
used in any non-consumer use, the parts should be
available for 15 to 20 years from the design.
I see. Well, it has not been such a bad CPU for its times.
> Even as I used the 8086 family chips from the very
> beginning (I still have one in engineering sample 8088's),
> I definitely advise against making any new designs
> based on a plain 16 bit 80x86.
I admit, I was impressed by amount of peripherals Lantronix stuffed
onto their chip, so I may be biased. (Impressed not realy by the core
but by those 2x CAN channels, 2x Ethernet channels, 4x UART and other
goodies on DSTni-EX).
> Please think that for a successful embedded product
> used in any non-consumer use, the parts should be
> available for 15 to 20 years from the design.
Quite good point.