From: Jeremy S. <js...@mv...> - 2002-07-03 17:30:02
|
Tom Rini wrote: > On Wed, Jul 03, 2002 at 09:16:23AM +0100, manoj ks wrote: > > > I have to convert a compressed kernel for an SH37727 > > based board to a Motorola S3 format file. > > Is it possible? > > > > I tried using sh-linux-objcopy -I binary -O srec > > zImage zImage.mot . > > But this commmand is showing the help message. > > Well, that's not the right arguments :) Try: > sh-linux-objcopy -O srec --srec-forceS3 zImage zImage.srec > > I'm not sure if you need the -I binary or not.. You do, and you also probably want --adjust-vma or --adjust-start or something, since starting with a binary image, address 0 will be used by default. You may with to start with the compressed/vmlinux (ELF) rather than zImage (binary). The zImage rule in boot/Makefile already does an objcopy; a nearly identical zImage.srec rule which simply adds -O srec may produce what you want: zImage.srec: $(CONFIGURE) compressed/vmlinux $(OBJCOPY) -O srec compressed/vmlinux zImage.srec zImage: $(CONFIGURE) compressed/vmlinux $(OBJCOPY) compressed/vmlinux zImage Note however that even with this the address you get is one in RAM where the vmlinux ELF file expects to be. If you are planning to load this in flash as implied by your earlier email, you may need to change things. Some comments on that below. Stuart Menefy wrote: > On Tue, 2 Jul 2002 09:22:52 +0100 > mks...@ya... wrote: > > > 1) How to pass the control from SH IPL+g to the > > compressed kernel? > > I know that in sh ipl+g "1" and "2" commands can be > > used to jump > > to predefined locations (CONFIG_BOOT_LOADER1, > > CONFIG_BOOT_LOADER2) . > > Is it okay that i put the compressed kernel in any of > > the above location? > > Yes. That's what its designed for. > > > 2) whether SH IPL+g will decompress the kernel and > > transfer to RAM? > > No. The compressed kernel has its own decompression > loader at the beginning, which decompresses the code from > ROM into RAM. So when you tell sh-ipl to jump to the > 'compressed kernel', you are actually jumping to the > decompression code (which is obviously not compressed!). Note that this means the kernel (decompressor) actually needs to be linked to run at the address its put: if you jump to code at location X which is built expecting to find itself at location Y it won't work too well... obviously you can change CONFIG_BOOT_LOADERx definitions and rebuild sh-ipl+g as well. That said, the normal "zImage" build expects to find itself in RAM at 0x8N210000, where N is the CONFIG_MEMORY_START (see arch/sh/boot/compressed/Makefile). [Hmmm... this seems to be an effort to leave at least the first 2M+64K of RAM available for the decompressed kernel, but you claim to have only 2M to begin with?] If you want to have the kernel in flash so sh-ipl+g will jump to it and have it decompress itself into RAM, you can build the kernel slightly differently. If I remember, I'll attach a patch I was playing with to do this (already on this list last month I think; includes a configurable kernel cmdline as you don't have sh-ethboot to build one for you in this case). [This allows you to specify a flash address and changes zImage to do that -- but I think making a target like fzImage or something would be better.] > > 3) Where comes the role of file system? Do we need a > > file system for porting linux to a development board? > > Yes. You need a root file system for the kernel to load the > application code from. This can be on any media though, NFS, > hard drive, or Flash. > > > Could any please share some ideas in the matter,i will > > be very thankful One idea might be to get more RAM on your board; I wouldn't be surprised if your kernel finds 2MB to be a tight squeeze... --Jeremy Siegel |