romcc progress.

Eric W. Biederman ebiederman at
Thu Jun 12 22:48:01 CEST 2003

John van Vlaanderen <john-at-thinman at> writes:

> Hi Eric,
> I think it's really incredible that you are developing this, and once
> it's done I am sure we will all wonder how we lived w/ out it.
> But, as embarrassed as I am to ask, what is it for ??

I suspect others who have not followed this to closely probably
have the same question.  

romcc is a C compiler that does not use a stack.  Instead it keeps
all variables in registers.

Currently LinuxBIOS has a lot of assembly code simply because memory
initialization is difficult in the general case.  This code cannot be
written with a standard compiler because there is no memory to put
a stack in.  Nor on x86 are there cache blocks that can be locked into
place.  As code generated with romcc does not use a stack it can be
used during memory initialization.

It is true romcc is not *done*,  it is quite usable at this point.

In the freebios2 I have been gradually making the primary API ones
that can be used before  memory is initialized.

The biggest difference is that if you want to return multiple values
instead of passing in the address of a variable the a multi valued
structure must be returned.

The biggest current known bug is that if you have a small type
like short when it is stored in a register nothing ensures it does not
take on a larger value than will fit in a short.

unsigned short i;
i = 65535;
i = i + 1;  /* i == 65536 oops */

The biggest shortcoming comes from it's nature and 

I have used it enough at this point I don't want to live without it


More information about the coreboot mailing list