X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/8a6aec16d8c21d3c57457e5ec00eb83f5242feba..272e55ca64b5ee35e483f2ad2327a2e147f97779:/bootrom/fromflash.c?ds=sidebyside diff --git a/bootrom/fromflash.c b/bootrom/fromflash.c index 0065e19e..80403e5f 100644 --- a/bootrom/fromflash.c +++ b/bootrom/fromflash.c @@ -1,11 +1,13 @@ -#include - -void __attribute__((section(".bootphase1"))) CopyBootToRAM(void) -{ - int i; - - volatile DWORD *s = (volatile DWORD *)0x200; - volatile DWORD *d = (volatile DWORD *)0x200000; - - for(i = 0; i < 1024; i++) *d++ = *s++; -} +#include + +extern char __bootphase2_src_start__, __bootphase2_start__, __bootphase2_end__; +void __attribute__((section(".bootphase1"))) CopyBootToRAM(void) +{ + int i; + + volatile DWORD *s = (volatile DWORD *)&__bootphase2_src_start__; + volatile DWORD *d = (volatile DWORD *)&__bootphase2_start__; + unsigned int l = (int)&__bootphase2_end__ - (int)&__bootphase2_start__; + + for(i = 0; i < l/sizeof(DWORD); i++) *d++ = *s++; +}