Mail Archives: djgpp/2000/05/03/15:41:37
Karl Rasmussen wrote:
>
> I am writing some low level IO code (essentially BIOS equivalent) for an
> embedded project. If possible, C would be prefered to assembly language
> (goal: 90% C, 10% assembly or better). We need some code to be 16 bit
> compatible for legacy interface requirements. For other parts, 32 bit is
> fine, though not required.
>
> I was hoping to find a gcc back end for this. If it would look like a 16
> bit x86 cross compiler, that would be great. Our development environment
> is 32 bit x86, Linux or Win 9x, NT 4.
>
> I was excited to find DJGPP, but from the FAQ I get the message this is
> not what DJGPP is. Nor did any of the other gcc builds or compilers seem
> to claim to do this. Did I miss something? Is there any gcc based
> solution? Or do I need to get an old Borland or MS 16 bit compiler?
>
> The DJGPP solution with dpmi services is quite clever, but I can't use
> that trick. The code I'm writing is already at the level that is
> supposed to be implementing those functions for real.
>
> (Yes, I tried to push back the 16 bit requirement and see if we could go
> all 32 bit, and we are stuck with the 16 bit requirement.)
>
> Any pointers or ideas will be appreciated.
>
> Thanks,
>
> Karl Rasmussen
> karl AT vvm DOT com
Perhaps I'm oversimplifying your need, but I just use:
asm(".code16");
at the top of my C files. My boot loader code, for instance, uses
this. I believe that 32 bit code is still generated, but the opcodes
are properly prefixed to run in real mode.
I am currently using gcc-2.95.2 on FreeBSD, but I've used it with other
versions of gcc as well.
-Brian
- Raw text -