[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [microblaze-uclinux] bootstrap code
Hi Joszef,
Nice bit of code, and thanks very much for contributing it! I put it
into my system, put an elf image into the flash, and was booting the
kernel in just a couple of minutes...
Comments for those who haven't tried this yet:
It's an elf loader, meaning that instead of using mb-objcopy -O binary
image.elf image.bin, you just burn the raw elf file into the appropriate
flash slot. You need to run mb-strip on the elf image first to get rid
of all the debugging strings - after strip the elf image is about the
same size as the binary image (can even be smaller if there are large
"zero" sections.
Joszef, as you say this could be suitable for the first step in the 3
step boot process that is described in the Wiki. There are two things I
would need to change, one is critical, and the other just "nice to have"
The critical one is the same problem that most uClinux systems face with
elf bootloaders. That is, the romfs filesystem is copied into the
kernel elf image (post-linking) with the following bit of shell script:
mb-objcopy --add-section=.romfs=$(ROMFSIMG) \
--adjust-section-vma=.romfs=$${ADDR} --no-adjust-warnings \
--set-section-flags=.romfs=alloc,load,data \
$(ROOTDIR)/$(LINUXDIR)/linux $(ELFIMAGE)
I've never got a straight answer, but it's either a bug in objcopy, or a
"bug" (feature?) in elf loaders, that this new romfs section is not
allocated into a segment, and most elf loaders don't "see it".
The impact here is that when I booted a linux kernel with your
bootloader, the kernel itself was fine, but there was no romfs file
system, so we could not proceed to a shell etc. Maybe someone with
experience in uClinux bootloaders (david, greg? :) could comment on the
tweak we should make to get the bootloader to see the .romfs section?
The "nice-to-have" would be to reduce the total size of the bootloader
down to 2048 bytes, so we can squeeze it into a nice small BRAM block.
If I can get around problem #1, then it should just be a matter of
careful optimisation and removing some features and strings etc.
Once again, thanks very much for submitting it. I think with a few
small modifications it will be very useful indeed for the uClinux project.
Regards,
John
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/