[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [microblaze-uclinux] microblaze: Fix compiled-in rootfs
John Williams wrote:
>> And I checked it in petalinux and there is one other secret step which add romfs.img to __init_end.
>> The main thing is that image.bin is not generated from image.elf which is the same for me too
>> but it is just cat command below which takes romfs at the end of linux.bin which should be __init_end.
>>
>> cat linux.bin romfs.img > image.bin
>> (vendor/PetaLogix/common/common.mak: line 403)
>>
>> Anyway in pre MMU version was .init.ramfs section aligned with the same boundary as bss section.
>> This mean that symbols __init_end and __bss_start was the same.
>>
>> If you look at arch/microblaze/kernel/vmlinux.lds.S you can see there that comment.
>>
>> 167: /* FIXME this can break initramfs for MMU */
>> 168: /* . = ALIGN(4096);*//* Pad init.ramfs up to page boundary, so
>> 169: that __init_end == __bss_start. This will
>> 170: make image.elf consistent with the image.bin */
>>
>> From petalinux side we have got inconsistence between image.elf and linux.bin which were caused my
>> mmu merge to petalinux. That's why for you (Steve) work __init_end instead of __bss_start.
>
> exactly correct.
>
> image.bin comes from linux.bin + romfs.img, not vmlinux+romfs -> objcopy
>
>> There are some solution how to solve it.
>> 1. Check both location __init_end first
>
> You mean, check __init_end *only*?
no I meant both location __init_end first and if is size zero
then look at __bss_start - as is in my patch.
>
>> 2. in petalinux generate image.bin from image.elf and remove that cat command from common.mak
>>
>> IMHO we should use the first version. I paste patch for it below + part of log for both cases.
>
> Somehow it still feels a bit risky. It assumes that .init is always
> last part of laoded kernel image (before BSS). Maybe that is OK.
I thought about too but I think that we don't have anything what could be between __init_end and
__bss_start. Adding romfs to __init_end save 4k as I wrote.
> There is equavalent assumption for using ROMFS at SBSS anyway I
> suppose.
I haven't done any tests to add image to sbss but I see potential problem with it because
in case that we will force add romfs to sbss and this exceed size of section we can break interrupt
vectors. IMHO is safer to use sections after .init.ramfs. Maybe we could start with init.ramfs
because we will use ramfs or mtd uclinux map.
Michal
>
> Steve, does Michal's latest patch work for you?
>
> John
>
> ___________________________
> microblaze-uclinux mailing list
> microblaze-uclinux@xxxxxxxxxxxxxx
> Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
> Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/
>
>
--
Michal Simek, Ing. (M.Eng)
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/