more arm-linux.kernel work

This commit is contained in:
John Reiser
2006-12-16 22:02:51 -08:00
parent bccaafda6d
commit c5cfb7eb40
5 changed files with 1140 additions and 1078 deletions
+6 -10
View File
@@ -1,5 +1,5 @@
/* arm-linux.kernel.vmlinux-head.h
created from arm-linux.kernel.vmlinux-head.bin, 68 (0x44) bytes
created from arm-linux.kernel.vmlinux-head.bin, 8 (0x8) bytes
This file is part of the UPX executable compressor.
@@ -28,14 +28,10 @@
*/
#define STUB_ARM_LINUX_KERNEL_VMLINUX_HEAD_SIZE 68
#define STUB_ARM_LINUX_KERNEL_VMLINUX_HEAD_ADLER32 0xd30518ac
#define STUB_ARM_LINUX_KERNEL_VMLINUX_HEAD_CRC32 0xa10e8134
#define STUB_ARM_LINUX_KERNEL_VMLINUX_HEAD_SIZE 8
#define STUB_ARM_LINUX_KERNEL_VMLINUX_HEAD_ADLER32 0x17bb0637
#define STUB_ARM_LINUX_KERNEL_VMLINUX_HEAD_CRC32 0xccc03eaa
unsigned char stub_arm_linux_kernel_vmlinux_head[68] = {
9, 96, 34,233, 2,208,160,225, 0, 32,160,225, 36, 0,143,226, /* 0x 0 */
10, 16,176,232, 4, 48, 45,229, 13, 48,160,225, 4,192, 45,229, /* 0x 10 */
254,255,255,235, 0, 0, 80,227, 7, 0, 0, 26, 14,112,157,232, /* 0x 20 */
3, 0,130,224, 14,240,160,225, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x 30 */
0, 0, 0, 0 /* 0x 40 */
unsigned char stub_arm_linux_kernel_vmlinux_head[8] = {
14,192,160,225,254,255,255,235 /* 0x 0 */
};
File diff suppressed because it is too large Load Diff
+2 -25
View File
@@ -25,31 +25,8 @@
; <jreiser@users.sourceforge.net>
*/
/* Calling sequence of equivalent code in arch/arm/boot/compressed/misc.c:
decompress_kernel: # (char *out, char *tmp, char *end_tmp, int arch_id)
*/
stmdb r2!,{r0,r3,sp,lr} // &outdata, arch_id, sp_in, retaddr
mov sp,r2 // switch stacks to end_tmp area (64KB)
mov r2,r0 // &outdata
adr r0,.L10
ldmia r0!,{r1,r3,ip} // r0=&indata; r1=insize; r3=outsize; ip=method
str r3,[sp,#-4]! // outsize
mov r3,sp // &outsize
str ip,[sp,#-4]! // method
// PackVmlinuxARM::pack knows the layout of the following words.
bl LINUX000 // (&indata, insize, &outdata, &outsize, method)
spin:
cmp r0,#0 // check for success
bne spin
ldmia sp,{r1,r2,r3,ip,sp,lr} // method, outsize, &outdata, arch_id, sp_in, retaddr
add r0,r2,r3 // rv= &outdata[outsize]
mov pc,lr // return
.L10:
.long COMPRESSED_LENGTH
.long UNCOMPRESSED_LENGTH
.long METHOD
mov ip,lr // ip= retaddr
bl LINUX000 // lr= PIC location of compressed data
// Compressed data appears >here<, then decompressor.
// vi:ts=8:et:nowrap
+57
View File
@@ -43,6 +43,37 @@
*/
section LINUX000
// bkpt // qemu DEBUG only
/* 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
*/
mov r1,r2 // tmp_end
mov r2,r0 // &outdata
mov r0,lr // &indata
str ip,[r1,#-4]! // push retaddr on new stack
// Value stored from r1 to memory will be overwritten by outsize.
stmdb r1!,{r0,r1,r2,r3,sp} // &indata, space, &outdata, arch_id, sp_in
ldr r3,2*4+.L10 // method
mov sp,r1 // switch stacks to tmp_end area (64KB)
ldr r1,0*4+.L10 // insize
str r3,[sp,#-4]! // method
ldr r3,1*4+.L10 // outsize
str r3,[sp,#2*4] // outsize
add r3,sp, #2*4 // &outsize
bl .L20 // (&indata, insize, &outdata, &outsize, method)
spin:
cmp r0,#0 // check for success
bne spin
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]
mov pc,lr // return
.L10:
.long COMPRESSED_LENGTH
.long UNCOMPRESSED_LENGTH
.long METHOD
.L20:
/*
r0= inptr
r1= insize
@@ -81,6 +112,32 @@ section NRV2E
// ============= UNFILTER
// =============
#if 0 /*{ remind me about parameters for unfilter? */
section LXCKLLT9
pop ecx // MATCH05 len
pop edx // MATCH04 cto
pop edi // MATCH03 src
ckt32 edi, dl // dl has cto8
/*
;edi: adjust for the difference between 0 origin of buffer at filter,
;and actual origin of destination at unfilter.
;Filter.addvalue is 0: destination origin is unknown at filter time.
;The input data is still relocatable, and address is assigned later
;[as of 2004-12-15 it is 'always' 0x100000].
*/
section LXCALLT9
pop ecx // MATCH05 len
pop edi // MATCH03 src
cjt32 0
section LINUX990
pop esi // MATCH02 restore
pop edi // MATCH01 restore
xor ebx, ebx // booting the 1st cpu
lret // MATCH00 set cs
#endif /*}*/
section LXCKLLT9
mvn ip,#4
bkpt