免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 821 | 回复: 0
打印 上一主题 下一主题

linux内核启动地址(S3C2410) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-09-23 11:45 |只看该作者 |倒序浏览
(网上资源,摘录整理)
linux 内核启动地址的确定
内核编译链接过程是依靠 vmlinux.lds 文件,以 arm 为例 vmlinux.lds 文件位于 kernel/arch/arm/vmlinux.lds,
vmlinux-armv.lds 的生成过程在 kernel/arch/arm/Makefile 中
ifeq ($(CONFIG_CPU_32),y)
PROCESSOR          = armv
TEXTADDR         = 0xC0008000
LDSCRIPT         = arch/arm/vmlinux-armv.lds.in
endif
arch/arm/vmlinux.lds: $(LDSCRIPT) dummy
    @sed 's/TEXTADDR/$(TEXTADDR)/;s/DATAADDR/$(DATAADDR)/' $(LDSCRIPT) >$@
查看 arch/arm/vmlinux.lds 中
OUTPUT_ARCH(arm)
ENTRY(stext)
SECTIONS
{
    . = 0xC0008000;
    .init : {           /* Init code and data   */
        _stext = .;
        __init_begin = .;
            *(.text.init)
设置 kernel/arch/arm/boot/Makefile 文件中的
ifeq ($(CONFIG_ARCH_S3C2410),y)
ZTEXTADDR      = 0x30008000
ZRELADDR      = 0x30008000
endif
# We now have a PIC decompressor implementation. Decompressors running
# from RAM should not define ZTEXTADDR. Decompressors running directly
# from ROM or Flash must define ZTEXTADDR (preferably via the config)
#
查看 2410 的 datasheet ,发现内存映射的基址是 0x3000 0000 ,那么 0x30008000 又是如何来的呢?
在内核文档 kernel/Document/arm/Booting 文件中有:
Calling the kernel image
Existing boot loaders: MANDATORY
New boot loaders: MANDATORY
There are two options for calling the kernel zImage. If the zImage is stored in flash, and is linked correctly to be run
from flash, then it is legal for the boot loader to call the zImage in flash directly.
The zImage may also be placed in system RAM (at any location) and called there. Note that the kernel uses 16K of
RAM below the image to store page tables. The recommended placement is 32KiB into RAM.
看来在 image 下面用了 32K(0x8000)的空间存放内核页表。
0x30008000 就是 2410 的内核在 RAM 中的启动地址,这个地址就是这么来的。


       
        文件:U-boot与kernel的关系new.tar
        大小:0KB
        下载:
下载
       
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/104274/showart_2058232.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP