]>
Commit | Line | Data |
---|---|---|
1 | //----------------------------------------------------------------------------- | |
2 | // Jonathan Westhues, Mar 2006 | |
3 | // | |
4 | // This code is licensed to you under the terms of the GNU GPL, version 2 or, | |
5 | // at your option, any later version. See the LICENSE.txt file for the text of | |
6 | // the license. | |
7 | //----------------------------------------------------------------------------- | |
8 | // Just vector to AppMain(). This is in its own file so that I can place it | |
9 | // with the linker script. | |
10 | //----------------------------------------------------------------------------- | |
11 | ||
12 | #include "../include/proxmark3.h" | |
13 | #include "apps.h" | |
14 | ||
15 | extern char __data_start__, __data_src_start__, __data_end__, __bss_start__, __bss_end__; | |
16 | void __attribute__((section(".startos"))) Vector(void) | |
17 | { | |
18 | /* Stack should have been set up by the bootloader */ | |
19 | char *src, *dst, *end; | |
20 | ||
21 | /* Set up (that is: clear) BSS. */ | |
22 | dst = &__bss_start__; | |
23 | end = &__bss_end__; | |
24 | while(dst < end) *dst++ = 0; | |
25 | ||
26 | /* Set up data segment: Copy from flash to ram */ | |
27 | src = &__data_src_start__; | |
28 | dst = &__data_start__; | |
29 | end = &__data_end__; | |
30 | while(dst < end) *dst++ = *src++; | |
31 | ||
32 | AppMain(); | |
33 | } |