From 55bf2e49d66af779e3e514db1bd716b354329559 Mon Sep 17 00:00:00 2001 From: Marc Jones Date: Tue, 28 Jun 2011 14:30:05 -0600 Subject: Libpayload needs to clear the bss region. Libpayload shouldn't count on coreboot or other payloads to clear memory. This fixes problems with payloads being loaded after or on top of each other. Change-Id: I30303d47e465e8921f47acab667c7998ba79fca7 Signed-off-by: Marc Jones Reviewed-on: http://review.coreboot.org/66 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- payloads/libpayload/arch/i386/head.S | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'payloads/libpayload') diff --git a/payloads/libpayload/arch/i386/head.S b/payloads/libpayload/arch/i386/head.S index db18a5195f..88db4124d5 100644 --- a/payloads/libpayload/arch/i386/head.S +++ b/payloads/libpayload/arch/i386/head.S @@ -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 -- cgit v1.2.3