




已阅读5页,还剩17页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
使用qemu 建立mini2440的模拟仿真环境1. 首先下载qemu for mini2440git clone git:/repo.or.cz/qemu/mini2440.git qemu如果感觉速度慢,直接打包下载http:/repo.or.cz/w/qemu/mini2440.git/snapshot/HEAD.tar.gz解压后,今日源代码的主目录中,12# ./configure -target-list=arm-softmmu# make -j42. 下载u-boot for mini2440git clonegit:/repo.or.cz/w/u-boot-openmoko/mini2440.git uboot或者打包下载http:/repo.or.cz/w/u-boot-openmoko/mini2440.git/snapshot/HEAD.tar.gz(注意 采用打包下载的时候这几个包的文件名可能相同,注意区分)解压后,配置Makefile文件,打开Makefile文件,CROSS_COMPILE变量赋值,即自己所使用的交叉编译工具链,比如我的是arm-none-linux-gnueabi-,保存退出,输入12# make mini2440_config# make -j4稍等两分钟,即在当前目录下生成名为 u-boot.bin 的文件,注意如果想在之后使用u-boot 的nfs下载文件功能,需要修改代码中的一部分,将net/nfs.c文件中的NFS_TIMEOUT = 2UL 修改为 NFS_TIMEOUT = 20000UL 否则会造成nfs文件下载失败,如果不使用nfs下载功能,不改也可。然后将u-boot.bin文件拷贝到qemu-mini2440/mini2440文件夹下。3. 下载 linux kernel for mini2440(可以使用原mini2440开发板的内核源代码)(下载步骤略去)进入源码目录12#make mini2440_defconfig ARCH=arm#make uImage之后会在arch/arm/boot/目录下生成uImage 文件,将此文件复制到qemu目录下的mini2440文件夹下,并将mini2440文件夹中的mini2440_start.sh作如下修改将 kernel 一行改为-kernel $base/uImage ,回到上层目录后运行1# sh mini2440/mini2440_start.sh错误解决:一、1.如果在编译QEMU时没有安装,即 make install,那么需要打开mini2440/mini2440_start.sh,将第16行的 qemu-img改为:$base/./qemu-img2.如果编译时安装了QEMU,即有make install,不管这一步骤。二、期待的画面并没有出来,取而代之的是:/etc/qemu-ifup:could not launch network scriptCould not initialize device tap该错误一般是运行权限错误,使用根用户运行。三、使用根用户运行,依旧是:/etc/qemu-ifup:could not launch network script 。对qemu中的net.c在代码进行修改:static int launch_script(const char *setup_script, const char *ifname, int fd) int pid, status; char *args4; /* bacon modified */ char *parg; /* try to launch network script */ pid = fork(); if (pid = 0) if (pid = 0) char path20;/* bacon add */ int open_max = sysconf (_SC_OPEN_MAX), i; for (i = 0; i nand,0,S3C_RAM_BASE|0x03f80000,256*116. -mini2440_printf(loadeddefaultu-bootfromNAND/n);17. -s-cpu-env-regs15=S3C_RAM_BASE|0x03f80000;/*startaddr18. -19. -#if0&defined(LATER)20. -if(mini2440_load_from_nand(s-nand,0,S3C_SRAM_BASE_NANDBOOT,S3C_SRAM21. -s-cpu-env-regs15=S3C_SRAM_BASE_NANDBOOT;/*startaddress22. -mini2440_printf(4KBSteppingStoneloadedfromNAND/n);23. -24. -#endif25. :26. diff-gita/hw/mini2440.cb/hw/mini2440.c27. index5decf4b.7a70aae10064428. -a/hw/mini2440.c29. +b/hw/mini2440.c30. -258,46+258,15staticvoidmini2440_reset(void*opaque)31. structmini2440_board_s*s=(structmini2440_board_s*)opaque;32. uint32_timage_size;33. 34. -/*35. -*Normallywewouldload4KBofnandtoSRAMandjumpthere,but36. -*itisnotworkingperfectlyasexpected,sowecheatandload37. -*itfromnanddirectlyrelocatedto0x33f80000andjumpthere38. -*/39. -if(mini2440_load_from_nand(s-nand,0,S3C_RAM_BASE|0x03f80000,256*1040. -mini2440_printf(loadeddefaultu-bootfromNAND/n);41. -s-cpu-env-regs15=S3C_RAM_BASE|0x03f80000;/*startaddre42. -43. -#if0&defined(LATER)44. -if(mini2440_load_from_nand(s-nand,0,S3C_SRAM_BASE_NANDBOOT,S3C_SRAM_45. -s-cpu-env-regs15=S3C_SRAM_BASE_NANDBOOT;/*startaddress,46. -mini2440_printf(4KBSteppingStoneloadedfromNAND/n);47. -48. -#endif49. -/*50. :51. diff-gita/hw/mini2440.cb/hw/mini2440.c52. index5decf4b.7a70aae10064453. -a/hw/mini2440.c54. +b/hw/mini2440.c55. -258,46+258,15staticvoidmini2440_reset(void*opaque)56. structmini2440_board_s*s=(structmini2440_board_s*)opaque;57. uint32_timage_size;58. 59. -/*60. -*Normallywewouldload4KBofnandtoSRAMandjumpthere,but61. -*itisnotworkingperfectlyasexpected,sowecheatandload62. -*itfromnanddirectlyrelocatedto0x33f80000andjumpthere63. -*/64. -if(mini2440_load_from_nand(s-nand,0,S3C_RAM_BASE|0x03f80000,256*10265. -mini2440_printf(loadeddefaultu-bootfromNAND/n);66. -s-cpu-env-regs15=S3C_RAM_BASE|0x03f80000;/*startaddres67. -68. -#if0&defined(LATER)69. -if(mini2440_load_from_nand(s-nand,0,S3C_SRAM_BASE_NANDBOOT,S3C_SRAM_S70. -s-cpu-env-regs15=S3C_SRAM_BASE_NANDBOOT;/*startaddress,71. -mini2440_printf(4KBSteppingStoneloadedfromNAND/n);72. -73. -#endif74. -/*75. -*ifau-bootisavailableasafile,wealwaysuseit76. :77. diff-gita/hw/mini2440.cb/hw/mini2440.c78. index5decf4b.7a70aae10064479. -a/hw/mini2440.c80. +b/hw/mini2440.c81. -258,46+258,15staticvoidmini2440_reset(void*opaque)82. structmini2440_board_s*s=(structmini2440_board_s*)opaque;83. uint32_timage_size;84. 85. -/*86. -*Normallywewouldload4KBofnandtoSRAMandjumpthere,but87. -*itisnotworkingperfectlyasexpected,sowecheatandload88. -*itfromnanddirectlyrelocatedto0x33f80000andjumpthere89. -*/90. -if(mini2440_load_from_nand(s-nand,0,S3C_RAM_BASE|0x03f80000,256*1024)91. -mini2440_printf(loadeddefaultu-bootfromNAND/n);92. -s-cpu-env-regs15=S3C_RAM_BASE|0x03f80000;/*startaddress,93. -94. -#if0&defined(LATER)95. -if(mini2440_load_from_nand(s-nand,0,S3C_SRAM_BASE_NANDBOOT,S3C_SRAM_SIZE96. -s-cpu-env-regs15=S3C_SRAM_BASE_NANDBOOT;/*startaddress,u-b97. -mini2440_printf(4KBSteppingStoneloadedfromNAND/n);98. -99. -#endif100. -/*101. -*ifau-bootisavailableasafile,wealwaysuseit102. -*/103. -104. -image_size=load_image(mini2440/u-boot.bin,qemu_get_ram_ptr(0x03f8000105. :106. diff-gita/hw/mini2440.cb/hw/mini2440.c107. index5decf4b.7a70aae100644108. -a/hw/mini2440.c109. +b/hw/mini2440.c110. -258,46+258,15staticvoidmini2440_reset(void*opaque)111. structmini2440_board_s*s=(structmini2440_board_s*)opaque;112. uint32_timage_size;113. 114. -/*115. -*Normallywewouldload4KBofnandtoSRAMandjumpthere,but116. -*itisnotworkingperfectlyasexpected,sowecheatandload117. -*itfromnanddirectlyrelocatedto0x33f80000andjumpthere118. -*/119. -if(mini2440_load_from_nand(s-nand,0,S3C_RAM_BASE|0x03f80000,256*1024)0)120. -mini2440_printf(loadeddefaultu-bootfromNAND/n);121. -s-cpu-env-regs15=S3C_RAM_BASE|0x03f80000;/*startaddress,u-b122. -123. -#if0&defined(LATER)124. -if(mini2440_load_from_nand(s-nand,0,S3C_SRAM_BASE_NANDBOOT,S3C_SRAM_SIZE)125. -s-cpu-env-regs15=S3C_SRAM_BASE_NANDBOOT;/*startaddress,u-boot126. -mini2440_printf(4KBSteppingStoneloadedfromNAND/n);127. -128. -#endif129. -/*130. -*ifau-bootisavailableasafile,wealwaysuseit131. -*/132. -133. -image_size=load_image(mini2440/u-boot.bin,qemu_get_ram_ptr(0x03f80000)134. -if(image_size0)137. :138. diff-gita/hw/mini2440.cb/hw/mini2440.c139. index5decf4b.7a70aae100644140. -a/hw/mini2440.c141. +b/hw/mini2440.c142. -258,46+258,15staticvoidmini2440_reset(void*opaque)143. structmini2440_board_s*s=(structmini2440_board_s*)opaque;144. uint32_timage_size;145. 146. -/*147. -*Normallywewouldload4KBofnandtoSRAMandjumpthere,but148. -*itisnotworkingperfectlyasexpected,sowecheatandload149. -*itfromnanddirectlyrelocatedto0x33f80000andjumpthere150. -*/151. -if(mini2440_load_from_nand(s-nand,0,S3C_RAM_BASE|0x03f80000,256*1024)0)152. -mini2440_printf(loadeddefaultu-bootfromNAND/n);153. -s-cpu-env-regs15=S3C_RAM_BASE|0x03f80000;/*startaddress,u-boot154. -155. -#if0&defined(LATER)156. -if(mini2440_load_from_nand(s-nand,0,S3C_SRAM_BASE_NANDBOOT,S3C_SRAM_SIZE)0)157. -s-cpu-env-regs15=S3C_SRAM_BASE_NANDBOOT;/*startaddress,u-bootrel158. -mini2440_printf(4KBSteppingStoneloadedfromNAND/n);159. -160. -#endif161. -/*162. -*ifau-bootisavailableasafile,wealwaysuseit163. -*/164. -165. -image_size=load_image(mini2440/u-boot.bin,qemu_get_ram_ptr(0x03f80000);166. -if(image_size0)169. -if(image_size&(512-1)/*roundsizetoaNANDblocksize*170. -image_size=(image_size+512)&(512-1);171. -mini2440_printf(loadedoverrideu-boot(size%x)/n,image_size);172. :173. diff-gita/hw/mini2440.cb/hw/mini2440.c174. index5decf4b.7a70aae100644175. -a/hw/mini2440.c176. +b/hw/mini2440.c177. -258,46+258,15staticvoidmini2440_reset(void*opaque)178. structmini2440_board_s*s=(structmini2440_board_s*)opaque;179. uint32_timage_size;180. 181. -/*182. -*Normallywewouldload4KBofnandtoSRAMandjumpthere,but183. -*itisnotworkingperfectlyasexpected,sowecheatandload184. -*itfromnanddirectlyrelocatedto0x33f80000andjumpthere185. -*/186. -if(mini2440_load_from_nand(s-nand,0,S3C_RAM_BASE|0x03f80000,256*1024)0)187. -mini2440_printf(loadeddefaultu-bootfromNAND/n);188. -s-cpu-env-regs15=S3C_RAM_BASE|0x03f80000;/*startaddress,u-bootalrea189. -190. -#if0&defined(LATER)191. -if(mini2440_load_from_nand(s-nand,0,S3C_SRAM_BASE_NANDBOOT,S3C_SRAM_SIZE)0)192. -s-cpu-env-regs15=S3C_SRAM_BASE_NANDBOOT;/*startaddress,u-bootrelocati193. -mini2440_printf(4KBSteppingStoneloadedfromNAND/n);194. -195. -#endif196. -/*197. -*ifau-bootisavailableasafile,wealwaysuseit198. -*/199. -200. -image_size=load_image(mini2440/u-boot.bin,qemu_get_ram_ptr(0x03f80000);201. -if(image_size0)204. -if(image_size&(512-1)/*roundsizetoaNANDblocksize*/205. -image_size=(image_size+512)&(512-1);206. -mini2440_printf(loadedoverrideu-boot(size%x)/n,image_size);207. -s-cpu-env-regs15=S3C_RAM_BASE|0x03f80000;/*startaddress,u-boot208. -209. -210. :211. diff-gita/hw/mini2440.cb/hw/mini2440.c212. index5decf4b.7a70aae100644213. -a/hw/mini2440.c214. +b/hw/mini2440.c215. -258,46+258,15staticvoidmini2440_reset(void*opaque)216. structmini2440_board_s*s=(structmini2440_board_s*)opaque;217. uint32_timage_size;218. 219. -/*220. -*Normallywewouldload4KBofnandtoSRAMandjumpthere,but221. -*itisnotworkingperfectlyasexpected,sowecheatandload222. -*itfromnanddirectlyrelocatedto0x33f80000andjumpthere223. -*/224. -if(mini2440_load_from_nand(s-nand,0,S3C_RAM_BASE|0x03f80000,256*1024)0)225. -mini2440_printf(loadeddefaultu-bootfromNAND/n);226. -s-cpu-env-regs15=S3C_RAM_BASE|0x03f80000;/*startaddress,u-bootalreadyrelo227. -228. -#if0&defined(LATER)229. -if(mini2440_load_from_nand(s-nand,0,S3C_SRAM_BASE_NANDBOOT,S3C_SRAM_SIZE)0)230. -s-cpu-env-regs15=S3C_SRAM_BASE_NANDBOOT;/*startaddress,u-bootrelocatingcode231. -mini2440_printf(4KBSteppingStoneloadedfromNAND/n);232. -233. -#endif234. -/*235. -*ifau-bootisavailableasafile,wealwaysuseit236. -*/237. -238. -image_size=load_image(mini2440/u-boot.bin,qemu_get_ram_ptr(0x03f80000);239. -if(image_size0)242. -if(image_size&(512-1)/*roundsizetoaNANDblocksize*/243. -image_size=(image_size+512)&(512-1);244. -mini2440_printf(loadedoverrideu-boot(size%x)/n,image_size);245. -s-cpu-env-regs15=S3C_RAM_BASE|0x03f80000;/*startaddress,u-bootalready246. -247. -248. -/*249. -*ifakernelwasexplicitlyspecified,weloadittoo250. -*/251. -if(s-kernel)252. -image_size=load_image(s-kernel,qemu_get_ram_ptr(0x02000000);253. :254. diff-gita/hw/mini2440.cb/hw/mini2440.c255. index5decf4b.7a70a
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025合同法下租赁合同提前终止装修处理办法
- 乙方承包安装合同样本
- 买房附件合同样本
- 代付协议模板
- 员工借调协议合同
- 会所酒吧转让合同样本
- 人力资源服务派遣协议书范例二零二五年
- 股权合作协议范例
- 与拆迁公司合同样本
- 幼儿园教师聘用协议合同书范例
- 江苏码头工程防洪影响评价报告
- CommVault备份及恢复优势
- GB/T 25499-2010城市污水再生利用绿地灌溉水质
- GB/T 19817-2005纺织品装饰用织物
- 中国古代文化常识科举制度
- 四年级语文下册第六单元【集体备课】(教材解读+教学设计)课件
- 共聚焦显微镜zeisslsm700使用说明-中文版lsm
- DB4451-T 1-2021《地理标志产品+凤凰单丛(枞)茶》-(高清现行)
- 健康体检重要异常结果管理专家共识2019
- 35kV输电线路工程旋挖钻孔专项施工方案
- 三年级中华优秀传统文化教案
评论
0/150
提交评论