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=windows-1252">
5<META name="GENERATOR" content="Microsoft FrontPage 5.0">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>Restrictions on DOL Files and Boot-Related Terminology</TITLE>
8<LINK rel="stylesheet" href="../CSS/revolution.css">
9</HEAD>
10<BODY>
11<H1>Restrictions on DOL Files and Boot-Related Terminology</H1>
12<H2>Introduction</H2>
13<P>This document briefly describes boot-related terminology for Wii disc applications and facts that developers should know.</P>
14<P>Refer to NADK descriptions for terminology related to NAND applications.</P>
15<H2>Apploader</H2>
16<P>The <CODE>apploader</CODE> module is stored on a disc to assist in booting disc applications. In the development environment, development machines use <CODE>RVL/boot/apploader.img</CODE> under the directory where Revolution SDK is installed.</P>
17<H2>DOL Files</H2>
18<P>The DOL file format is similar to the ELF file format used for the Wii. Use the <A href="../tools/makedol.html"><CODE>makedol</CODE></A> command to convert an application's ELF file into this format. This file is stored on a disc for disc applications. This file is given a <CODE>.dsf</CODE> extension, along with other system information, on the NDEV.</P>
19<H2><A name="Dol file restriction">Address Restrictions on DOL Files (9 MB)</A></H2>
20<P>On a Wii console, sections cannot be placed at memory addresses above <CODE>0x8090_0000</CODE> (9 MB). In DEVELOPMENT mode on development hardware, sections cannot be placed at memory addresses above <CODE>0x8120_0000</CODE> (18 MB).</P>
21<P>If violated, <CODE>apploader</CODE> will generate an assertion error. To solve this problem if you violate this restriction, consult the <CODE>.map</CODE> file for the application to see which section is big.
22</P>
23
24<OL>
25<LI>If the DATA or SDATA section is large:</LI>
26<P>
27Try placing data on a DVD and reading it at run time.
28</P>
29<LI>If the TEXT section is large:</LI>
30<P>
31Try using the <A href="../os/Rel/intro.html">relocatable module system</A> or split it into DOL files. (See the <A href="../os/Reset/OSExec.html"><CODE>OSExec</CODE></A> function.)
32</P>
33<LI>If the BSS or SBSS section is large:</LI>
34<P>
35Instead of statically allocating memory using uninitialized variables, try allocating memory dynamically. <BR> <BR>
36
37</P>
38
39</OL>
40<H2><A name="FST">FST (File Symbol Table)</A></H2>
41<P>The FST contains information for all of the files under <CODE>DVDRoot</CODE>. See the disc drive programming manual for more detail. The FST is included in a DSF file on the NDEV.</P>
42<P>The FST is placed at the highest address (24 MB, the maximum FST length) in MEM1. For &quot;FST max length,&quot; see the next section.</P>
43<H2>FST Max Length</H2>
44<P>The maximum FST length is the buffer size in MEM1 that must be prepared for the FST. For a game that consists of only one disc, the maximum FST length can be the same as that disc's FST length. For a game that consists of multiple discs, the FST for the second disc may be longer than the FST for the first disc. If this is the case, you need to prepare a big enough area for FST so that both the first and second discs' FST can fit. This area is usually MAX(FST size for the first disc, FST size for the second disc), which is the source of the term &quot;FST max length.&quot;</P>
45<P>The NDEV software supports creating multiple discs. Using this feature, the maximum FST length for multi-disc games will be calculated and set. For single-disc games, the disc's FST size will be the same as the maximum FST size.</P>
46<h2><a name="Bootinfo2">Bootinfo2 (BI2)</a></h2>
47<P>The 8-KB <CODE>Bootinfo2</CODE> region contains the following settings.</P>
48<UL>
49<LI>MEM2 size to simulate (see <A href="../tools/BI2/setsmem2size.html"><CODE>setsmem2size</CODE></A>)
50</UL>
51<P>On the NDEV, <CODE>bootinfo2</CODE> is saved to a <A href="#Dsf_file">DSF file</A> after running <CODE>ndrun</CODE>.</P>
52<P>To modify settings in <CODE>bootinfo2</CODE>, use the corresponding <A href="../tools/toc.html">settings script</A>. For details on how to use these scripts, refer to each script's page in the <I>Revolution Function Reference Manual</I>.</P>
53<P>Note that you must execute <CODE>ndrun</CODE> at least once to propagate changes before creating master data.</P>
54<h2><a name="Bootinfo3">Bootinfo3 (BI3)</a></h2>
55<P>The 8-KB <CODE>Bootinfo3</CODE> region contains the following settings.</P>
56<UL>
57<LI>Country code for disc (see <a href="../tools/BI2/setcountrycode.html"><CODE>setcountrycode</CODE></a>)<br>
58<LI>Parental Controls settings
59</UL>
60<P><CODE>Bootinfo3</CODE> is included in the <A href="#rvl_bin"><CODE>rvl.bin</CODE> file</A>. On the NDEV, this information is saved in an <A href="#Rcf_file">RCF file</A> after running <CODE>ndrun</CODE>.</P>
61<P>To modify settings in <CODE>bootinfo3</CODE>, use the corresponding <A href="../tools/toc.html">settings script</A>. For details on how to use these scripts, refer to each script's page in the <I>Revolution Function Reference Manual</I>.</P>
62<P>Note that you must execute <CODE>ndrun</CODE> at least once to propagate changes before creating master data.</P>
63<h2><a name="rvl_bin">Revolution System File (<CODE>rvl.bin</CODE>)</a></h2>
64<P>The Revolution System File (<CODE>rvl.bin</CODE>) contains the following settings.</P>
65<UL>
66<LI>Firmware version to use when the application is started
67<LI>Application game code
68<LI>Application company code
69</UL>
70<P>On the NDEV, this information is saved to an <A href="#Rcf_file">RCF file</A> after running <CODE>ndrun</CODE>.</P>
71<P>To modify these settings, use the corresponding <A href="../tools/toc.html">settings script</A>. For details on how to use these scripts, refer to each script's page in the <I>Revolution Function Reference Manual</I>.</P>
72<P>Note that you must execute <CODE>ndrun</CODE> at least once to propagate changes before creating master data.</P>
73<H2><A name="Dsf_file">DSF Files</A></H2>
74<P>A DSF file is an NDEV-specific file that contains <CODE>Bootinfo2</CODE>, DOL files, and an FST.</P>
75<H2><A name="Rcf_file">RCF Files</A></H2>
76<P>An RCF file is an NDEV-specific file that contains <CODE>Bootinfo3</CODE> and <CODE>rvl.bin</CODE>.</P>
77
78<H2><A name="Rcf_file">Linker Command Files (LCF Files)</A></H2>
79<P>Linker command files list settings for things like memory allocation for each section.<br>For details, see Chapters 14 and 15 in <CODE>Build_Tools_Reference_NINTENDO_Wii.pdf</CODE>, included in the CodeWarrior package.<br><br> <B><B>Note:</B></B>The <CODE>__ArenaLo</CODE> and <CODE>__ArenaHi</CODE> specifications in the linker command file are settings left over from the Nintendo GameCube SDK era. These specifications are currently ignored.<br><br> The location of the arena is set by the library at boot time. The lower boundary of the MEM1 arena is set to <CODE>_dB_stack_addr</CODE> when using a debugger, and to <CODE>_stack_addr</CODE> otherwise. The upper boundary of the MEM1 arena is set to <CODE>0x81700000</CODE>.
80
81<br> <br> To change the arena location, make settings inside your application using functions such as <A href="../os/Arena/OSSetMEM1ArenaLo.html"><CODE>OSSetMEM1ArenaLo</CODE></A> and <A href="../os/Arena/OSSetMEM1ArenaHi.html"><CODE>OSSetMEM1ArenaHi</CODE></A>.
82
83</P>
84
85<H2>Revision History</H2>
86<P>
872009/01/13 Added information about LCF files and arena location.<BR>2008/12/29 Revised the description of the address restrictions on DOL files.<BR>2008/07/23 Revised wording.<BR>2008/07/18 Updated.<BR>2008/07/15 Initial version.
88</P>
89<hr><p>CONFIDENTIAL</p></body>
90</HTML>