![DM365中的u-boot编译以及内核编译指导手册_第1页](http://file3.renrendoc.com/fileroot_temp3/2021-12/3/00455cc2-bb86-4f9f-8536-98098759bece/00455cc2-bb86-4f9f-8536-98098759bece1.gif)
![DM365中的u-boot编译以及内核编译指导手册_第2页](http://file3.renrendoc.com/fileroot_temp3/2021-12/3/00455cc2-bb86-4f9f-8536-98098759bece/00455cc2-bb86-4f9f-8536-98098759bece2.gif)
![DM365中的u-boot编译以及内核编译指导手册_第3页](http://file3.renrendoc.com/fileroot_temp3/2021-12/3/00455cc2-bb86-4f9f-8536-98098759bece/00455cc2-bb86-4f9f-8536-98098759bece3.gif)
![DM365中的u-boot编译以及内核编译指导手册_第4页](http://file3.renrendoc.com/fileroot_temp3/2021-12/3/00455cc2-bb86-4f9f-8536-98098759bece/00455cc2-bb86-4f9f-8536-98098759bece4.gif)
![DM365中的u-boot编译以及内核编译指导手册_第5页](http://file3.renrendoc.com/fileroot_temp3/2021-12/3/00455cc2-bb86-4f9f-8536-98098759bece/00455cc2-bb86-4f9f-8536-98098759bece5.gif)
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、dm365中的u-boot编译以及内核编译指导手册这个实验主要涉及五个方面的内容:一、ubl的编译说明,因为ubl是ccs下的工程文件,编译ubl在ccs环境下即可 直接编译,这里略去方法,只耍知道ubl文件的功能是负责启动u-boot n级启动镜像。二、u-boot的编译:1、在实验开始之前,首先看下这个实验的工作环境和目录结构情况,如下图所示轿 一ubuntu: /dpt/dm365file edit view search terminal help rootubuntu:/opt/dm365# isdm36x flash utilszk33hk setup.sh tt u-boot-2
2、0ie-88-14-bkup.tgzdm36x zip linux-2 6 lsproseedisplayzeilieie tgz montavista. tgzu - bootrootubuntu:/opt/dm365#flash_utils目录是关于ubl的内容的,u_boot是关于u_boot内容的ti_davinci是关 于linux内核源码编译的内容,所有的目录都在的dm365这个工作总目录下,(因为之后的 测试和验证均实在dm365这个板子上进行的)上述三个子冃录分别对应实验的三个部。2、在编译内核z前,先做些准备工作,搭建好以后需要使川的平台,这里主要是交 叉编译器的搭建,在之示
3、编译内核的过程屮会使用到此交叉编译器,指定路径麻便可使用, 为了指定交叉编译器的路径,在总的目录下建立一个脚本文件setup.sho在以后使用交叉编 译器的吋候都会根据这个路径来寻找,脚木文件比较简单,在所使用的终端上使用相应的命 令便可使之生效。i uukguuuiilu:/upi/uiii3u7# lbdm36x flash utils匾 显setup.shttdm36x zip linux-2.6.18_pro5e0_display_2011_ie_ie tgz montavista tgzu-bo(rootubuntu:/opt/dm365# vim setup.sh |编辑脚木文件的
4、命令。root)ubuntu: /opt/dmj65file edit view search terminal help#!/bin/shexport path=spath:/opt/dm365/montavista/pro/devkit/arm/v5t le/bin脚木文件的内容。dm36x, zip imux-2 6.18_pro5e0_display_2eil_ie_16 tgz rootubuntu:/opt/dm365# source setup.sr rootubuntu:/opt/dm365#使用此命令便“j将交叉编译器的路径添加到path环境变量中。3、准备工作完成z后,进行
5、u_boot的编译:potubuntu:/opt/dm365/u-boot# make disttclean nake: * no rule to make target 'disttclean' stop ootubuntu:/opt/dm365/uboot# make distclean root(9ubuntu:/odt/dm365/u-boot# 在编译z前,先清除-些不必要的东西,以避免彩响住成新的编译结果,运用的指令如上所示。rootubuntu:/opt/dm365/u-boot# make davinci_dm365_ipncconfiguring for da
6、vinci_dm365_ipnc board rootubuntu:/opt/dm365/u-boot# make arch=arm|z后进入编译阶段,步骤如上所示,第i条指令mae后跟的是板子名字,(这里运用的是dm 365的板子)第二条指令后跟的是体系结构。(arm的体系结构)下图是编译过程中的部分截图:xjcnctattnyinclude/commonh:0: warning: target cpu does not support interworking make c tools allmakel: entering directory '/opt/dm365/u-boot/
7、tools1gcc -wall -pedantic idirafter /opt/dm365/u-boot/incl.ude -idirafter /opt/dm365/u-boot/include2 idirafter /op elude -dtext base=9x81080ee0 -duse hostcc -0 -c -o img2srec.o img2srec.cgcc -wall pedantic idirafter /opt/dm365/u-boot/include -idirafter /opt/dm365/u-boot/include2 -idirafter /op elude
8、 -dtext base=0x81080000 -duse hostcc -0 -o img2srec img2srec.o strip img2srecgcc -g -wall -idirafter /opt/dm365/u-boot/include -idirafter /opt/dm365/u-boot/include2 idirafter /opt/dm365 dtext base=ox81g8g00o -duse hostcc -0 -c -o mkimage.o mkimage.cgcc -g -wall -pedantic -idirafter /opt/dm365/u-boot
9、/include idirafter /opt/dm365/u-boot/include2 -idirafter /include -dtext_base=0x81680000 -duse hostcc -0 -c -o crc32.o crc32.cgcc -g -wall -idirafter /opt/dm365/u-boot/include -idirafter /opt/dm365/u-boot/include2 -idirafter /opt/dm365 dtext base=0x81080000 -duse hostcc -0 -c -o image.o image.cgcc -
10、g wall -pedantic -idirafter /opt/dm365/u-boot/include -idirafter /opt/dm365/u-boot/include2 -idirafter /include dtext base=0x8198969e -duse hostcc -0 -c -o md5.o md5.cgcc g wall pedantic idirafter /opt/dm365/uboot/include idirafter /opt/dm365/u-boot/incl.ude2 idirafter /include dtext base=0x8ie80000
11、 -duse hostcc -0 -c -o shal.o shal.cgcc g -wall idirafter /opt/dm365/u-boot/include -idirafter /opt/dm365/u-boot/include2 idirafter /opt/dm365 dtext base=ex81080eee -duse hostcc -0 -c -0 fdt.o fdt.cgcc -g -wall idirafter /opt/dm365/u-boot/include -idirafter /opt/dm365/u-boot/include2 idirafter /opt/
12、dm365 dtext base=ox81o80eee -duse hostcc -0 -c -0 fdt ro.o fdt ro.cgcc -g wall -idirafter /opt/dm365/u-boot/include idirafter /opt/dm365/u-boot/include2 -idirafter /opt/dm365生成的.bin文件如截图所示,这就是编译u_boot jh的内容,它的作用就是启动操作系统,这里是在下一步需要编译的linux内核。-rwx rv/xr-xp圧bimoioubokoor|23:12ppccontig.mk rwxrwxr-x15005
13、001359962009-03-0223:12readme-rw-1rootroot452012-08-0622:46readmejnake-rwxrwxrx150050012562009-03-0223:12rules.mk-rwxrwxr x15005009062009-03-0223:12shconfig.mk-rwx rv/xr x15005g09082009-03-0223:12sparcconfig.mk-rw-1rootroot236762012-08-0623:02system.map-rw-1rootroot201231452012-07-2802:20tagsdrwxrwx
14、r-x950056040962012-08-0623:00tools-rwxr1rootroot6095882012-08-0623:02u-bootrwxrxx1rootroot1542842012-08-0623:02u-boot-1.34dm365_ipncbin-rw-r-r-1rootroot1478202012-08-0623:02u-boot.maprwxrxx1rootroot4629382012-08-0623:02boot.srecrootubuntu: /opt/dm365/u - boot#三、linux内核的编译,这个过程如如下:1、内核编译分为三个步骤,这里为了方便
15、,将三条make语句均写在一个shell文件中, 没执行一次shell文件都有一条相应的指令执行。聲 root)ubuntu: /opt/dm365/ti-davindfile edit view search terminal help#!/bin/shmake af i=arm“p =arm v5t_le- davinci_dm368_ipnc_defconfigmake arch=ann cross compi v5t lemenuco"make arch二arrn cross compf 二 a nrw vj i iii v5t le-make后有不同的参数,第一个参数指的是
16、体系结构,第二个参数是和应编译器,(交叉编译器的路径在z前己经搭建好)第三个参数是采用某个板子川的默认配宜。(这里是dm365)file edit view search terminal helpi / »、 «j t "、ti l / m jl < i / j i i#make arc fkarm cross compile二arm v5t le- davinci dm368 ipnc defconfig make arch二arm cross compile=arm v5tjle- menuconfig#make arch二arm cross comp
17、ile二ariii v5t le- ulmaqe第二条语句是修改内核操作,需要使用配置命令,进入后可以进行图形界而的配置,也可以使用默认配置(这里只耍不再配置即町,也就是进入图形界面后不做任何操作)file edit view search terminalhelp#!/bin/sh#make arch二arm cross c0mpile=arn1 v5t_le- davincidm368 ipncdefconfarch=arm cross cof4pile=arni v5t le- menucon|ake=arm m=armv5t le ulmage第三条语句就是生成镜彖文件ulmageo
18、(这个也是编译内核后的文件)顺序执行上述三条指令便可完成内核编译的工作。同时,也町将三条指令写在一个shell文件中,每次执行一条指令,注释两外两条,这里就是运用的就是这个方法,每次执行的命令都一样crc32 functions (crc32) y/? ycrc32c (castagnoli, et al) cyclic redundancy-check (libcrc32c # configuration written to config#root(aubuntu: /opt/dm365/tidavinci# /compile sh上图所示是第一条指令执行成功后的结果,现在执行笫二条指令。
19、进入图形配置内核界面,这里使用默认配置即可。x built-in excluded <m> module < > module capableoifs2 file system support (experimental)<select< exit >< help >接下來执行第三条指令,牛成镜像文件:copying ilggllocalversion-mvl module symvers reporljrootubuntu:/opt/dm365/ti-davinci# vim compile.sh rootubuntu:/opt/dm36
20、5/ti-davinci# ./compile.shchkinclude/linux/version.hmakel: kinclude/asm-arm/machtypes.h is up to date.chkinclude/linux/utsrelease.hchkinclude/linux/compile.hkernel: arch/arm/boot/image is readykernel: arch/arm/boot/zlmage is readyimage arch/arm/boot/ulmage is readyrootubuntu:/opt/dm365/ti-davinci#卜图
21、是牛成镜像文件的d录和ulmage文件rootubuntu:/opt/dm365/ti-davinci/arch/arm/boot# isvhh 壓 ibebfeeki image install.sh makefile ulmage zlmage rootubuntu:/opt/dm365/tidavinci/arch/arm/boot# is total 7456d rwx rwx rwx2507users40962010-01-2500:06d rwx rwx rwx2507users40962012-08-0623:42-rwxr-xr-x1rootroot39208162012-08
22、-0623:42image-rv/x rwx rv/x1507users13262009-03-0123:13install.sh-rwx rv/x rwx1507users25492009-03-0123:13makefile-rw-r-r-1rootroo08-0623:42ulmagerwxr-xr-x1rootroo08-0623:42zlmage四、安装tftp服务器tftp服务器的作用是将牛成的镜像文件下载到板子屮(如果自己的操作系统小已经女装过此服务器的话,此步骤省略)1、安装服务端、客户端.超级服务端(需要联网)-rwxr-x
23、r-x 1 root root1846888 2012-08-06 23:42 zlmageroot(3ubuntu:/opt/dm365/tidavinci/arch/arm/boot# aptget install tftpd tftp xinetdj2、建立配置文件,创建/etc/xineted.d/tftp文件,并在文件中添加如卜内容:oo® root)ubuntu: /etc/xinetd.dfile edit view search terminal helpgerviceprotocol = ud(port=sockettype=dgramwaituserservers
24、erver argsdisablej3.建立tftp服务器文件目录(上传文件与卜载文件的位置),并且更改具权限copying e hd 0 el | e localversion rootabuntie/opdin亍6&/+i-davinci# mkdir /rftpbootcopying q 曲翅qqqlocalversion-mvl modrootubuntu:/opt/dm365/ti-davinci# chmod -r 777 /tftpbootj4、通过xinitd超级服务器丿訂动tftpdrootubuntu:/opt/dm365/tidavinci# /etc/init.
25、d/xinetd startrather than invoking init scripts through /etc/init.dr use the service(8) 1 utility, e.g. service xinetd startsince the script you are attempting to invoke has been converted to an upstart job, you may also use the start(8) utility, e.g. start xinetd ootubuntu:/odt/dn365/ti-davinci#五、用
26、u-boot启动:module.symvers/tftpboot/localversion-mvlk将生成的ulmage拷贝到tftpboot fl录下,以便可以使川ubuntu:/opt/dm365/ti-davinci# cp arch/arm/boot/ulmageubuntu:/opt/dm365/tdavinci#ubuntu:/opt/dm365/ti-davinci# ubuntu:/opt/dm365/ti-davinci# ubuntu: znnt/dm365/ti -davinci# 1rn/tftpboot h录下可以看到刚刚复制进来的镜像文件rootubuntu:/tf
27、tpboot# is ulmage ulmage_6467t root(aubuntu: /tftpboot# |2、将镜像文件下载到相应的板子上,并进行演示:首先是设置tftp服务器的ip和客户端的ipsetenv ipaddr 21setenv serverip 192.16&2.222在板子启动z前,将此命令写入串口工具命令框小,并保存此设置,以便以后不用多次设置。boot命令将进入镜像导入模式,u-boot启动内核,之后在设置环境参数setenv gatewayip setenv bootcmd *tftp 0x82000000 ul
28、mage;bootm 0x82000000'setenv bootcmd 'tftp 0x82000000 ulmage_365_bkup;bootm 0x82000000'setenv bootargs 'console=ttys0,l 15200n8 root=/dev/ram() rw initrd=0x82000000,16m mem=5()mip=1925:22:::eth0:off在键入boot命令,成功引导进入环境。同时u-boot和内核z间还可以进行传参通信,在u-boot启动
29、z前,通过串口工具将参数传 递给内核,内核可以解析。setenv bootargs 'consoletysoj 15200n8 mem=50m noinitrd root=/dev/nfs nfsroot= 22:/opt/nfs,nolock,rsize=4096,wsize=4096 param=testparam mpurate=600 ip= 192.16&2.221:22:1926&2.1::eth0:off例如在这条命令中,param=testparam是自己设置的参数,在经过解析后,输入
30、结果如下:cpuo: d cach«: s192bull t 1 zonel uts .kernel cgj-md -ine: cor>£>i«=ttysi 221:22:12 1682l”5525525s0:«h(hoffpid hash xabl< entries: 256 (order:clock event we t仏r0_0 conf igucor so*: colour du dzccq 80x jud*rrry each* hash e8l92 (ord*r:人 32768r-cache hash c
31、 entries: 4096 (or<kr: 2. 163b4 metrory: 93m8 - so6 totalcpuo: i cache: 16384 bytes. assatrty 4, 32 byte lin*s 126 sets亠is - -bytes associativity 4 32 byte lir*es. 4 setstotal ddes: 12800corie-1tylio, 1152co»8rolnltrd root-/<i?v7nfs nfsroot-22:/opt/nf£.nolcck.rs4ze-4096茅 o
32、at testpin “风心匕yoc ip<92.16bytes) cups set: 07-.:凸52552550:址力0:0什图片 1111、可部分有谱句输ill 为 process_param is testparam.这里解析的部分在如卜所示的目录下:domountsrd.c initramfs o main o do mounts rdo kconfig makefile initramfs.cmaincmounts oversion.c version.orootubuntu:/opt/dm365/ti-davinci/init# is builtin.o do mounts.cdo mounts initrdocalibrate.c do_mountshdo_mountsnd ccalibrate.。 do mounts initrd.c do mountso rootu
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年罩极型电动机项目可行性研究报告
- 成都四川省人民医院蒲江医院·蒲江县人民医院编外护理人员招聘3人笔试历年参考题库附带答案详解
- 2025年热弯炉项目可行性研究报告
- 2025年桨叶-微粉两级干燥系统项目可行性研究报告
- 2025年旋转式膜电位器项目可行性研究报告
- 2025年差动轴项目可行性研究报告
- 2025年喷气织机边撑项目可行性研究报告
- 2025年利巴韦林滴眼液项目可行性研究报告
- 2025至2031年中国3-丙二醇行业投资前景及策略咨询研究报告
- 2025至2030年高纯锰矿项目投资价值分析报告
- 云南省普通初中学生成长记录模板-好ok
- 人体解剖学试题库及答案
- SB/T 10415-2007鸡粉调味料
- 考古绘图基础
- GB/T 32574-2016抽水蓄能电站检修导则
- 《社会主义市场经济理论(第三版)》第十三章社会主义市场经济标准论
- 变更索赔案例分析
- 过敏性休克的急救及处理流程教材课件(28张)
- 《花婆婆》儿童绘本故事
- DB44∕T 2149-2018 森林资源规划设计调查技术规程
- 数据结构英文教学课件:chapter10 Hashing
评论
0/150
提交评论