Re: Free x86 C compiler wanted



Jean-Sebastien Stoezel wrote:

I am looking for a free C compiler supporting 186 processors.

Doesn't gcc do what you want?
[No, there's no working port to generate 16 bit x86 code. -John]

Ideally the compiler would not generate code that is OS dependent (a
bootloader would copy the code from PROM to RAM then branch to the
program's entry.

Most programs still will call BIOS or other OS services, in the system
library, through interrupts. Did you do an disassembly of the file?

Right now I am using msvc, I thought it could work by generating COM
files but I cannot succeed in starting my application (CPU not
booting). I tried different symbols (__astart, __main...), nothing
seems to boot.

Any thoughts?

If you say "not booting", it may be a problem of your bootloader?
Why at all do you copy the program into the RAM, instead of starting
from PROM?

Using MSDOS you can debug your program, to some degree.

An exe2bin utility did convert EXE files, in old MSDOS versions.

Did you set up the segment registers properly?
CS=startaddress>>4, SS (=DS?) and SP as appropriate...


AFAIR the entry point of an COM file simply is the first byte. Use an
JSR to this location, which would initialize the CS:IP properly, and
some programs (libraries) do an RTS to exit.

But before all that: is your framework set up properly? Interrupt
vectors etc.? A PSP (Program Segment Prefix) also may be required.

And wich start module did you use? A C compiler will prefix the program
code with a startup section, where the memory management, I/O system
etc. is initialized. A stand alone application may require a special
start module. In the source code of the start module you may find
further requirements, e.g. how the size of the stack and data segment is
determined by the program.

DoDi
.



Relevant Pages

  • Re: Free x86 C compiler wanted
    ... bootloader would copy the code from PROM to RAM then branch to the ... program's entry. ...
    (comp.compilers)
  • Re: what is the functionality of kernelrelocate() of eboot code?
    ... The bootloader is copied to RAM, but the bootloader doesn't know it. ... why the relocation should be needed for ram based boot code and global ... From the bootloadermainthe kernelrelocate() is located at the ...
    (microsoft.public.windowsce.platbuilder)
  • Re: XIP - Execute in Place (For Bootloader)
    ... then the bootloader will not get copied to the RAM from the Flash. ... I would like to execute the Bootloader from the Flash Memory itself ... How to make the Bootloader to Execute from the Flash Memory itself ...
    (comp.arch.embedded)
  • Re: Relocate from nor to ddr CE 5.0
    ... it depends on the bootloader implementation; ... programmed into flash. ... but the image info says it belongs to ram. ... blt CODEINRAM ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Question on bootloader Relocation?
    ... The bootloader must copy itself to RAM and jump there. ... > However StartUp routine suppose to run from RESET vector, ... > RAMIMAGE in the BIB file as SDRAM address that implicitly menas if we need ...
    (microsoft.public.windowsce.platbuilder)