lkml.org 
[lkml]   [2007]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[PATCH] Compressed ia32 ELF file generation for loading by Gujin 1/3
  Hello,

The Gujin bootloader (now at version 1.8) can natively load
compressed ELF files, and these three patches enable to generate
this "linux-2.6.20.kgz" file format.
Just as a remainder, to generate a bzImage file, those steps
are needed:
1- Compile the core kernel and link it into the ELF file vmlinux
at the top of the directory. Also compile and link modules.
2- Create a binary image of the kernel memory.
3- Compress this binary image with GZIP.
4- Assemble and link in an independant file the bootsector, the
setup and the real-mode code (in assembler) to start and gather
BIOS information.
5- Compile the protected mode code to decompress the kernel,
and re-adjust relocation defined at step 1 after decompression.
6- Get the binary image for real-mode and protected-mode parts
7- Mix the 3 parts in the same file named bzImage.

The previous version of Gujin were loading Linux kernel as after
step 3, the new one is basically able to load after step 1.
The ELF image is still better stripped of its debugging information
(to reduce time to load from disk) and compressed by GZIP to be able
to check its CRC32.
The BIOS information gathering did not evolve that much since the
first version of this patch - still written in C and included in
the initial link at load address 0 (no conflict with linux code at
address 0xC0000000).
The standard comment field of the GZIP is still used to describe this
kernel (processor, license...) but no more needs address references
because all needed information (address to load, address and size of
the real-mode code to gather information from the BIOS) is taken from
the ELF program header table (if real-mode code is not found it is
also searched in the section table).

Gujin real-mode C BIOS gathering code is automatically removed by
the "objdump" at step 2 when generating a bzImage, so there is no
need to disable anything to continue using Lilo/Grub/Syslinux...

The first two patch contains the interesting parts, that is files
realmode.[ch] to gather the BIOS informations, a small modification
to the command line (treating the first words as the pathname and
kernel name if present) which help Gujin autodetect the root
partition, the linker modifications (there is a single link with
Gujin kernel file "/boot/linux-2.6.20.kgz") and the Makefile
modifications.
The third patch just adds two files as independant commands,
gzcopy.c to view/edit/modify Gzip files (BSD like licensed) and
gzparam.c to display a single line used as the GZIP comment,
to forbid to load ia64 kernels on ia32 and this kind of
restrictions.

For me, these patchs are ready to be included in the kernel,
but I am ready for (or even waiting) any interesting discussion
about them.
I most like the simplicity of the generation system / load
process after the patch, just execute:
make /boot/linux-2.6.20.kgz
(recompile the modules if you have some) and reboot...
More info about Gujin at:
http://gujin.org

Have fun,
Etienne.









___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses
http://fr.answers.yahoo.com[unhandled content-type:application/octet-stream]
\
 
 \ /
  Last update: 2007-02-06 00:59    [W:0.057 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site