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