Author: rminnich Date: 2007-08-29 17:26:54 +0200 (Wed, 29 Aug 2007) New Revision: 483
Modified: LinuxBIOSv3/Kconfig LinuxBIOSv3/include/lar.h Log: 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
Modified: LinuxBIOSv3/Kconfig =================================================================== --- LinuxBIOSv3/Kconfig 2007-08-29 15:05:01 UTC (rev 482) +++ LinuxBIOSv3/Kconfig 2007-08-29 15:26:54 UTC (rev 483) @@ -53,6 +53,25 @@ 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
Modified: LinuxBIOSv3/include/lar.h =================================================================== --- LinuxBIOSv3/include/lar.h 2007-08-29 15:05:01 UTC (rev 482) +++ LinuxBIOSv3/include/lar.h 2007-08-29 15:26:54 UTC (rev 483) @@ -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 @@ 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 @@ int len; u32 reallen; u32 compression; + void *entry; + void *loadaddress; };
/* Prototypes. */ @@ -77,5 +87,6 @@ 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 */