redboot on QEMU for mini2440


最近有空呼吸新鲜空气,重新拿起来了eCos,做点东西共享给大家。

rt-thread最近很火,在mini2440的qemu平台上发表了测试和代码,这无疑给更多的爱好者以新的学习机会。

这段时间一直在研究ecos,所以有了把ecos移植到mini2440的qemu平台的想法。经过几天的折腾,终于可以在qemu的上面看到redboot的命令了。

先看看成果,然后进入枯燥的coding历程 

现在开始看代码,:-) 

1. 获得代码 

git clone git://repo.or.cz/qemu/mini2440.git  qemu 

修改启动部分为ram的最小地址直接启动

  1. ricky@ricky-laptop:~/ecos/projects/mini2440-qemu/mini2440$ git diff  
  2. diff --git a/hw/mini2440.c b/hw/mini2440.c  
  3. index 5decf4b..7a70aae 100644  
  4. --- a/hw/mini2440.c  
  5. +++ b/hw/mini2440.c  
  6. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)  
  7.      struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;  
  8.      uint32_t image_size;  
  9.    
  10. -       /* 
  11. -        * Normally we would load 4 KB of nand to SRAM and jump there, but 
  12. -        * it is not working perfectly as expected, so we cheat and load 
  13. -        * it from nand directly relocated to 0x33f80000 and jump there 
  14. -        */  
  15. -       if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1  
  16. -               mini2440_printf("loaded default u-boot from NAND/n");  
  17. -               s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start addr 
  18. -       } 
  19. -#if 0 && defined(LATER) 
  20. -       if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM 
  21. -           s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT;     /* start address 
  22. -           mini2440_printf("4KB SteppingStone loaded from NAND/n"); 
  23. -       } 
  24. -#endif 
  25. : 
  26. diff --git a/hw/mini2440.c b/hw/mini2440.c 
  27. index 5decf4b..7a70aae 100644 
  28. --- a/hw/mini2440.c 
  29. +++ b/hw/mini2440.c 
  30. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque) 
  31.      struct mini2440_board_s *s = (struct mini2440_board_s *) opaque; 
  32.      uint32_t image_size; 
  33.   
  34. -       /* 
  35. -        * Normally we would load 4 KB of nand to SRAM and jump there, but 
  36. -        * it is not working perfectly as expected, so we cheat and load 
  37. -        * it from nand directly relocated to 0x33f80000 and jump there 
  38. -        */  
  39. -       if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*10  
  40. -               mini2440_printf("loaded default u-boot from NAND/n");  
  41. -               s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start addre 
  42. -       } 
  43. -#if 0 && defined(LATER) 
  44. -       if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_ 
  45. -           s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT;     /* start address, 
  46. -           mini2440_printf("4KB SteppingStone loaded from NAND/n"); 
  47. -       } 
  48. -#endif 
  49. -       /* 
  50. : 
  51. diff --git a/hw/mini2440.c b/hw/mini2440.c 
  52. index 5decf4b..7a70aae 100644 
  53. --- a/hw/mini2440.c 
  54. +++ b/hw/mini2440.c 
  55. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque) 
  56.      struct mini2440_board_s *s = (struct mini2440_board_s *) opaque; 
  57.      uint32_t image_size; 
  58.   
  59. -       /* 
  60. -        * Normally we would load 4 KB of nand to SRAM and jump there, but 
  61. -        * it is not working perfectly as expected, so we cheat and load 
  62. -        * it from nand directly relocated to 0x33f80000 and jump there 
  63. -        */  
  64. -       if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*102  
  65. -               mini2440_printf("loaded default u-boot from NAND/n");  
  66. -               s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start addres 
  67. -       } 
  68. -#if 0 && defined(LATER) 
  69. -       if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_S 
  70. -           s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT;     /* start address,  
  71. -           mini2440_printf("4KB SteppingStone loaded from NAND/n"); 
  72. -       } 
  73. -#endif 
  74. -       /* 
  75. -        * if a u--boot is available as a file, we always use it 
  76. : 
  77. diff --git a/hw/mini2440.c b/hw/mini2440.c 
  78. index 5decf4b..7a70aae 100644 
  79. --- a/hw/mini2440.c 
  80. +++ b/hw/mini2440.c 
  81. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque) 
  82.      struct mini2440_board_s *s = (struct mini2440_board_s *) opaque; 
  83.      uint32_t image_size; 
  84.   
  85. -       /* 
  86. -        * Normally we would load 4 KB of nand to SRAM and jump there, but 
  87. -        * it is not working perfectly as expected, so we cheat and load 
  88. -        * it from nand directly relocated to 0x33f80000 and jump there 
  89. -        */  
  90. -       if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1024)>  
  91. -               mini2440_printf("loaded default u-boot from NAND/n");  
  92. -               s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address,  
  93. -       } 
  94. -#if 0 && defined(LATER) 
  95. -       if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_SIZE 
  96. -           s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT;     /* start address, u-b 
  97. -           mini2440_printf("4KB SteppingStone loaded from NAND/n"); 
  98. -       } 
  99. -#endif 
  100. -       /* 
  101. -        * if a u--boot is available as a file, we always use it 
  102. -        */  
  103. -       {  
  104. -           image_size = load_image("mini2440/u-boot.bin", qemu_get_ram_ptr(0x03f8000  
  105. :  
  106. diff --git a/hw/mini2440.c b/hw/mini2440.c  
  107. index 5decf4b..7a70aae 100644  
  108. --- a/hw/mini2440.c  
  109. +++ b/hw/mini2440.c  
  110. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)  
  111.      struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;  
  112.      uint32_t image_size;  
  113.    
  114. -       /* 
  115. -        * Normally we would load 4 KB of nand to SRAM and jump there, but 
  116. -        * it is not working perfectly as expected, so we cheat and load 
  117. -        * it from nand directly relocated to 0x33f80000 and jump there 
  118. -        */  
  119. -       if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1024)> 0)  
  120. -               mini2440_printf("loaded default u-boot from NAND/n");  
  121. -               s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address, u-b 
  122. -       } 
  123. -#if 0 && defined(LATER) 
  124. -       if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_SIZE) > 
  125. -           s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT;     /* start address, u-boot 
  126. -           mini2440_printf("4KB SteppingStone loaded from NAND/n"); 
  127. -       } 
  128. -#endif 
  129. -       /* 
  130. -        * if a u--boot is available as a file, we always use it 
  131. -        */  
  132. -       {  
  133. -           image_size = load_image("mini2440/u-boot.bin", qemu_get_ram_ptr(0x03f80000))  
  134. -           if (image_size < 0)  
  135. -                   image_size = load_image("u-boot.bin", qemu_get_ram_ptr(0x03f80000));  
  136. -               if (image_size > 0) {  
  137. :  
  138. diff --git a/hw/mini2440.c b/hw/mini2440.c  
  139. index 5decf4b..7a70aae 100644  
  140. --- a/hw/mini2440.c  
  141. +++ b/hw/mini2440.c  
  142. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)  
  143.      struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;  
  144.      uint32_t image_size;  
  145.    
  146. -       /* 
  147. -        * Normally we would load 4 KB of nand to SRAM and jump there, but 
  148. -        * it is not working perfectly as expected, so we cheat and load 
  149. -        * it from nand directly relocated to 0x33f80000 and jump there 
  150. -        */  
  151. -       if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1024)> 0) {  
  152. -               mini2440_printf("loaded default u-boot from NAND/n");  
  153. -               s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address, u-boot  
  154. -       } 
  155. -#if 0 && defined(LATER) 
  156. -       if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_SIZE) > 0)  
  157. -           s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT;     /* start address, u-boot rel 
  158. -           mini2440_printf("4KB SteppingStone loaded from NAND/n"); 
  159. -       } 
  160. -#endif 
  161. -       /* 
  162. -        * if a u--boot is available as a file, we always use it 
  163. -        */  
  164. -       {  
  165. -           image_size = load_image("mini2440/u-boot.bin", qemu_get_ram_ptr(0x03f80000));  
  166. -           if (image_size < 0)  
  167. -                   image_size = load_image("u-boot.bin", qemu_get_ram_ptr(0x03f80000));  
  168. -               if (image_size > 0) {  
  169. -                       if (image_size & (512 -1))      /* round size to a NAND block size * 
  170. -                               image_size = (image_size + 512) & ~(512-1); 
  171. -                       mini2440_printf("loaded override u-boot (size %x)/n", image_size); 
  172. : 
  173. diff --git a/hw/mini2440.c b/hw/mini2440.c 
  174. index 5decf4b..7a70aae 100644 
  175. --- a/hw/mini2440.c 
  176. +++ b/hw/mini2440.c 
  177. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque) 
  178.      struct mini2440_board_s *s = (struct mini2440_board_s *) opaque; 
  179.      uint32_t image_size; 
  180.   
  181. -       /* 
  182. -        * Normally we would load 4 KB of nand to SRAM and jump there, but 
  183. -        * it is not working perfectly as expected, so we cheat and load 
  184. -        * it from nand directly relocated to 0x33f80000 and jump there 
  185. -        */  
  186. -       if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1024)> 0) {  
  187. -               mini2440_printf("loaded default u-boot from NAND/n");  
  188. -               s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address, u-boot alrea 
  189. -       } 
  190. -#if 0 && defined(LATER) 
  191. -       if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_SIZE) > 0) { 
  192. -           s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT;     /* start address, u-boot relocati 
  193. -           mini2440_printf("4KB SteppingStone loaded from NAND/n"); 
  194. -       } 
  195. -#endif 
  196. -       /* 
  197. -        * if a u--boot is available as a file, we always use it 
  198. -        */  
  199. -       {  
  200. -           image_size = load_image("mini2440/u-boot.bin", qemu_get_ram_ptr(0x03f80000));  
  201. -           if (image_size < 0)  
  202. -                   image_size = load_image("u-boot.bin", qemu_get_ram_ptr(0x03f80000));  
  203. -               if (image_size > 0) {  
  204. -                       if (image_size & (512 -1))      /* round size to a NAND block size */  
  205. -                               image_size = (image_size + 512) & ~(512-1);  
  206. -                       mini2440_printf("loaded override u-boot (size %x)/n", image_size);  
  207. -                   s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000;  /* start address, u-boot  
  208. -               } 
  209. -       } 
  210. : 
  211. diff --git a/hw/mini2440.c b/hw/mini2440.c 
  212. index 5decf4b..7a70aae 100644 
  213. --- a/hw/mini2440.c 
  214. +++ b/hw/mini2440.c 
  215. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque) 
  216.      struct mini2440_board_s *s = (struct mini2440_board_s *) opaque; 
  217.      uint32_t image_size; 
  218.   
  219. -       /* 
  220. -        * Normally we would load 4 KB of nand to SRAM and jump there, but 
  221. -        * it is not working perfectly as expected, so we cheat and load 
  222. -        * it from nand directly relocated to 0x33f80000 and jump there 
  223. -        */  
  224. -       if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1024)> 0) {  
  225. -               mini2440_printf("loaded default u-boot from NAND/n");  
  226. -               s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address, u-boot already relo 
  227. -       } 
  228. -#if 0 && defined(LATER) 
  229. -       if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_SIZE) > 0) { 
  230. -           s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT;     /* start address, u-boot relocating code 
  231. -           mini2440_printf("4KB SteppingStone loaded from NAND/n"); 
  232. -       } 
  233. -#endif 
  234. -       /* 
  235. -        * if a u--boot is available as a file, we always use it 
  236. -        */  
  237. -       {  
  238. -           image_size = load_image("mini2440/u-boot.bin", qemu_get_ram_ptr(0x03f80000));  
  239. -           if (image_size < 0)  
  240. -                   image_size = load_image("u-boot.bin", qemu_get_ram_ptr(0x03f80000));  
  241. -               if (image_size > 0) {  
  242. -                       if (image_size & (512 -1))      /* round size to a NAND block size */  
  243. -                               image_size = (image_size + 512) & ~(512-1);  
  244. -                       mini2440_printf("loaded override u-boot (size %x)/n", image_size);  
  245. -                   s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000;  /* start address, u-boot already 
  246. -               } 
  247. -       } 
  248. -       /* 
  249. -        * if a kernel was explicitly specified, we load it too 
  250. -        */  
  251. -       if (s->kernel) {  
  252. -               image_size = load_image(s->kernel, qemu_get_ram_ptr(0x02000000));  
  253. :  
  254. diff --git a/hw/mini2440.c b/hw/mini2440.c  
  255. index 5decf4b..7a70aae 100644  
  256. --- a/hw/mini2440.c  
  257. +++ b/hw/mini2440.c  
  258. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)  
  259.      struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;  
  260.      uint32_t image_size;  
  261.    
  262. -       /* 
  263. -        * Normally we would load 4 KB of nand to SRAM and jump there, but 
  264. -        * it is not working perfectly as expected, so we cheat and load 
  265. -        * it from nand directly relocated to 0x33f80000 and jump there 
  266. -        */  
  267. -       if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1024)> 0) {  
  268. -               mini2440_printf("loaded default u-boot from NAND/n");  
  269. -               s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address, u-boot already relocated  
  270. -       } 
  271. -#if 0 && defined(LATER) 
  272. -       if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_SIZE) > 0) { 
  273. -           s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT;     /* start address, u-boot relocating code */  
  274. -           mini2440_printf("4KB SteppingStone loaded from NAND/n");  
  275. -       }  
  276. -#endif  
  277. -       /* 
  278. -        * if a u--boot is available as a file, we always use it 
  279. -        */  
  280. -       {  
  281. -           image_size = load_image("mini2440/u-boot.bin", qemu_get_ram_ptr(0x03f80000));  
  282. -           if (image_size < 0)  
  283. -                   image_size = load_image("u-boot.bin", qemu_get_ram_ptr(0x03f80000));  
  284. -               if (image_size > 0) {  
  285. -                       if (image_size & (512 -1))      /* round size to a NAND block size */  
  286. -                               image_size = (image_size + 512) & ~(512-1);  
  287. -                       mini2440_printf("loaded override u-boot (size %x)/n", image_size);  
  288. -                   s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000;  /* start address, u-boot already reloc 
  289. -               } 
  290. -       } 
  291. -       /* 
  292. -        * if a kernel was explicitly specified, we load it too 
  293. -        */  
  294. -       if (s->kernel) {  
  295. -               image_size = load_image(s->kernel, qemu_get_ram_ptr(0x02000000));  
  296. -               if (image_size > 0) {  
  297. -                       if (image_size & (512 -1))      /* round size to a NAND block size */  
  298. :  
  299. diff --git a/hw/mini2440.c b/hw/mini2440.c  
  300. index 5decf4b..7a70aae 100644  
  301. --- a/hw/mini2440.c  
  302. +++ b/hw/mini2440.c  
  303. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)  
  304.      struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;  
  305.      uint32_t image_size;  
  306.    
  307. -       /* 
  308. -        * Normally we would load 4 KB of nand to SRAM and jump there, but 
  309. -        * it is not working perfectly as expected, so we cheat and load 
  310. -        * it from nand directly relocated to 0x33f80000 and jump there 
  311. -        */  
  312. -       if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1024)> 0) {  
  313. -               mini2440_printf("loaded default u-boot from NAND/n");  
  314. -               s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address, u-boot already relocated * 
  315. -       } 
  316. -#if 0 && defined(LATER) 
  317. -       if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_SIZE) > 0) { 
  318. -           s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT;     /* start address, u-boot relocating code */  
  319. -           mini2440_printf("4KB SteppingStone loaded from NAND/n");  
  320. -       }  
  321. -#endif  
  322. -       /* 
  323. -        * if a u--boot is available as a file, we always use it 
  324. -        */  
  325. -       {  
  326. -           image_size = load_image("mini2440/u-boot.bin", qemu_get_ram_ptr(0x03f80000));  
  327. -           if (image_size < 0)  
  328. -                   image_size = load_image("u-boot.bin", qemu_get_ram_ptr(0x03f80000));  
  329. -               if (image_size > 0) {  
  330. -                       if (image_size & (512 -1))      /* round size to a NAND block size */  
  331. -                               image_size = (image_size + 512) & ~(512-1);  
  332. -                       mini2440_printf("loaded override u-boot (size %x)/n", image_size);  
  333. -                   s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000;  /* start address, u-boot already reloca 
  334. -               } 
  335. -       } 
  336. -       /* 
  337. -        * if a kernel was explicitly specified, we load it too 
  338. -        */  
  339. -       if (s->kernel) {  
  340. -               image_size = load_image(s->kernel, qemu_get_ram_ptr(0x02000000));  
  341. -               if (image_size > 0) {  
  342. -                       if (image_size & (512 -1))      /* round size to a NAND block size */  
  343. -                               image_size = (image_size + 512) & ~(512-1);  
  344. :  
  345. diff --git a/hw/mini2440.c b/hw/mini2440.c  
  346. index 5decf4b..7a70aae 100644  
  347. --- a/hw/mini2440.c  
  348. +++ b/hw/mini2440.c  
  349. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)  
  350.      struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;  
  351.      uint32_t image_size;  
  352.    
  353. -       /* 
  354. -        * Normally we would load 4 KB of nand to SRAM and jump there, but 
  355. -        * it is not working perfectly as expected, so we cheat and load 
  356. -        * it from nand directly relocated to 0x33f80000 and jump there 
  357. -        */  
  358. -       if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1024)> 0) {  
  359. -               mini2440_printf("loaded default u-boot from NAND/n");  
  360. -               s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address, u-boot already relocated * 
  361. -       } 
  362. -#if 0 && defined(LATER) 
  363. -       if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_SIZE) > 0) { 
  364. -           s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT;     /* start address, u-boot relocating code */  
  365. -           mini2440_printf("4KB SteppingStone loaded from NAND/n");  
  366. -       }  
  367. -#endif  
  368. -       /* 
  369. -        * if a u--boot is available as a file, we always use it 
  370. -        */  
  371. -       {  
  372. -           image_size = load_image("mini2440/u-boot.bin", qemu_get_ram_ptr(0x03f80000));  
  373. -           if (image_size < 0)  
  374. -                   image_size = load_image("u-boot.bin", qemu_get_ram_ptr(0x03f80000));  
  375. -               if (image_size > 0) {  
  376. -                       if (image_size & (512 -1))      /* round size to a NAND block size */  
  377. -                               image_size = (image_size + 512) & ~(512-1);  
  378. -                       mini2440_printf("loaded override u-boot (size %x)/n", image_size);  
  379. -                   s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000;  /* start address, u-boot already reloca 
  380. -               } 
  381. -       } 
  382. -       /* 
  383. -        * if a kernel was explicitly specified, we load it too 
  384. -        */  
  385. -       if (s->kernel) {  
  386. -               image_size = load_image(s->kernel, qemu_get_ram_ptr(0x02000000));  
  387. -               if (image_size > 0) {  
  388. -                       if (image_size & (512 -1))      /* round size to a NAND block size */  
  389. -                               image_size = (image_size + 512) & ~(512-1);  
  390. -                       mini2440_printf("loaded %s (size %x)/n", s->kernel, image_size);  
  391. -           }  
  392. -       }  
  393. +    if (s->kernel) {  
  394. +       image_size = load_image(s->kernel, qemu_get_ram_ptr(0));  
  395. +       if (image_size > 0) {  
  396. +           if (image_size & (512 -1))    
  397. +               image_size = (image_size + 512) & ~(512-1);              
  398. +           s->cpu->env->regs[15] = S3C_RAM_BASE ;  
  399. +           mini2440_printf("loaded kernel %s at %p/n", s->kernel, s->cpu->env->regs[15]);  
  400. +       }  
  401. +    }  
  402.  }  
  403.    
  404.  /* Typical touchscreen calibration values */  
  405. @@ -353,6 +322,11 @@ static struct mini2440_board_s *mini2440_init_common(int ram_size,  
  406.      return s;  
  407.  }  
  408.    
  409.    
  410.  static void mini2440_init(ram_addr_t ram_size,  
  411.          const char *boot_device,  
  412. @@ -371,9 +345,18 @@ static void mini2440_init(ram_addr_t ram_size,  
  413.      mini = mini2440_init_common(ram_size,  
  414.                      kernel_filename, cpu_model, sd);  
  415.    
  416.        mini->nand = nand_init(NAND_MFR_SAMSUNG, 0x76);  
  417.      mini->cpu->nand->reg(mini->cpu->nand, mini->nand);  
  418.    
  419.      mini2440_reset(mini);  
  420.  }   
编译qemu for mini2440
./configure --target-list=arm-softmmu --disable-linux-user;make

安装,或者直接copy arm-softmmu里面的可执行文件也可以。

  • 1
  • 2
  • 下一页

相关内容