Operating System Log (OSLog) Overview List

Introduction

OSLog is an API extension that can write the output results of OSReport and OSVReport to Wii console NAND memory.
Developers can choose the output destination from three options: serial output, Wii console NAND memory, and both serial output and Wii console NAND memory at the same time.
The OSReportDestination function is effective in cases such as when debugging on hardware that cannot use serial output.

The following features have been built into the supplied OSReportViewer.
- View logs written to Wii console NAND memory
- Copy written log to SD Card
- Delete written log

Note: OSLog features can be used by including revolution/os/OSLog.h and linking oslog.a.
In order for OS(V)Report to write to Wii console NAND memory, you must import and run OSReportViewer and allocate a memory region.


OSLog Library Process Model

(1) Memory Allocation



Before starting a program to debug, import OSReportViewer and start it.
This allocates the memory required by OS(V)Report to write to Wii console NAND memory.

First, go to (REVOLUTION_SDK_ROOT)/RVL/bin/tools.
Once Nmenu is started using ndrun, an Import List is displayed. The file OSReportViewer.wad is included in this list and can be imported to Wii console NAND memory.
If you cannot find OSReportViewer.wad using Nmenu, it may be that the DvdRoot setting is incorrect or that OSReportViewer.wad is not included in DvdRoot/viewer.

If import is successful, press the B Button to move to the Title List.
If import has been successful, 0x024f5256 appears in the Title List.
To launch OSReportViewer, press the A Button.
If the display goes to a blue screen, a blank page without any errors, it indicates that memory has been allocated successfully.


(2) Write Procedure




Next, start the program you want to debug and create the OS(V)Report output.
You can switch the output destination by setting one of the three argument options for the OSReportDestination function: OS_REPORT_NAND, OS_REPORT_SERIAL, or both OS_REPORT_NAND and OS_REPORT_SERIAL at the same time.


(3) Write Back Procedure



If you call OS(V)Report with the output destination set to Wii console NAND memory, the string is not written directly to the NAND memory, but rather temporarily stored in a buffer in the console's main memory.
OSReportFlush must be called to write this string correctly to Wii console NAND memory.

When flushed, the strings in main memory are added to the end of the file used by OS(V)Report to write to Wii console NAND memory.
Developers should perform this task at a time convenient for them.


(4) View Procedure




Written logs can be checked by viewing them with OSReportviewer.
OSReportViewer can check logs as a NAND application and can delete logs when they have accumulated.
A feature for copying written logs to an SD Card is also available.

Revision History

2009/10/19 Made revisions to correspond with OSVReport.
2008/11/19 Initial version.


CONFIDENTIAL