Operating System (OS) Sample Demos

Location

$TwlSDK/build/demos/os
$TwlSDK/build/demos.TWL/os

Compilation

Move to the $TwlSDK/build/demos/os (or $TwlSDK/build/demos.TWL/os) directory and enter the following.

% make

Compiling begins, and the SRL executable file and the NEF or TEF files with the binary information are generated in:

$TwlSDK/build/demos/os/(sample name)/bin/(platform)/(target)/
$TwlSDK/build/demos.TWL/os/(sample name)/bin/(platform)/(target)/

  For example:

$TwlSDK/build/demos/os/thread-1/bin/ARM9-TS/Release/main.srl

is the executable file for the thread-1 demo.

Running the Tool

For NITRO ROMs

When using the ensata emulator:

When using IS-NITRO-DEBUGGER:

When using IS-TWL-DEBUGGER:

For TWL/NITRO HYBRID ROMs

When using IS-NITRO-DEBUGGER:

If using IS-TWL-DEBUGGER:

For TWL LIMITED ROMs

If using IS-TWL-DEBUGGER:

Description


Name Directory Operation
alarm-1 demos Uses one one-time alarm.
alarm-2 demos Uses the periodic alarm and a one-time alarm.
arena-1 demos Sets up the arena and acquires memory.
argument-1 demos Embeds argument data in the ROM image and display.
argument-2 demos Creates argument data from a string in real-time and sets it.
callTrace-1 demos Carries out the function call trace display without using the thread system.
callTrace-2 demos Carries out the function call trace display using the thread system.
consoleType-1 demos Displays information about the operating environment on the screen.
cplusplus-1 demos Initializes the memory control before calling the static initializer for C++ implementation.
cpuSpeed-1 demos.TWL Changes the CPU speed between normal speed and double speed.
entropy-1 demos Uses the OS_GetLowEntropyData function.
event-1 demos Starts a thread in response to an event.
exceptionDisplay-1 demos Displays exceptions and uses the exception callback.
(IS-TWL-DEBUGGER does not use exception callbacks.)
exceptionDisplay-2 demos Pseudo-generates an exception when dividing by zero.
exceptionDisplay-3 demos Shows the function call trace information when an exception occurs.
(IS-TWL-DEBUGGER does not display function call trace information.)
exceptionDisplay-4 demos Displays the exception context on the screen when an exception occurs.
(IS-TWL-DEBUGGER does not display context on the screen.)
forChina-1 demos A simplified sample for creating applications designed for China.
forKorea-1 demos A simplified sample for creating applications designed for Korea.
functionCost-1 demos Measures and displays the function cost.
functionCost-2 demos Measures and displays the function cost with multiple threads.
functionCost-3 demos Calculates and displays the total function cost measured with multiple threads.
heap-1 demos Creates a heap and then allocates and frees memory areas.
message-1 demos Starts a thread in response to an event.
mutex-1 demos When accessing one function from multiple threads, uses a mutex to gain exclusive control.
mutex-2 demos Unlocks a mutex when a thread is completed.
os_jump demos.TWL Demonstrates the operation of functions that go through hardware reset such as OS_JumpToSystemMenu and OS_RebootSystem.
reset-1 demos Resets software.
simple-1 demos The simplest of the demos.
sleep-1 demos Puts a thread to sleep for a specified length of time.
spinwait-1 demos Uses the OS_SpinWait function to wait for a fixed period of time.
thread-1 demos Creates two threads so that one directly wakes up the other.
thread-2 demos Creates two threads and starts each one from an interrupt handler.
thread-3 demos An example of how to use the OS_JoinThread function.
threadQueue-1 demos Starts a thread using a thread queue.
threadYield-1 demos An example of how to use the OS_YieldThread function.
tick-1 demos Gets the system's tick value.
timer-1 demos Uses a 16-bit timer and a 32-bit timer.
valarm-1 demos Uses an alarm that uses V-Count.
waitIrq-1 demos Waits for a V-Blank while operating a separate thread.
waitIrq-2 demos Shows the difference in operation between the OS_WaitIrq and OS_WaitAnyIrq functions.

Operation

The exceptionDisplay-* and reset-1 demos do not work properly with ensata.

With IS-TWL-DEBUGGER, the exceptionDisplay-* demos halt on the code where the interrupt occurs.

Use TwlNmenu.srl to import the TAD file into system memory before you execute arbitrary_jump.

Several of the demos use the OS_Printf function to display information in the debug console. However, the FINALROM build of a ROM disables the OS_Printf function, so this information cannot be verified with the FINALROM build.

See Also

OS Function List

Revision History

2009/09/10 Removed the forChina-fs sample.
2009/07/01 Revised the descriptions of the exceptionDisplay-* demos.
2009/06/17 Added a description of the exceptionDisplay-4 demo.
2008/07/09 Added argument-1 and argument-2, which had been deleted temporarily.
2008/04/25 Reworked the table. Changed the lists for TWL.
2006/10/19 Added description for forKorea-1 sample.
2005/09/09 Added argument-2.
2005/07/22 Corrected the erroneous omission of functionCost-1.
2005/07/21 Added argument-1.
2005/07/14 Added thread-10.
2005/07/13 Added thread-6, thread-7, thread-8, and thread-9.
2005/07/11 Added description for forChina-1 and forChina-fs samples.
2005/05/10 Added description of favorite-color demo.
2005/03/02 Revised descriptions to reflect current support environment conditions.
2004/12/08 Removed interrupt-key-1, Revised Operation.
09/01/2004 Added reset-1.
2004/08/17 Standardized the notation of IS-NITRO-EMULATOR.
2004/07/10 Changed from .bin to .srl..
2004/06/25 Added thread-5.
2004/06/08 Made it possible to insert the demo of the profile function into Makefile by default.
2004/05/24 Added functionCost-1, functionCost-2, functionCost-3, waitlrq-1, and waitlrq-2. Added description about necessary profile functions.
2004/04/15 Added description of callTrace-1, callTrace-2, cplusplus-1, and exceptionDisplay-3.
2004/04/05 Added description of mutex-2, sleep-1, and timer-1. Changed systemClock-1 to tick-1.
2004/03/17 Added description of exceptionDisplay-2, valarm-1, and spinWait-1.
2004/02/05 Added description of alarm-1, alarm-2, exceptionDisplay-1, and systemClock-1.
2004/01/18 Moved interrupt-dma-1 sample to MI as dmaCallback-1.
2004/01/09 Initial version.


CONFIDENTIAL