Order of Execution
Steve M. Gehlbach
steve at nexpath.com
Thu Dec 12 12:26:01 CET 2002
> I have been using as a guide the sis540 chipset
> and stuff like that to get my configuration files together and as
> examples, but well since the code for stuff is spread accross trees,
> what happens when I make one of these projects? Does it take the
> mainboard.c file first, then the raminit? I'm not sure if I am being as
> clear as possible, but if anyone has a clue what I'm asking about it
> would help.
>
One good way to get a view of the execution order is to build it, and look
at the crt.s file. This file has all of the assembly language combined in
it, after pre-processing. The order is in the mainboard Config file;
mainboardinit files first in order (ie, the .inc assembly language), then
the C code. The last assy language code is the crt0.base, which relocates
the C code into ram and then jumps to it (hardwaremain). Basically, you have
to setup RAM, in assy, before you move things to RAM and have a stack, etc.
Only a few initial instructions after power on are in real mode; all other
code is 4GB flat protected mode. Linuxbios sets up a gdt right away.
This is true for flash, at least, DocMem may be slightly different.
-Steve
More information about the coreboot
mailing list