X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/e73e717239300d6b47d5f5d81256d8feb493299f..5d32e2bf6029c9efe5d191c13b82d59f6515e789:/armsrc/start.c?ds=sidebyside diff --git a/armsrc/start.c b/armsrc/start.c index de2dd2f6..0466a92f 100644 --- a/armsrc/start.c +++ b/armsrc/start.c @@ -6,7 +6,22 @@ #include #include "apps.h" +extern char __data_start__, __data_src_start__, __data_end__, __bss_start__, __bss_end__; void __attribute__((section(".startos"))) Vector(void) { + /* Stack should have been set up by the bootloader */ + char *src, *dst, *end; + + /* Set up (that is: clear) BSS. */ + dst = &__bss_start__; + end = &__bss_end__; + while(dst < end) *dst++ = 0; + + /* Set up data segment: Copy from flash to ram */ + src = &__data_src_start__; + dst = &__data_start__; + end = &__data_end__; + while(dst < end) *dst++ = *src++; + AppMain(); }