H44849 s 00075/00000/00000 d D 1.1 02/03/13 20:31:03 patch 2 1 cC cF1 cK09207 cO-rw-rw-r-- e s 00000/00000/00000 d D 1.0 02/03/13 20:31:03 patch 1 0 c BitKeeper file /home/marcelo/bk/linux-2.4/arch/mips/galileo-boards/ev64120/compressed/doit.c cBtorvalds@athlon.transmeta.com|ChangeSet|20020205173056|16047|c1d11a41ed024864 cHplucky.distro.conectiva cK07404 cParch/mips/galileo-boards/ev64120/compressed/doit.c cR4a0eca77af6adab2 cV4 cX0x821 cZ-03:00 e u U f e 0 f x 0x821 t T I 2 /* * By RidgeRun Inc. * * The input to this program is intended to be * a compressed linux kernel. The output of this * program is then a constructed *.S file which * defines a large data structure -- the contents * of which represent the compressed kernel which * can subsequently be used in a program designed * to access that struture for decompression at * runtime and then subsequent kernel bootup. * * Example Usage: * ./doit < piggy.gz > piggy.S * */ #include void printval(int i) { int tth, th, h, t, d; if (i > 99999) { printf("Error - printval outofbounds\n"); return; } tth = 0; th = 0; //tth = (i) / 10000; //th = (i - (tth * 10000)) / 1000; h = (i - ((tth * 10000) + (th * 1000))) / 100; t = (i - ((tth * 10000) + (th * 1000) + (h * 100))) / 10; d = (i - ((tth * 10000) + (th * 1000) + (h * 100) + (t * 10))); //putchar(tth + '0'); //putchar(th + '0'); putchar(h + '0'); putchar(t + '0'); putchar(d + '0'); } main(int argc, char **argv) { int val; int size = 0; unsigned char c; printf("gcc2_compiled.:\n"); printf("__gnu_compiled_c:\n"); printf("\t.globl linux_compressed_start\n"); printf("\t.text\n"); printf("\t.align 2\n"); printf("\t.type linux_compressed_start,@object\n"); printf("linux_compressed_start:\n"); val = getchar(); while (val != EOF) { size++; c = (unsigned char) (val & 0x00ff); printf("\t.byte "); printval((int) c); printf("\n"); val = getchar(); } printf("\t.size linux_compressed_start,%d\n", size); printf("\t.globl linux_compressed_size\n"); printf("\t.text\n"); printf("\t.align 2\n"); printf("\t.type linux_compressed_size,@object\n"); printf("\t.size linux_compressed_size,4\n"); printf("linux_compressed_size:\n"); printf("\t.word %d\n", size); } E 2 I 1 E 1