From 04a934987445897a03652aa73e2a5c5088d40ba1 Mon Sep 17 00:00:00 2001 From: Flavian Kaufmann Date: Fri, 28 Jun 2024 16:10:11 +0200 Subject: added ddca notes reference --- prog/src/startup.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'prog/src/startup.c') diff --git a/prog/src/startup.c b/prog/src/startup.c index b587a95..ad9b9b6 100644 --- a/prog/src/startup.c +++ b/prog/src/startup.c @@ -5,15 +5,16 @@ extern unsigned int _sbss; // start of .bss section extern unsigned int _ebss; // end of .bss section extern unsigned int _estack; // end of .stack section (stack top) -//void main(void); // main function declaration +extern void main(void); // main function declaration extern void test_prog(void); -void _start(void) __attribute__((section(".text.startup"), naked)); // entry point, cpu starts executing from here - void _start(void) -{ - //test_prog(); + __attribute__((section(".text.startup"), + naked)); // entry point, cpu starts executing from here + +void _start(void) { + // test_prog(); unsigned int *src, *dst; @@ -29,11 +30,12 @@ void _start(void) } // initialize stack pointer - asm volatile ("la sp, _estack"); + asm volatile("la sp, _estack"); // call main function main(); // halt - while (1); + while (1) + ; } -- cgit v1.2.3