1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=utf-8"> 5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<TITLE>compstatic.TWL</TITLE> 8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css"> 9<STYLE type="text/css"> 10<!-- 11.sample_source{ 12 background-color : #e8e8e8; 13} 14H3{ 15 color : teal; 16} 17.command_list{ 18 margin-bottom : 16pt; 19} 20.command_desc{ 21 } 22.command_item{ 23 margin-top : 16pt; 24 margin-left: 12pt; 25 background-color : #e8e8e8; 26} 27.blockquoted_table { 28 border : 1px; 29 width : 80%; 30} 31TD,TH{ 32 border-color : #c0d8d8; 33 padding : 1pt 4pt 1pt 4pt; 34 border-width : 1px; 35 border-style : solid; 36} 37--> 38</STYLE> 39</HEAD> 40<BODY> 41<H1 align="left">compstatic.TWL <IMG src="../image/TWL.gif" align="middle"></H1> 42 43<H2>Description</H2> 44<P><FONT color=#ff0000>This command is for TWL ROMs. See <A href="compstatic.html"><CODE>compstatic</CODE></A> for details on NITRO ROMs.</FONT></P> 45<P> 46The <CODE>compstatic.TWL</CODE> tool compresses a ROM image for an application's static region or extended static region and overlays or extended overlays. In most cases, ROM capacity can be conserved through compression. However, because ROM images must be expanded in memory, the time required for loading is greater in most cases compared to using uncompressed images. 47</P> 48<P> 49Due to limitations of the launcher, a TWL application cannot be created if its ROM image has either a static region or extended static region that exceeds 2.5 MB. However, it is possible to create an application with a static region or extended static region that exceeds 2.5 MB by using <CODE>compstatic.TWL</CODE>. 50</P> 51<P> 52The <CODE>compstatic.TWL</CODE> tool also has a feature for embedding the ROM image digest values of various overlays into the static region's ROM image. This feature helps to prevent tampering with the overlay and extended overlay. 53</P> 54<P> 55When using TWL-SDK's <CODE>make</CODE> environment, compression of the ARM9 static region, extended static region, overlay, and extended overlay is enabled when some value is defined in the environmental variable <CODE>TWL_COMPRESS</CODE>. The feature to embed overlay digest values is enabled automatically regardless of the environmental variable. 56</P> 57 58<H2>Using the Tool</H2> 59<H3>Start Command</H3> 60<PRE><CODE>% compstatic.TWL -a [-d] [-9] [-SHSIZE] [-c] [-C] [-F|-eSUFFIX] [-lFILE] STATICMODULE OVERLAYDEFS [OVERLAYTABLE] LTDSTATICMODULE LTDOVERLAYDEFS [LTDOVERLAYTABLE]</CODE></PRE> 61<P>or</P> 62<PRE><CODE>% compstatic.TWL -a [-d] [-9] [-SHSIZE] [-c] [-C] [-F|-eSUFFIX] [-lFILE] -f RESPONSE_FILE</CODE></PRE> 63<P>The <CODE>-a</CODE> option embeds in the static region the digest value of the overlay or extended overlay specified in <CODE>OVERLAYDEFS/LTDOVERLAYDEFS</CODE>. This digest value is used to confirm the validity of the overlay module at load time. Memory for embedding digest values must be allocated ahead of time. However, as long as the default LCF template file is used, a link script for automatically allocating the required memory is generated by the <A href="makelcf.html"><CODE>makelcf.TWL</CODE></A> tool.</P> 64<P>The <CODE>-d</CODE> option is for outputting <CODE>compstatic.TWL</CODE> debugging messages. Normally there is no need to specify this.</P> 65<P>The <CODE>-9</CODE> option is for compressing the static region files specified in <CODE>STATICMODULE</CODE> as ARM9 code. The decompression process has been integrated with <CODE>crt0.[HYB|LTD].TWL.o</CODE> in TWL-SDK, so no further work is required on the part of the application programmer.</P> 66<P>The <CODE>-S</CODE> option is for compressing the extended static region files specified in <CODE>LTDSTATICMODULE</CODE>. If these files include a header portion to leave uncompressed, specify the size of this portion in <CODE>HSIZE</CODE>; however, usually 0 is specified here to compress everything within the region. The decompression process has been integrated with <CODE>crt0.[HYB|LTD].TWL.o</CODE> in TWL-SDK, so no further work is required on the part of the application programmer.</P> 67<P>The <CODE>-c</CODE> option is for compressing the various overlay files specified in <CODE>OVERLAYDEFS</CODE>. The decompression process is integrated with TWL-SDK's FS library, so the application programmer does not need to add any additional operation.</P> 68<P>The <CODE>-C</CODE> option is for compressing the various extended overlay files specified in <CODE>LTDOVERLAYDEFS</CODE>. The decompression process is integrated with TWL-SDK's FS library, so the application programmer does not need to add any additional operation.</P> 69<P>The <CODE>-e</CODE> and <CODE>-F</CODE> options control the post-compression filenames. If these options are not specified, compression results are output to files of the original filename but with the extension <code>_LZ</code> appended. To change this <CODE>_LZ</CODE> extension, use the <CODE>-e</CODE> option and specify a new extension in <CODE>SUFFIX</CODE>. Specify the <CODE>-F</CODE> option to overwrite the original files with the processed files.</P> 70<P>Specify the <CODE>-I</CODE> option together with the <CODE>-c</CODE> or <CODE>-C</CODE> option. You can pass the list file <a href="#list_format">described later</a> as a parameter to specify overlay modules to exclude from compression.</P> 71<P>The <CODE>-f</CODE> option allows you to specify the files to process with a file containing their filenames, as opposed to using command line arguments to specify their filenames. The file in which filenames are recorded is specified by <CODE>RESPONSE_FILE</CODE>. <CODE>RESPONSE_FILE</CODE> contains the actual filenames in <CODE>STATICMODULE/OVERLAYDEFS/OVERLAYTABLE/LTDSTATICMODULE/LTDOVERLAYDEFS/LTDOVERLAYTABLE</CODE>. Each filename is terminated with <CODE>\0</CODE> and stored in order. Files designated in this way are considered to be designated with a relative path from the directory where <CODE>RESPONSE_FILE</CODE> is located.</P> 72<P>It is currently not possible to compress the ARM7's static region because the ARM7 component does not support automatic decompression.</P> 73 74<A name="list_format"></A> 75<H2>Compression Specification List Format</H2> 76<P>All overlay modules are compressed when the <CODE>-c</CODE> or <CODE>-C</CODE> option is specified. A specific file can be excluded from compression by using the format described below.<BR></P> 77<P>This is written as follows, with the <I>overlay module</I> and <I>compression specifier</I> separated by a comma on a single line. 78<PRE class="command_item"> 79main_overlay_1.TWL.FLX.sbin, E 80main_overlay_2.TWL.FLX.sbin, E 81main_overlay_3.TWL.FLX.sbin, S 82</PRE> 83</P> 84<P>For the <I>overlay module filename</I>, enter the filename actually output to <CODE>$(BINDIR)</CODE> before the file is compressed. You can also specify an extended overlay file.</P> 85<P>The <I>compression specifier</I> has the following meanings. 86<TABLE> 87<TBODY class="blockquoted_table"> 88<TR> 89<TH width="96"><CODE>Compression Specifier</CODE></TH> 90<TH>Description</TH> 91</TR> 92<TR> 93<TD><CODE>S</CODE></TD> 94<TD><CODE>SMART</CODE>: It applies compression according to the <B><CODE>-c</CODE></B> or <B><CODE>-C</CODE></B> option. This is the default behavior.</TD> 95</TR> 96<TR> 97<TD><CODE>E</CODE></TD> 98<TD><CODE>EXCLUSION</CODE>: It excludes the file from compression.</TD> 99</TR> 100</TBODY> 101</TABLE> 102</P> 103<P> 104When the TWL-SDK make environment is used, define both the <CODE>COMPSTATIC_SPEC_FILE</CODE> and <CODE>TWL_COMPRESS</CODE> environment variables. 105<PRE class="command_item"> 106TWL_COMPRESS = TRUE 107COMPSTATIC_SPEC_FILE = <I>FilePath</I> 108</PRE> 109</P> 110<P> 111Beginning with TWL-SDK 5.4, a compression specification list file is automatically generated based on parameter information in the LSF file. (See <A href="makelcf.html">makelcf.TWL</A></CODE>)<BR> If <CODE>COMPSTATIC_SPEC_FILE</CODE> is not specified, the automatically generated file is used.<BR> 112</P> 113 114<H2>Location</H2> 115<P><CODE>$TwlSDK/tools/bin/compstatic.TWL.exe</CODE></P> 116 117<H2>See Also</H2> 118<P><A href="makerom.html"><CODE>makerom.TWL</CODE></A><BR> <A href="makelcf.html"><CODE>makelcf.TWL</CODE></A></P> 119 120<H2>Revision History</H2> 121<P> 1222009/05/14 Added a description of the <CODE>-l</CODE> option. In conjunction with that, added a section entitled "Compression Specification List Format"<BR>2008/11/07 Added the fact that overlays can also be compressed.<BR> 2008/10/28 Made additional revisions to the description of the <CODE>-a</CODE> option.<BR> 2008/09/12 Added details.<BR> 2008/07/09 Preliminary version. 123</P> 124<hr><p>CONFIDENTIAL</p></body> 125</HTML> 126