Make sure we zero bss before calling rombios32 code.
authorKevin O'Connor <kevin@koconnor.net>
Mon, 17 Mar 2008 01:07:33 +0000 (21:07 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 17 Mar 2008 01:07:33 +0000 (21:07 -0400)
This fixes reboots.

src/post.c
src/rombios32.lds.S

index 5254997..c5dbaf3 100644 (file)
@@ -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();
index bb17cf0..94b860e 100644 (file)
@@ -23,7 +23,7 @@ SECTIONS
         . = 0x00040000;
         __bss_start = . ;
         .bss      : { *(.bss) *(COMMON) }
-        _end = . ;
+        __bss_end = . ;
         __call16_from32 = (0xf0000 | OFFSET___call16_from32) ;
         /DISCARD/ : { *(.stab)
                      *(.stabstr)