X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/8652988d62b19631e498b62a3800f0decb5e743a..fa03a110e92f32a0bbe247c511b332fb5cc99d4e:/bootrom/fromflash.c

diff --git a/bootrom/fromflash.c b/bootrom/fromflash.c
index f6d5237c..6b41c408 100644
--- a/bootrom/fromflash.c
+++ b/bootrom/fromflash.c
@@ -1,11 +1,13 @@
 #include <proxmark3.h>
 
-void __attribute__((section("bootphase1"))) CopyBootToRAM(void)
+extern char __bootphase2_src_start__, __bootphase2_start__, __bootphase2_end__;
+void __attribute__((section(".bootphase1"))) CopyBootToRAM(void)
 {
 	int i;
 
-	volatile DWORD *s = (volatile DWORD *)0x200;
-	volatile DWORD *d = (volatile DWORD *)0x200000;
+	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 < 1024; i++) *d++ = *s++;
+	for(i = 0; i < l/sizeof(DWORD); i++) *d++ = *s++;
 }