Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
doit.c
Package: linux-2.4.20.tar.gz [view]
Upload User: jlfgdled
Upload Date: 2013-04-10
Package Size: 33168k
Code Size: 2k
Category:
Linux-Unix program
Development Platform:
Unix_Linux
- /*
- * 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 <stdio.h>
- void printval(int i)
- {
- int tth, th, h, t, d;
- if (i > 99999) {
- printf("Error - printval outofboundsn");
- 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_startn");
- printf("t.textn");
- printf("t.align 2n");
- printf("t.type linux_compressed_start,@objectn");
- 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,%dn", size);
- printf("t.globl linux_compressed_sizen");
- printf("t.textn");
- printf("t.align 2n");
- printf("t.type linux_compressed_size,@objectn");
- printf("t.size linux_compressed_size,4n");
- printf("linux_compressed_size:n");
- printf("t.word %dn", size);
- }