2008-07-13 Bean <bean123ch@gmail.com>
* Makefile.in (enable_lzo): New rule. * conf/i386-pc.rmk (grub_mkimage_SOURCES): New test with enable_lzo. * configure.ac (ENABLE_LZO): New option --enable-lzo. * boot/i386/pc/lnxboot.S: #include <config.h>. * include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE): Change its value accordding to the compression algorithm used, lzo or lzma. * util/i386/pc/grub-mkimage.c (compress_kernel): Use different compression algorithm according to configure macro. * kern/i386/pc/startup.S (codestart): Likewise. * kern/i386/pc/lzma_decode.S: New file. * include/grub/lib/LzFind.h: Likewise. * include/grub/lib/LzHash.h: Likewise. * include/grub/lib/LzmaDec.h: Likewise. * include/grub/lib/LzmaEnc.h: Likewise. * include/grub/lib/LzmaTypes.h: Likewise. * lib/LzFind.c: Likewise. * lib/LzmaDec.c: Likewise. * lib/LzmaEnc.c: Likewise.
This commit is contained in:
parent
4ae821ac9a
commit
aa24b516a2
20 changed files with 5747 additions and 20 deletions
|
@ -200,6 +200,7 @@ codestart:
|
|||
incl %eax
|
||||
call EXT_C(grub_gate_a20)
|
||||
|
||||
#if defined(ENABLE_LZO)
|
||||
/* decompress the compressed part and put the result at 1MB */
|
||||
movl $GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR, %esi
|
||||
movl $(START_SYMBOL + GRUB_KERNEL_MACHINE_RAW_SIZE), %edi
|
||||
|
@ -213,6 +214,23 @@ codestart:
|
|||
/* copy back the decompressed part */
|
||||
movl %eax, %ecx
|
||||
cld
|
||||
#elif defined(ENABLE_LZMA)
|
||||
movl $GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR, %edi
|
||||
movl $(START_SYMBOL + GRUB_KERNEL_MACHINE_RAW_SIZE), %esi
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
movl EXT_C(grub_kernel_image_size), %ecx
|
||||
addl EXT_C(grub_total_module_size), %ecx
|
||||
addl EXT_C(grub_memdisk_image_size), %ecx
|
||||
subl $GRUB_KERNEL_MACHINE_RAW_SIZE, %ecx
|
||||
pushl %ecx
|
||||
leal (%edi, %ecx), %ebx
|
||||
call _LzmaDecodeA
|
||||
popl %ecx
|
||||
popl %edi
|
||||
popl %esi
|
||||
#endif
|
||||
|
||||
rep
|
||||
movsb
|
||||
|
||||
|
@ -476,7 +494,11 @@ gate_a20_check_state:
|
|||
popl %ebx
|
||||
ret
|
||||
|
||||
#if defined(ENABLE_LZO)
|
||||
#include "lzo1x.S"
|
||||
#elif defined(ENABLE_LZMA)
|
||||
#include "lzma_decode.S"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The code beyond this point is compressed. Assert that the uncompressed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue