Continuing the 'remove ELF' patch series.

These changes extend the larchive structure, and 
add a Kconfig EXPERT option to enable the 'no elf' mode.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>


git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@483 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
Ronald G. Minnich 2007-08-29 15:26:54 +00:00
parent 3d4b4784e5
commit ac4a06d6dd
2 changed files with 32 additions and 2 deletions

19
Kconfig
View file

@ -53,6 +53,25 @@ config LOCALVERSION
help
Append an extra string to the end of the LinuxBIOS version.
config NOELF
bool "Don't use ELF for payloads"
depends EXPERT
default n
help
Until now, LinuxBIOS has used elf for the payload. There are many problems
this, not least being the inefficiency -- the ELF has to be decompressed to
memory and then the segments have to be copied. Plus, lar can't see the segments
in the elf -- to see all segments, you have to extract the elf and run readelf on it.
There are problems with collisions of the decompressed ELF location in memory
and the segment locations in memory.
Finally, validation of the ELF is done at run time, once you have flashed the
FLASH and rebooted the machine. Boot time is really not the time you want to find
out your ELF payload is broken.
With this option, LinuxBIOS will direct lar to break each elf segment into a LAR
entry. ELF will not be used at all. Note that (for now) LinuxBIOS is backward
compatible -- if you put an ELF payload in, LinuxBIOS can still parse it. We hope
to remove ELF entirely in the future.
config BEEPS
bool "Enable beeps upon certain LinuxBIOS events"
depends EXPERT

View file

@ -52,9 +52,10 @@
#include <types.h>
/* see note in lib/lar.c as to why this is ARCHIVE and not LARCHIVE */
#define MAGIC "LARCHIVE"
#define MAX_PATHLEN 1024
/* NOTE -- This and the user-mode lar.h are NOT IN SYNC. Be careful. */
struct lar_header {
char magic[8];
u32 len;
@ -62,7 +63,14 @@ struct lar_header {
u32 checksum;
u32 compchecksum;
u32 offset;
/* Compression:
* 0 = no compression
* 1 = lzma
* 2 = nrv2b
*/
u32 compression;
u32 entry; /* we might need to make this u64 */
u32 loadaddress; /* ditto */
};
struct mem_file {
@ -70,6 +78,8 @@ struct mem_file {
int len;
u32 reallen;
u32 compression;
void *entry;
void *loadaddress;
};
/* Prototypes. */
@ -77,5 +87,6 @@ int find_file(struct mem_file *archive, char *filename, struct mem_file *result)
int copy_file(struct mem_file *archive, char *filename, void *where);
int run_file(struct mem_file *archive, char *filename, void *where);
int execute_in_place(struct mem_file *archive, char *filename);
int run_address(void *f);
void *load_file(struct mem_file *archive, char *filename);
#endif /* LAR_H */