From d43255d4846c4630d9b77cf08583e7a92dfaedd1 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Tue, 8 May 2018 14:44:28 +0200 Subject: [PATCH] Fix bug in crt0 --- fusee/fusee-primary/src/start.s | 2 ++ fusee/fusee-secondary/src/main.c | 1 + fusee/fusee-secondary/src/start.s | 2 ++ 3 files changed, 5 insertions(+) diff --git a/fusee/fusee-primary/src/start.s b/fusee/fusee-primary/src/start.s index 2b4fd7694..d4280470f 100644 --- a/fusee/fusee-primary/src/start.s +++ b/fusee/fusee-primary/src/start.s @@ -41,6 +41,8 @@ _start: ldr r0, =__program_argc ldr r1, =__program_argv ldr lr, =__program_exit + ldr r0, [r0] + ldr r1, [r1] b main /* No need to include this in normal programs: */ diff --git a/fusee/fusee-secondary/src/main.c b/fusee/fusee-secondary/src/main.c index bd3ba4796..10a56935b 100644 --- a/fusee/fusee-secondary/src/main.c +++ b/fusee/fusee-secondary/src/main.c @@ -47,6 +47,7 @@ int main(int argc, void **argv) { g_stage2_args = (stage2_args_t *)argv[STAGE2_ARGV_ARGUMENT_STRUCT]; if(g_stage2_args->version != 0) { + printf("Error: Incorrect Stage2 args version (expected %lu, got %lu)!\n", 0lu, g_stage2_args->version); generic_panic(); } diff --git a/fusee/fusee-secondary/src/start.s b/fusee/fusee-secondary/src/start.s index 2b4fd7694..d4280470f 100644 --- a/fusee/fusee-secondary/src/start.s +++ b/fusee/fusee-secondary/src/start.s @@ -41,6 +41,8 @@ _start: ldr r0, =__program_argc ldr r1, =__program_argv ldr lr, =__program_exit + ldr r0, [r0] + ldr r1, [r1] b main /* No need to include this in normal programs: */