Dear All,
I'm try to port Fiasco to an ARM platform, and I'm confused by the memory address settup in bootstrap package. What is the relationship between DEFAULT_RELOC_$(ARCH), MOD_ADDR, and RAM_BASE ? In the setting of Integratorcp, they're : DEFAULT_RELOC_arm = 0x0140,0000 RAM_BASE = 0x0 MOD_ADDR = 0x0150,0000 (I wonder if this work on real integratorcp board ? Although QEMU just put 2 memory with the same size on 0x0 and 0x8000,0000, is the real one will remap all it's memory to 0x0 ?)
Because I see DEFAULT_RELOC_arm+RAM_BASE is used to be start address and in IMAGE_MODE, RAM_BASE+MOD_ADDR is used to be _mod_addr, So I guess RAM_BASE manes where the physical ram start, and DEFAULT_RELOC_arm, MOD_ADDR are realative to RAM_BASE, which are used to control start address of bootstrap image and specify where modules move to.
With these assumption, it will work unitl find_kip(), `fail to find kernel info page.' And then I found the address in regions are strange, only address in bootstrap and multiboot info seems correct, others seems irrelevant to RAM_BASE, looks like started at 0x0.
I guess there is some setting I miss. Could anyone give some advice about it ?
Best Regards, Tsai, Tung-Chieh
Hi,
On Tue Dec 02, 2008 at 23:12:56 +0800, Tsai, Tung-Chieh wrote:
I'm try to port Fiasco to an ARM platform, and I'm confused by the memory address settup in bootstrap package. What is the relationship between DEFAULT_RELOC_$(ARCH), MOD_ADDR, and RAM_BASE ? In the setting of Integratorcp, they're : DEFAULT_RELOC_arm = 0x0140,0000 RAM_BASE = 0x0 MOD_ADDR = 0x0150,0000 (I wonder if this work on real integratorcp board ? Although QEMU just put 2 memory with the same size on 0x0 and 0x8000,0000, is the real one will remap all it's memory to 0x0 ?)
I never had a real integrator board myself, so I don't know. Nevertheless it should not be problem to change the addresses.
Because I see DEFAULT_RELOC_arm+RAM_BASE is used to be start address and in IMAGE_MODE, RAM_BASE+MOD_ADDR is used to be _mod_addr, So I guess RAM_BASE manes where the physical ram start, and DEFAULT_RELOC_arm, MOD_ADDR are realative to RAM_BASE, which are used to control start address of bootstrap image and specify where modules move to.
It's exactly like this. RAM_BASE is the start of the RAM, DEFAULT_RELOC_arm is the relative address (to RAM_BASE) where bootstrap is linked to and MOD_ADDR is the relative address (to RAM_BASE) where the modules will be moved to.
With these assumption, it will work unitl find_kip(), `fail to find kernel info page.' And then I found the address in regions are strange, only address in bootstrap and multiboot info seems correct, others seems irrelevant to RAM_BASE, looks like started at 0x0.
I guess there is some setting I miss. Could anyone give some advice about it ?
Where is fiasco linked to? The addresses in the kernel also need to be set properly. Look out for mem_layout-xxx.cpp and Kconfig in the bsp.
Adam
Dear Adam,
I still have another question. I set the address of kernel in mem_layout-xxx.cpp, it successfully get into kernel ( get into __main(), stop in some place I still not checking ), but I fill confuse on virtual memory setting.
On my platform, ram is start at 0x3000,0000, so I set : * RAM_BASE=0x3000,000 * DEFAULT_RELOC_arm=0x0 * MOD_ADDR use default value in modules.list, i.e., 0x0200,0000 * Mem_layout::platform_phys_base=0x3000,0000 * Mem_layout::Sdram_phys_base =0x3020,0000
So fiasco kernel start at 0x3020,0000, sigma0 and roottask are under 0x3020,000, which are 0x3006,8000 and 0x3007,8000, respectively.
But how does kernel know the area from 0x3010,0000 to 0x3020,0000 ? I see map_1mb in map_hw will map this area( from Mem_layout::platform_map_base to Mem_layout::platform_phys_base ), but this only mapping 1mb, where is 0x3010,0000 to 0x3020,0000 setting ? Or I'm missing some setting ? And I fill strange in Mem_layout::Sdram_phys_base to 0x3020,0000, since physical ram is started at 0x3000,0000, is this setting really correct or I misunderstand its meaning ?
Best Regards, Tsai, Tung-Chieh
Hi,
On Tue Dec 23, 2008 at 15:51:07 +0800, Tsai, Tung-Chieh wrote:
I still have another question. I set the address of kernel in mem_layout-xxx.cpp, it successfully get into kernel ( get into __main(), stop in some place I still not checking ), but I fill confuse on virtual memory setting.
On my platform, ram is start at 0x3000,0000, so I set :
- RAM_BASE=0x3000,0000
Ok.
- DEFAULT_RELOC_arm=0x0
No, do not change the DEFAULT_RELOC_arm values. Those are offsets, relative to RAM_BASE! I.e. the real link-address is RAM_BASE+DEFAULT_RELOC_arm.
- MOD_ADDR use default value in modules.list, i.e.,
0x0200,0000
That is ok.
- Mem_layout::platform_phys_base=0x3000,0000
- Mem_layout::Sdram_phys_base =0x3020,0000
Sdram_phys_base is 0x30000000 for you, i.e. it's the start of the RAM in the physical address space. What is platform_phys_base?
So fiasco kernel start at 0x3020,0000, sigma0 and roottask are under 0x3020,000, which are 0x3006,8000 and 0x3007,8000, respectively.
No, the kernel starts at 0x1000 relative to RAM, i.e. 0x30001000.
But how does kernel know the area from 0x3010,0000 to 0x3020,0000 ? I see map_1mb in map_hw will map this area( from Mem_layout::platform_map_base to Mem_layout::platform_phys_base ), but this only mapping 1mb, where is 0x3010,0000 to 0x3020,0000 setting ? Or I'm missing some setting ? And I fill strange in Mem_layout::Sdram_phys_base to 0x3020,0000, since physical ram is started at 0x3000,0000, is this setting really correct or I misunderstand its meaning ?
Sdram_phys_base must be 0x3000,0000 as this is the location where memory starts. For a new platform you actually only need to set Sdram_phys_base and CONFIG_KERNEL_LOAD_ADDR to the same value (for the kernel). For user-land you need to adapt RAM_BASE and RAM_SIZE_MB, all other values stay the same as they're relative to RAM_BASE.
Adam
l4-hackers@os.inf.tu-dresden.de