[OpenBIOS] [commit] r1265 - trunk/openbios-devel/libopenbios
repository service
svn at openbios.org
Sun Feb 16 17:26:34 CET 2014
Author: mcayland
Date: Sun Feb 16 17:26:34 2014
New Revision: 1265
URL: http://tracker.coreboot.org/trac/openbios/changeset/1265
Log:
SPARC32: copy the a.out header beneath load-base during load
NextSTEP's bootloader for Sparc32 expects that the 32 bytes a.out header
is copied just before the start address.
Since this is a compatibility hack for an implementation detail of OBP then
implement the functionality within a #define AOUT_HEADER_COPY section so
it can easily be removed if people really need a strictly compliant firmware.
Signed-off-by: Olivier Danet <odanet at caramail.com>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
Modified:
trunk/openbios-devel/libopenbios/aout_load.c
Modified: trunk/openbios-devel/libopenbios/aout_load.c
==============================================================================
--- trunk/openbios-devel/libopenbios/aout_load.c Sun Feb 16 17:26:31 2014 (r1264)
+++ trunk/openbios-devel/libopenbios/aout_load.c Sun Feb 16 17:26:34 2014 (r1265)
@@ -10,6 +10,12 @@
#define CONFIG_SPARC64_PAGE_SIZE_8KB
#endif
+/* NextStep bootloader on SPARC32 expects the a.out header directly
+ below load-base (0x4000) */
+#ifdef CONFIG_SPARC32
+#define AOUT_HEADER_COPY
+#endif
+
#include "libopenbios/sys_info.h"
#include "libopenbios/bindings.h"
#include "libopenbios/aout_load.h"
@@ -143,6 +149,11 @@
debug("Loaded %lu bytes\n", size);
debug("entry point is %#lx\n", start);
+#ifdef AOUT_HEADER_COPY
+ // Copy the a.out header just before start
+ memcpy((char *)(start - 0x20), &ehdr, 0x20);
+#endif
+
// Initialise saved-program-state
PUSH(addr_fixup(start));
feval("saved-program-state >sps.entry !");
More information about the OpenBIOS
mailing list