aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2008-03-16 21:07:33 -0400
committerKevin O'Connor <kevin@koconnor.net>2008-03-16 21:07:33 -0400
commit7958de33034ab22490ed14f6766324fb1cb5399c (patch)
tree63a6b3ca3ae3ce8817e471ca5d9de9aec97c3e63
parenta0dc29629c0091449a4065a93812e8522e7d0540 (diff)
downloadseabios-7958de33034ab22490ed14f6766324fb1cb5399c.tar.gz
Make sure we zero bss before calling rombios32 code.
This fixes reboots.
-rw-r--r--src/post.c4
-rw-r--r--src/rombios32.lds.S2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/post.c b/src/post.c
index 5254997e..c5dbaf3b 100644
--- a/src/post.c
+++ b/src/post.c
@@ -381,6 +381,10 @@ post()
printf("BIOS - begin\n\n");
+ // clear bss section -- XXX - shouldn't use globals
+ extern char __bss_start[], __bss_end[];
+ memset(__bss_start, 0, __bss_end - __bss_start);
+
rombios32_init();
init_boot_vectors();
diff --git a/src/rombios32.lds.S b/src/rombios32.lds.S
index bb17cf09..94b860e2 100644
--- a/src/rombios32.lds.S
+++ b/src/rombios32.lds.S
@@ -23,7 +23,7 @@ SECTIONS
. = 0x00040000;
__bss_start = . ;
.bss : { *(.bss) *(COMMON) }
- _end = . ;
+ __bss_end = . ;
__call16_from32 = (0xf0000 | OFFSET___call16_from32) ;
/DISCARD/ : { *(.stab)
*(.stabstr)