From 8e492d8798e79cf1fc1581bbe39450854625a44c Mon Sep 17 00:00:00 2001 From: John Reiser Date: Wed, 25 Feb 2009 13:50:55 -0800 Subject: [PATCH] arm linux kernel: decompress_kernel() returns length, not pointer --- src/p_vmlinz.cpp | 4 ++++ src/stub/arm-linux.kernel.vmlinux.h | 6 +++--- src/stub/armeb-linux.kernel.vmlinux.h | 6 +++--- src/stub/armel-linux.kernel.vmlinuz.h | 6 +++--- src/stub/src/arm-linux.kernel.vmlinux.S | 5 +++-- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/p_vmlinz.cpp b/src/p_vmlinz.cpp index beb51f13..a7e31d36 100644 --- a/src/p_vmlinz.cpp +++ b/src/p_vmlinz.cpp @@ -792,6 +792,10 @@ int PackVmlinuzARMEL::decompressKernel() } got_start = get_te32(5*4 + j + obuf); got_end = get_te32(6*4 + j + obuf); +#if 0 /*{*/ + printf("decompress_kernel=0x%x got_start=0x%x got_end=0x%x\n", + decompress_kernel, got_start, got_end); +#endif /*}*/ break; } if (0==decompress_kernel) { diff --git a/src/stub/arm-linux.kernel.vmlinux.h b/src/stub/arm-linux.kernel.vmlinux.h index d09b912a..451617b2 100644 --- a/src/stub/arm-linux.kernel.vmlinux.h +++ b/src/stub/arm-linux.kernel.vmlinux.h @@ -32,8 +32,8 @@ #define STUB_ARM_LINUX_KERNEL_VMLINUX_SIZE 17053 -#define STUB_ARM_LINUX_KERNEL_VMLINUX_ADLER32 0xf1b6dcef -#define STUB_ARM_LINUX_KERNEL_VMLINUX_CRC32 0x825e0301 +#define STUB_ARM_LINUX_KERNEL_VMLINUX_ADLER32 0xaefddd0d +#define STUB_ARM_LINUX_KERNEL_VMLINUX_CRC32 0xfd094154 unsigned char stub_arm_linux_kernel_vmlinux[17053] = { /* 0x0000 */ 127, 69, 76, 70, 1, 1, 1, 97, 0, 0, 0, 0, 0, 0, 0, 0, @@ -45,7 +45,7 @@ unsigned char stub_arm_linux_kernel_vmlinux[17053] = { /* 0x0060 */ 8, 48,141,226,254,255,255,235, 14, 0, 0,234, 0, 0, 0, 0, /* 0x0070 */ 0, 0, 0, 0, 0, 0, 80,227, 14, 0, 0, 26, 12, 0,157,229, /* 0x0080 */ 8, 16,157,229, 0, 32,160,227, 0, 48,160,227,254,255,255,235, -/* 0x0090 */ 15,112,157,232, 3, 0,130,224, 14,240,160,225,255, 48, 3,226, +/* 0x0090 */ 15,112,157,232, 2, 0,160,225, 14,240,160,225,255, 48, 3,226, /* 0x00a0 */ 80, 0, 83,227, 81, 0, 83,227, 14,240,160, 17, 33, 17,176,225, /* 0x00b0 */ 0, 0, 80, 19, 14,240,160, 1, 1, 16, 65,226, 1, 33,144,231, /* 0x00c0 */ 15, 52, 2,226, 11, 4, 83,227, 12, 0, 0, 26,255, 52, 2,226, diff --git a/src/stub/armeb-linux.kernel.vmlinux.h b/src/stub/armeb-linux.kernel.vmlinux.h index 171a69dd..b26b9ab8 100644 --- a/src/stub/armeb-linux.kernel.vmlinux.h +++ b/src/stub/armeb-linux.kernel.vmlinux.h @@ -32,8 +32,8 @@ #define STUB_ARMEB_LINUX_KERNEL_VMLINUX_SIZE 17050 -#define STUB_ARMEB_LINUX_KERNEL_VMLINUX_ADLER32 0x5e9bdb94 -#define STUB_ARMEB_LINUX_KERNEL_VMLINUX_CRC32 0xc4201123 +#define STUB_ARMEB_LINUX_KERNEL_VMLINUX_ADLER32 0x1bacdbb2 +#define STUB_ARMEB_LINUX_KERNEL_VMLINUX_CRC32 0x6f6c29f7 unsigned char stub_armeb_linux_kernel_vmlinux[17050] = { /* 0x0000 */ 127, 69, 76, 70, 1, 2, 1, 97, 0, 0, 0, 0, 0, 0, 0, 0, @@ -45,7 +45,7 @@ unsigned char stub_armeb_linux_kernel_vmlinux[17050] = { /* 0x0060 */ 226,141, 48, 8,235,255,255,254,234, 0, 0, 14, 0, 0, 0, 0, /* 0x0070 */ 0, 0, 0, 0,227, 80, 0, 0, 26, 0, 0, 14,229,157, 0, 12, /* 0x0080 */ 229,157, 16, 8,227,160, 32, 0,227,160, 48, 0,235,255,255,254, -/* 0x0090 */ 232,157,112, 15,224,130, 0, 3,225,160,240, 14,226, 3, 48,255, +/* 0x0090 */ 232,157,112, 15,225,160, 0, 2,225,160,240, 14,226, 3, 48,255, /* 0x00a0 */ 227, 83, 0, 80,227, 83, 0, 81, 17,160,240, 14,225,176, 17, 33, /* 0x00b0 */ 19, 80, 0, 0, 1,160,240, 14,226, 65, 16, 1,231,144, 33, 1, /* 0x00c0 */ 226, 2, 52, 15,227, 83, 4, 11, 26, 0, 0, 12,226, 2, 52,255, diff --git a/src/stub/armel-linux.kernel.vmlinuz.h b/src/stub/armel-linux.kernel.vmlinuz.h index 56f55161..ce407b39 100644 --- a/src/stub/armel-linux.kernel.vmlinuz.h +++ b/src/stub/armel-linux.kernel.vmlinuz.h @@ -32,8 +32,8 @@ #define STUB_ARMEL_LINUX_KERNEL_VMLINUZ_SIZE 17053 -#define STUB_ARMEL_LINUX_KERNEL_VMLINUZ_ADLER32 0xf1b6dcef -#define STUB_ARMEL_LINUX_KERNEL_VMLINUZ_CRC32 0x825e0301 +#define STUB_ARMEL_LINUX_KERNEL_VMLINUZ_ADLER32 0xaefddd0d +#define STUB_ARMEL_LINUX_KERNEL_VMLINUZ_CRC32 0xfd094154 unsigned char stub_armel_linux_kernel_vmlinuz[17053] = { /* 0x0000 */ 127, 69, 76, 70, 1, 1, 1, 97, 0, 0, 0, 0, 0, 0, 0, 0, @@ -45,7 +45,7 @@ unsigned char stub_armel_linux_kernel_vmlinuz[17053] = { /* 0x0060 */ 8, 48,141,226,254,255,255,235, 14, 0, 0,234, 0, 0, 0, 0, /* 0x0070 */ 0, 0, 0, 0, 0, 0, 80,227, 14, 0, 0, 26, 12, 0,157,229, /* 0x0080 */ 8, 16,157,229, 0, 32,160,227, 0, 48,160,227,254,255,255,235, -/* 0x0090 */ 15,112,157,232, 3, 0,130,224, 14,240,160,225,255, 48, 3,226, +/* 0x0090 */ 15,112,157,232, 2, 0,160,225, 14,240,160,225,255, 48, 3,226, /* 0x00a0 */ 80, 0, 83,227, 81, 0, 83,227, 14,240,160, 17, 33, 17,176,225, /* 0x00b0 */ 0, 0, 80, 19, 14,240,160, 1, 1, 16, 65,226, 1, 33,144,231, /* 0x00c0 */ 15, 52, 2,226, 11, 4, 83,227, 12, 0, 0, 26,255, 52, 2,226, diff --git a/src/stub/src/arm-linux.kernel.vmlinux.S b/src/stub/src/arm-linux.kernel.vmlinux.S index a8f7184e..e8cb2aed 100644 --- a/src/stub/src/arm-linux.kernel.vmlinux.S +++ b/src/stub/src/arm-linux.kernel.vmlinux.S @@ -43,7 +43,7 @@ to stop in gdb. You'll have to "set $pc+=4" by hand. */ section LINUX000 - // bkpt // qemu DEBUG only + // bkpt // qemu DEBUG only // 'bkpt' == 0xe1200070 /* Calling sequence of equivalent code in arch/arm/boot/compressed/misc.c: decompress_kernel: # (char *out, char *tmp, char *tmp_end, int arch_id) lr= &indata; ip= retaddr # from arm-linux.kernel.vmlinux-head.S @@ -82,7 +82,8 @@ section LINUX010 section LINUX020 ldmia sp,{r0,r1,r2,r3,ip,sp,lr} // method, &indata, outsize, &outdata, arch_id, sp_in, retaddr - add r0,r2,r3 // rv= &outdata[outsize] +// See arch/arm/boot/compressed/misc.c/flush_window(): out = &output_data[output_ptr]; + mov r0,r2 // rv= outsize mov pc,lr // return // =============