diff --git a/Kconfig b/Kconfig index a5bfaf7d3a..abaaa8c5fe 100644 --- a/Kconfig +++ b/Kconfig @@ -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 diff --git a/include/lar.h b/include/lar.h index 4601a49629..2f9fd8f181 100644 --- a/include/lar.h +++ b/include/lar.h @@ -52,9 +52,10 @@ #include +/* 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 */