[okl4-developer] Question about the init_memory() function for ARM side
Geoffrey Lee
glee at ok-labs.com
Fri Nov 28 00:08:11 EST 2008
On Thu, Nov 27, 2008 at 07:29:27PM +0800, Sean wrote:
> Dear all
>
> Currently, I have studied the design issue of address space of OKL4
> 2.1.1-patch9.
> During tracing the booting sequence, the function init_memory() uses a lot
> of defined value from linker script.
>
> in the file /arch/arm/pistachio/include/memory.h
>
> 68 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L68>
> */**
> 69 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L69>
> * * Symbols defined by linker script.*
> 70 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L70>
> * */*
> 71 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L71>
> 72 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L72>
> */* Kernel code and data */*
> 73 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L73>
> extern *"C"* {
> 74 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L74>
> extern char _start_rom[];
> 75 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L75>
> extern char _end_rom[];
> 76 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L76>
> extern char _start_ram[];
> 77 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L77>
> extern char _end_ram[];
> 78 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L78>
> extern char _start_init
> <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=_start_init>[];
> 79 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L79>
> extern char _end_init
> <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=_end_init>[];
> 80 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L80>
> extern char _end
> <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=_end>[];
> 81 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L81>
> }
> 82 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L82>
> 83 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L83>
> */**
> 84 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L84>
> * * Wrapper macros to access linker symbols.*
> 85 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L85>
> * */*
> 86 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L86>
> 87 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L87>
> #define start_rom
> <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=start_rom>
> ((addr_t <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=addr_t>)
> _start_rom)
> 88 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L88>
> #define start_ram
> <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=start_ram>
> ((addr_t <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=addr_t>)
> _start_ram)
> 89 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L89>
> #define end_rom
> <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=end_rom>
> ((addr_t <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=addr_t>)
> _end_rom)
> 90 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L90>
> #define end_ram
> <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=end_ram>
> ((addr_t <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=addr_t>)
> _end_ram)
> 91 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L91>
> #define start_init
> <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=start_init>
> ((addr_t <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=addr_t>)
> _start_init <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=_start_init>)
> 92 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L92>
> #define end_init
> <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=end_init>
> ((addr_t <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=addr_t>)
> _end_init <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=_end_init>)
> 93 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L93>
> #define end_kernel
> <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=end_kernel>
> ((addr_t <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=addr_t>)
> _end <http://192.168.100.128/lxr/http/ident?v=OKL4-2.1.1-patch7;i=_end>)
> 94 <http://192.168.100.128/lxr/http/source/arch/arm/pistachio/include/memory.h?v=OKL4-2.1.1-patch7#L94>
>
>
> I want to know the meaning of these variables. Especially _start_init,
> _end_init, _end.
_start_init and _end_init define the area that is used by the kernel
to bootstrap itself, so once the initialization is done you can
reclaim the space. _end defines the end of the kernel.
_start_rom and _end_rom define bounds of the location of the code and data
for a rom-based configuration. Such data would still exist if your
platform had no rom, they would be in ram instead.
-gl
> What's the difference between theses variables?
>
> Thanks a lot!
>
> Best Regards,
> Sean
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer
--
More information about the Developer
mailing list