kernel的各个地址

linux-2.6.27.28/arch/mips/Makefile

 

load-$(CONFIG_SOC_ACTIONS)       += 0xffffffff80000000

 

ifdef CONFIG_32BIT

ifdef CONFIG_CPU_LITTLE_ENDIAN

JIFFIES                = jiffies_64

else

JIFFIES                = jiffies_64 + 4

endif

else

JIFFIES                = jiffies_64

endif

 

CPPFLAGS_vmlinux.lds := /

       $(KBUILD_CFLAGS) /

       -D"LOADADDR=$(load-y)" /

       -D"JIFFIES=$(JIFFIES)" /

       -D"DATAOFFSET=$(if $(dataoffset-y),$(dataoffset-y),0)"

定义了LOADADDRJIFFIES

 

linux-2.6.27.28/arch/mips/kernel/vmlinux.lds.S中:

(注意:这里的地址都是虚拟地址而不是物理地址)

段的最前面是

       . = LOADADDR;

这就是内核代码的起始地址。

这些地址(尤其是红色标志的地址)需要注意:

       _text = .; /* Text and read-only data */

       _etext = .;       /* End of text section */

              __start___ex_table = .;

              __stop___ex_table = .;

              __start___dbe_table = .;

              __stop___dbe_table = .;

       __nosave_begin = .;

       __nosave_end = .;

       _edata =  .;                  /* End of data section */

       __init_begin = .;

              _sinittext = .;

              _einittext = .;

              __setup_start = .;

              __setup_end = .;

              __initcall_start = .;

              __initcall_end = .;

              __con_initcall_start = .;

              __con_initcall_end = .;

              __initramfs_start = .;

              __initramfs_end = .;

       __init_end = .;

       __bss_start = .;      /* BSS */

       __bss_stop = .;

编译完内核之后,可在相应的system.map文件里找到这些地址的值,例如:

80218000 A __init_begin

80f01000 A __init_end

init段的长度为:

0xCE9000 = 13537280 = 12.91015625MB

What happens during boot is that the "init" kernel thread (function init/main.c:init()) calls the arch-specific function free_initmem() which frees all the pages between addresses __init_begin and __init_end.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值