Maximilian Brune has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86656?usp=email )
Change subject: Documentation/lib/rmodules.md: Update simple binary explanation ......................................................................
Documentation/lib/rmodules.md: Update simple binary explanation
Signed-off-by: Maximilian Brune maximilian.brune@9elements.com Change-Id: I9cf21b4258758b18f0d3c9316c9aa32cc0d9c44f --- M Documentation/lib/rmodules.md 1 file changed, 18 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/86656/1
diff --git a/Documentation/lib/rmodules.md b/Documentation/lib/rmodules.md index 8a707b8..3ac25a7 100644 --- a/Documentation/lib/rmodules.md +++ b/Documentation/lib/rmodules.md @@ -35,8 +35,24 @@ 1. coreboot stages (postcar, ramstage) 2. simple binaries (smm, smmstub, sipi_vector)
-They are actually handled the same by the build system and only differ -in the fact, that they are either coreboot stages or they are not. +They are handled differently in a 1 important fact. The simple binaries +are compiled into rmodules the same as coreboot stages are, but the +simple bianries are always directly linked to a stage. +Since rmodules are ELF files as well, we can easily link them to the +stages in which we need them (usually postcar or ramstage). +So they are not so much as seperate modules anymore, but still retain +the abillity to accept rmodule_parameters. +Since the simple binaries are usually very small, linking them directly +into the stage (e.g. ramstage or postcar) avoids having to fetch them +from CBFS and running all that code to fetch a few hundred bytes of +code. So the build system handles them as follows: +1. create rmodule (which is an ELF file) from source files +2. removing all the ELF headers and sections that are not loadable using +`objcopy -O binary` +3. from this, create an object file, which usually has the self invented +.manual file extension, which can be linked to the appropriate stage. +4. add the generated .manual file as "source" file to the stage we want +to link it to.
In the end the ELF files will have three different ELF sections, which are all created by the rmodtool.