From 92f9544d8c2d673322a6e0be487cf8952c95c99b Mon Sep 17 00:00:00 2001 From: marcan Date: Thu, 26 Mar 2009 05:15:05 +0100 Subject: [PATCH] Clear stack to 0xDEADBEEF for debugging --- start.S | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/start.S b/start.S index 388cdb7..91a47ad 100644 --- a/start.S +++ b/start.S @@ -44,10 +44,24 @@ v_reset: @ Output 0x42 to the debug port mov r0, #0x42 bl debug_output - + @ Set up a stack ldr sp, =__stack_addr + @ clear the stack to a marker value + ldr r1, =__stack_end + ldr r2, =__stack_addr + ldr r3, =0xDEADBEEF +stk_loop: + @ check for the end + cmp r1, r2 + beq done_stk + @ clear the word and move on + str r3, [r1] + add r1, r1, #4 + b stk_loop + +done_stk: @ clear BSS ldr r1, =__bss_start ldr r2, =__bss_end