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="IBM WebSphere Studio Homepage Builder Version 7.0.1.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../../css/nitro.css">
8<TITLE>OS Demos</TITLE>
9</HEAD>
10<BODY>
11<H1>Operating System (OS) Sample Demos</H1>
12<H2>Location</H2>
13<P><CODE>$TwlSDK/build/demos/os</CODE><BR> <CODE>$TwlSDK/build/demos.TWL/os</CODE></P>
14<H2>Compilation</H2>
15<P>Move to the <CODE>$TwlSDK/build/demos/os</CODE> (or <CODE>$TwlSDK/build/demos.TWL/os</CODE>) directory and enter the following.</P>
16<BLOCKQUOTE><CODE>% make</CODE></BLOCKQUOTE>
17<P> The compilation begins, and the SRL executable file and the NEF or TEF files with binary information are generated in the following directory.</P>
18<BLOCKQUOTE><CODE>$TwlSDK/build/demos/os/(sample name)/bin/(platform)/(target)/</CODE><BR> <CODE>$TwlSDK/build/demos.TWL/os/(sample name)/bin/(platform)/(target)/</CODE></BLOCKQUOTE>
19<P>&nbsp;For example:</P>
20<BLOCKQUOTE><CODE>$TwlSDK/build/demos/os/thread-1/bin/ARM9-TS/Release/main.srl</CODE></BLOCKQUOTE>
21<P>is the executable file for the <CODE>thread-1</CODE> demo.</P>
22
23<H2>Execution</H2>
24<H3>For NITRO ROMs</H3>
25
26<P>If using the ensata emulator:</P>
27<UL>
28<LI>Execute NEF and SRL files with ensata
29</UL>
30<P>If using IS-NITRO-DEBUGGER:</P>
31<UL>
32<LI>Load and execute an NLF file with IS-NITRO-DEBUGGER
33<LI>Execute an SRL file with IS-NITRO-DEBUGGER
34<LI>Execute an SRL file with IS-NITRO-DEBUGGER using the <CODE>loadrun.exe</CODE> tool from the command line
35</UL>
36<P>If using IS-TWL-DEBUGGER:</P>
37<UL>
38<LI>Load and execute an NLF file with IS-TWL-DEBUGGER
39<LI>Execute an SRL file with IS-TWL-DEBUGGER
40<LI>Execute an SRL file with IS-TWL-DEBUGGER using the <CODE>loadrun.TWL.exe</CODE> tool from the command line
41</UL>
42<H3>For TWL/NITRO Hybrid ROMs</H3>
43<P>If using IS-NITRO-DEBUGGER:</P>
44<UL>
45<LI>Execute an SRL file with IS-NITRO-DEBUGGER
46<LI>Execute an SRL file with IS-NITRO-DEBUGGER using the <CODE>loadrun.exe</CODE> tool from the command line
47</UL>
48<P>If using IS-TWL-DEBUGGER:</P>
49<UL>
50<LI>Load and execute a TLF file with IS-TWL-DEBUGGER
51<LI>Execute an SRL file with IS-TWL-DEBUGGER
52<LI>Execute an SRL file with IS-TWL-DEBUGGER using the <CODE>loadrun.TWL.exe</CODE> tool from the command line
53</UL>
54<H3>For TWL Limited ROMs</H3>
55<P>If using IS-TWL-DEBUGGER:</P>
56<UL>
57<LI>Load and execute a TLF file with IS-TWL-DEBUGGER
58<LI>Execute an SRL file with IS-TWL-DEBUGGER
59<LI>Execute an SRL file with IS-TWL-DEBUGGER using the <CODE>loadrun.TWL.exe</CODE> tool from the command line
60</UL>
61<H2>Description</H2>
62<BR>
63<TABLE width="720">
64  <TBODY>
65    <TR>
66<TH>Name</TH>
67<TH>Directory</TH>
68<TH>Operation</TH>
69    </TR>
70    <TR>
71<TD width="187"><CODE>alarm-1</CODE></TD>
72<TD><CODE>demos</CODE></TD>
73<TD width="525">Uses one one-time alarm.</TD>
74    </TR>
75    <TR>
76<TD width="187"><CODE>alarm-2</CODE></TD>
77<TD><CODE>demos</CODE></TD>
78<TD width="525">Uses the periodic alarm and a one-time alarm.</TD>
79    </TR>
80    <TR>
81<TD width="187"><CODE>arena-1</CODE></TD>
82<TD><CODE>demos</CODE></TD>
83<TD width="525">Sets up the arena and acquires memory.</TD>
84    </TR>
85    <TR>
86<TD><CODE>argument-1</CODE></TD>
87<TD><CODE>demos</CODE></TD>
88<TD>Embeds argument data in the ROM image and display.</TD>
89    </TR>
90    <TR>
91<TD><CODE>argument-2</CODE></TD>
92<TD><CODE>demos</CODE></TD>
93<TD>Creates argument data from a string in real-time and sets it.</TD>
94    </TR>
95    <TR>
96<TD><CODE>callTrace-1</CODE></TD>
97<TD><CODE>demos</CODE></TD>
98<TD>Carries out the function call trace display without using the thread system.</TD>
99    </TR>
100    <TR>
101<TD><CODE>callTrace-2</CODE></TD>
102<TD><CODE>demos</CODE></TD>
103<TD>Carries out the function call trace display using the thread system.</TD>
104    </TR>
105    <TR>
106<TD><CODE>consoleType-1</CODE></TD>
107<TD><CODE>demos</CODE></TD>
108<TD>Displays information about the operating environment on the screen.</TD>
109    </TR>
110    <TR>
111<TD><CODE>cplusplus-1</CODE></TD>
112<TD><CODE>demos</CODE></TD>
113<TD>Initializes the memory control before calling the static initializer for C++ implementation.</TD>
114    </TR>
115    <TR>
116<TD><CODE>cpuSpeed-1</CODE></TD>
117<TD><CODE>demos.TWL</CODE></TD>
118<TD>Changes the CPU speed between normal speed and double speed.</TD>
119    </TR>
120    <TR>
121<TD width="187"><CODE>entropy-1</CODE></TD>
122<TD><CODE>demos</CODE></TD>
123<TD width="525">Uses the <A href="../../os/entropy/OS_GetLowEntropyData.html"><CODE>OS_GetLowEntropyData</CODE></A> function..</TD>
124    </TR>
125    <TR>
126<TD width="187"><CODE>event-1</CODE></TD>
127<TD><CODE>demos</CODE></TD>
128<TD width="525">Starts a thread in response to an event.</TD>
129    </TR>
130    <TR>
131<TD width="187"><CODE>exceptionDisplay-1</CODE></TD>
132<TD><CODE>demos</CODE></TD>
133<TD width="525">Displays exceptions and uses the exception callback.<BR>(IS-TWL-DEBUGGER does not use exception callbacks.)</TD>
134    </TR>
135    <TR>
136<TD><CODE>exceptionDisplay-2</CODE></TD>
137<TD><CODE>demos</CODE></TD>
138<TD>Pseudo-generates an exception when dividing by zero.</TD>
139    </TR>
140    <TR>
141<TD><CODE>exceptionDisplay-3</CODE></TD>
142<TD><CODE>demos</CODE></TD>
143<TD>Shows the function call trace information when an exception occurs.<BR>(IS-TWL-DEBUGGER does not display function call trace information.)</TD>
144    </TR>
145    <TR>
146<TD><CODE>exceptionDisplay-4</CODE></TD>
147<TD><CODE>demos</CODE></TD>
148<TD>Displays the exception context on the screen when an exception occurs.<BR>(IS-TWL-DEBUGGER does not display context on the screen.)</TD>
149    </TR>
150<!--     <TR>       <TD><EM><STRONG><CODE>favorite-color</CODE></STRONG></EM></TD>       <TD>????????????????????????????????????</TD>     </TR> -->
151    <TR>
152<TD><CODE>forChina-1</CODE></TD>
153<TD><CODE>demos</CODE></TD>
154<TD>A simplified sample for creating applications designed for China.</TD>
155    </TR>
156    <TR>
157<TD><CODE>forChina-fs</CODE></TD>
158<TD><CODE>demos</CODE></TD>
159<TD>The same as <CODE>forChina-1</CODE>, but it uniquely defines the <CODE>OS_ShowAttentionChina</CODE> function and gets the image data from the file system.</TD>
160    </TR>
161    <TR>
162<TD><CODE>forKorea-1</CODE></TD>
163<TD><CODE>demos</CODE></TD>
164<TD>A simplified sample for creating applications designed for Korea.</TD>
165    </TR>
166    <TR>
167<TD><CODE>functionCost-1</CODE></TD>
168<TD><CODE>demos</CODE></TD>
169<TD>Measures and displays the function cost.</TD>
170    </TR>
171    <TR>
172<TD><CODE>functionCost-2</CODE></TD>
173<TD><CODE>demos</CODE></TD>
174<TD>Measures and displays the function cost with multiple threads.</TD>
175    </TR>
176    <TR>
177<TD><CODE>functionCost-3</CODE></TD>
178<TD><CODE>demos</CODE></TD>
179<TD>Calculates and displays the total function cost measured with multiple threads.</TD>
180    </TR>
181    <TR>
182<TD width="187"><CODE>heap-1</CODE></TD>
183<TD><CODE>demos</CODE></TD>
184<TD width="525">Creates a heap and then allocates and frees memory areas.</TD>
185    </TR>
186    <TR>
187<TD width="187"><CODE>message-1</CODE></TD>
188<TD><CODE>demos</CODE></TD>
189<TD width="525">Starts a thread in response to an event.</TD>
190    </TR>
191    <TR>
192<TD width="187"><CODE>mutex-1</CODE></TD>
193<TD><CODE>demos</CODE></TD>
194<TD width="525">When accessing one function from multiple threads, uses mutex to gain exclusive control.</TD>
195    </TR>
196    <TR>
197<TD width="187"><CODE>mutex-2</CODE></TD>
198<TD><CODE>demos</CODE></TD>
199<TD width="525">Unlocks a mutex when a thread is completed.</TD>
200    </TR>
201    <TR>
202<TD width="187"><CODE>os_jump</CODE></TD>
203<TD><CODE>demos.TWL</CODE></TD>
204<TD width="525">Demonstrates the operation of functions that go through hardware reset such as <A href="../../os/appJump/OS_JumpToSystemMenu.html"><CODE>OS_JumpToSystemMenu</CODE></A> and <A href="../../os/appJump/OS_RebootSystem.html"><CODE>OS_RebootSystem</CODE></A>.</TD>
205    </TR>
206    <TR>
207<TD><CODE>reset-1</CODE></TD>
208<TD><CODE>demos</CODE></TD>
209<TD>Resets software.</TD>
210    </TR>
211    <TR>
212<TD width="187"><CODE>simple-1</CODE></TD>
213<TD><CODE>demos</CODE></TD>
214<TD width="525">The simplest of the demos.</TD>
215    </TR>
216    <TR>
217<TD width="187"><CODE>sleep-1</CODE></TD>
218<TD><CODE>demos</CODE></TD>
219<TD width="525">Puts a thread to sleep for a specified length of time.</TD>
220    </TR>
221    <TR>
222<TD><CODE>spinwait-1</CODE></TD>
223<TD><CODE>demos</CODE></TD>
224<TD>Uses the <A href="../../os/system/OS_SpinWait.html"><CODE>OS_SpinWait</CODE></A> function to wait for a fixed period of time.</TD>
225    </TR>
226    <TR>
227<TD width="187"><CODE>thread-1</CODE></TD>
228<TD><CODE>demos</CODE></TD>
229<TD width="525">Creates two threads so that one directly wakes up the other.</TD>
230    </TR>
231    <TR>
232<TD width="187"><CODE>thread-2</CODE></TD>
233<TD><CODE>demos</CODE></TD>
234<TD width="525">Creates two threads and starts each one from an interrupt handler.</TD>
235    </TR>
236    <TR>
237<TD width="187"><CODE>thread-3</CODE></TD>
238<TD><CODE>demos</CODE></TD>
239<TD width="525">An example of how to use the <A href="../../os/thread/OS_JoinThread.html"><CODE>OS_JoinThread</CODE></A> function.</TD>
240    </TR>
241    <TR>
242<TD><CODE>threadQueue-1</CODE></TD>
243<TD><CODE>demos</CODE></TD>
244<TD>Starts a thread using a thread queue.</TD>
245    </TR>
246    <TR>
247<TD><CODE>threadYield-1</CODE></TD>
248<TD><CODE>demos</CODE></TD>
249<TD>An example of how to use the <A href="../../os/thread/OS_YieldThread.html"><CODE>OS_YieldThread</CODE></A> function.</TD>
250    </TR>
251    <TR>
252<TD width="187"><CODE>tick-1</CODE></TD>
253<TD><CODE>demos</CODE></TD>
254<TD width="525">Gets the system's tick value.</TD>
255    </TR>
256    <TR>
257<TD width="187"><CODE>timer-1</CODE></TD>
258<TD><CODE>demos</CODE></TD>
259<TD width="525">Uses a 16-bit timer and a 32-bit timer.</TD>
260    </TR>
261    <TR>
262<TD><CODE>valarm-1</CODE></TD>
263<TD><CODE>demos</CODE></TD>
264<TD>Uses an alarm that uses V-Count.</TD>
265    </TR>
266    <TR>
267<TD><CODE>waitIrq-1</CODE></TD>
268<TD><CODE>demos</CODE></TD>
269<TD>Waits for a V-Blank while operating a separate thread.</TD>
270    </TR>
271    <TR>
272<TD><CODE>waitIrq-2</CODE></TD>
273<TD><CODE>demos</CODE></TD>
274<TD>Shows the difference in operation between the <A href="../../os/irq/OS_WaitIrq.html"><CODE>OS_WaitIrq</CODE></A> and <A href="../../os/irq/OS_WaitAnyIrq.html"><CODE>OS_WaitAnyIrq</CODE></A> functions.</TD>
275    </TR>
276  </TBODY>
277</TABLE>
278<H2>Operation</H2>
279<P><CODE></CODE>The <CODE>exceptionDisplay-*</CODE> and <CODE>reset-1</CODE> demos do not work properly with ensata.</CODE></P>
280<P><CODE></CODE>With IS-TWL-DEBUGGER, the <CODE>exceptionDisplay-*</CODE> demos halt on the code where the interrupt occurs.</CODE></P>
281<P>Use <CODE><A href="../../romfiles/TwlNmenu.html">TwlNmenu.srl</A></CODE> to import the TAD file into system memory before you execute <CODE>arbitrary_jump</CODE>.</P>
282<P>Several of the demos use the <A href="../../os/debug/OS_Printf.html"><CODE>OS_Printf</CODE></A> function to display information in the debug console. However, the FINALROM build of a ROM disables the <A href="../../os/debug/OS_Printf.html"><CODE>OS_Printf</CODE></A> function, so this information cannot be verified with the FINALROM build.</P>
283<H2>See Also</H2>
284<P><A href="../../os/list_os.html">OS Function List</A></P>
285<H2>Revision History</H2>
286<P>2009/07/01 Revised explanation of <CODE>exceptionDisplay-*</CODE>.<BR> 2009/06/17 Added explanation of the <CODE>exceptionDisplay-4</CODE> demo.<BR> 2008/07/09 Added <CODE>argument-1</CODE> and <CODE>argument-2</CODE>, which had been deleted for a time.<BR> 2008/04/25 Reworked table. Changed the lists for TWL.<BR>2006/10/19 Added description for <code>forKorea-1</code> sample.<br />2005/09/09 Added <CODE>argument-2</CODE>.<BR> 2005/07/22 Corrected the erroneous omission of <CODE>functionCost-1</CODE>.<BR> 2005/07/21 Added <CODE>argument-1</CODE>.<BR> 2005/07/14 Added <CODE>thread-10</CODE>.<BR> 2005/07/13 Added <CODE>thread-6</CODE>, <CODE>thread-7</CODE>, <CODE>thread-8</CODE>, and <CODE>thread-9</CODE>.<BR>2005/07/11 Added description for <code>forChina-1</code> and <CODE>forChina-fs</code> samples.<br />2005/05/10 Added description of <code>favorite-color</code> demo.<br />2005/03/02 Revised descriptions to reflect current support environment conditions.<br />2004/12/08 Removed <code>interrupt-key-1</code>, Revised <B>Operation</B>.<br />2004/09/01 Added <code>reset-1</code>.<br />2004/08/17 Standardized the notation of IS-NITRO-EMULATOR.<br />2004/07/10 Changed from <code>.bin</code> to <code>.srl.</code>.<br />2004/06/25 Added <code>thread-5.</code><br />2004/06/08 Made it possible to insert the demo of the <code>profile</code> function into <code>Makefile</code> by default.<br />2004/05/24 Added <code>functionCost-1</code>, <code>functionCost-2</code>, <code>functionCost-3</code>, <code>waitlrq-1</code>, and <code>waitlrq-2</code>. Added description about necessary <code>profile</code> functions.<br />2004/04/15 Added description of <code>callTrace-1</code>, <code>callTrace-2</code>, <code>cplusplus-1</code>, and <code>exceptionDisplay-3</code>.<br />2004/04/05 Added description of <code>mutex-2</code>, <code>sleep-1</code>, and <code>timer-1</code>. Changed <code>systemClock-1</code> to <code>tick-1</code>.<br />2004/03/17 Added description of <code>exceptionDisplay-2</code>, <code>valarm-1</code>, and <code>spinWait-1.</code><br />2004/02/05 Added description of <code>alarm-1</code>, <code>alarm-2</code>, <code>exceptionDisplay-1</code>, and <code>systemClock-1</code>.<br />2004/01/18 Moved <code>interrupt-dma-1</code> sample to <code>MI</code> as <code>dmaCallback-1</code>.<br />2004/01/09 Initial version.</P>
287<hr><p>CONFIDENTIAL</p></body>
288</HTML>