From: Cord S. <cs...@em...> - 2001-11-21 20:43:32
|
Hi Stuart, many thanks for the detailed help. Still some questions, s. below: On Wed, 21 Nov 2001, Stuart Menefy wrote: > Cord > > Its pretty simple. Assuming you have a ramdisk image, you simply need > to load it into memory, and tell the kernel where it is: > > - loading will depend on what tools you are using to download your kernel. > If you have a loader which supports the downloading of binary files, > that it simple. If you are using a tool like gdb, which only supports > the downloading of elf files, or a loader which can only use S-records > or similar, ld or objcopy can be used to convert to the appropriate > format. I've to use S-records, which I generate with objcopy. But the loader only permits one upload with one start address. Guess, I've to combine two S-records into one file. That should work, shouldn't it? > The image needs to be loaded into memory which the kernel knows about, > so don't try and load the image into what, for the kernel's point of > view, is unused memory. The address is not important? I.e. right after the compressed image or near the upper limit of RAM? How does the kernel know where to move the uncompressed data to? Can it be compressed at all? At offset 0x14 below, the initrd size corresponds to the image in RAM after uploading, doesn't it? > - telling the kernel where the image is simply involves modifying > a few workds of memory near the start of the kernel image. These > corrispond to the C symbol empty_zero_page, which is 4K from the > start of kernel memory: > > empty_zero_page + 0x00: mount root read only > + 0x04: ramdisk flags > + 0x08: root device > + 0x0c: loader type > + 0x10: initrd start > + 0x14: initrd size > + 0x100: kernel command line > > The only words you should need to modify are: > + 0x0c: loader type - set to 1 > + 0x10: initrd start - set to the offset of the image from the start > of kernel memory (CONFIG_MEMORY_START) > + 0x14: initrd size - size of the initrd image Yes, I've found the ezp, but I thought it would be more difficult ;-) > Again, how you do this depends of what tools you are using. You might > want to have a look at the gdb start up scripts which are part of the > CVS kernel sources, in the root of the kernel sources - .gdbinit-dmida > is a well commented example. I'll look at it. > Hope this helps Definitely. Thanks again! Cord |