arm linux源代码分析(1)

arm linux源代码分析(1)

ID:1694825

大小:71.00 KB

页数:19页

时间:2017-11-13

arm linux源代码分析(1)_第1页
arm linux源代码分析(1)_第2页
arm linux源代码分析(1)_第3页
arm linux源代码分析(1)_第4页
arm linux源代码分析(1)_第5页
资源描述:

《arm linux源代码分析(1)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、ARMLinux源代码分析(1)/*ARMLinux源代码分析(1)--head.STigerZ(tigerz@yeah.net)http://emblinux.org/1.分析环境   kernel:2.6.10   board:SMDK24101.32,64MSDRAM,128MSM卡2.head.S*//* *linux/arch/arm/kernel/head.S * * Copyright(C)1994-2002RussellKing * *Thisprogramisfreesoftware;youcanred

2、istributeitand/ormodify *itunderthetermsoftheGNUGeneralPublicLicenseversion2as *publishedbytheFreeSoftwareFoundation. * * Kernelstartupcodeforall32-bitCPUs */#include#include#include#include#include<

3、asm/mach-types.h>#include#include#include#ifndefCONFIG_XIP_KERNEL/*我在的平台,这个宏没有定义*//* *Weplacethepagetables16KbelowTEXTADDR. Therefore,wemustmakesure *thatTEXTADDRiscorrectlyset. Currently,weexpecttheleastsignificant 

4、*16bitstobe0x8000,butwecouldprobablyrelaxthisrestrictionto *TEXTADDR>=PAGE_OFFSET+0x4000 * *页表放在比TEXTADDR低16K的地方,所以我们必须要确认TEXTADDR被正确设定.目前, *我们希望低16位为0x8000,不过我们可以放松这个限制为 *TEXTADDR>=PAGE_OFFSET+0x4000 * *Notethatswapper_pg_diristhevirtualaddressofthepagetables,an

5、d *pgtblgivesusaposition-independentreferencetothesetables. Wecan *dothisbecausestext==TEXTADDR * *注意swapper_pg_dir是页表的虚拟地址,pgtbl给我们一个位置无关的页表地址,这是 *因为stext==TEXTADDR. */#if(TEXTADDR&0xffff)!=0x8000   #errorTEXTADDRmuststartat0xXXXX8000#endif   /*swapper_pg_dir=0x

6、30008000-0x4000*/   .globl swapper_pg_dir   .equ   swapper_pg_dir,TEXTADDR-0x4000   /*rd=stext-0x4000,这里stext==TEXTADDR*/   /*adr指令是在pc值上+/-一个标号的偏移得到的,所以得到的地址只跟pc和标号到    *pc的偏移相关,跟编译地址无关.在MMU打开前,代码要是地址无关的,会经常    *用到adr.    */   .macro pgtbl,rd,phys   adr    rd,s

7、text   sub    rd,rd,#0x4000   .endm#else/**XIPKernel:**Weplacethepagetables16KbelowDATAADDR. Therefore,wemustmakesure*thatDATAADDRiscorrectlyset. Currently,weexpecttheleastsignificant*16bitstobe0x8000,butwecouldprobablyrelaxthisrestrictionto*DATAADDR>=PAGE_OFFS

8、ET+0x4000**Notethatpgtblismeanttoreturnthephysicaladdressofswapper_pg_dir.*Wecan'tmakeitrelativetothekernelpositioninthiscasesince*thekernelcanphysicallybeanyw

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。