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 5254997ec5909c6c1c24155690468998ed19a35f..c5dbaf3bed2b89236c924da53265439b667f6497 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 bb17cf0900a30222fa9bd32d0384caf7e1c64083..94b860e27442259b7dd40da76de9e4f850b4857f 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)