Libpayload needs to clear the bss region.
[coreboot.git] / payloads / libpayload / arch / i386 / head.S
index db18a5195fc1be97aecf135a5196a672dda99837..88db4124d5627cca620419a8da4e16df44788cde 100644 (file)
@@ -70,10 +70,17 @@ _init:
        movl %esp, %esi
 
        /* Store EAX and EBX */
-
        movl %eax,loader_eax
        movl %ebx,loader_ebx
 
+       /* Clear the bss */
+       cld
+       movl $.bss, %edi
+       movl $_end, %ecx
+       subl %edi, %ecx
+       xor %ax, %ax
+       rep stosb
+
        /* Setup new stack. */
        movl $_stack, %ebx