[lkml]   [1999]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: bzImage decompression
On Mon, 27 Sep 1999, Richard B. Johnson wrote:

> On Mon, 27 Sep 1999, Pascal Schmitt wrote:

> > Hi,
> >
> > For a very particular thing, I need to decompress a bzImage in order to
> > get the uncompressed kernel ( I need an uncompressed kernel for a bootp
> > client on a linux bootp server, but I don't have enough place to store
> two kernels on it : compressed and uncompressed, so I will uncompress
> > its kernel).
> > I take the bzImage, remove the bootsect.s and setup.s header to get the
> > compressed kernel. but I can't unzip it because the extracted kernel
> > does not begin with gzip magic number (0x1f,0x8b|| 0x9e). But it should
> > (if I look to arch/i386/boot/compressed/misc.c and gunzip() ).
> >
> > Why ??
The zImage contain bootsect.o + setup.o + misc.o + piggy.o

piggy.o contain the gzipped vmlinux file in its data section (ELF)
(see compressed/Makefile piggy.o)

> You could always use the uncompressed image, vmlinux, which in the
> top directory after a build. Otherwise, uncompress bzImage first.

Be warn that you can't boot directly a vmlinux file, because it rely on some work made only in boot image
First there is setup.s that create some data in the zero-page (see Documentation/i386/zero-page.txt in the kernel source tree) : hard drive geometry, video mode, memory, PS/2, APM, MCA
After that it switch to protected mode, jump to 0x1000 or 0x10000 (depending on the image type)
Then compressed/head.S initialize stack, SMP , and give control to compressed/misc.c that decompress the kernel and give control to it.

PS: all source file mentionned are in arch/i386/boot

Yann Droneaud <>

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:54    [W:0.026 / U:6.228 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site