# OS_InitPrintServer

## Syntax

  `#include <nitro/os.h>`
  `void OS_InitPrintServer( void );`

## Arguments

None.

## Return Values

None.

## Description

This is an initialization function to display debug messages from the ARM7.

Because this function is an SDK library debugging function, there is no need to use it in ordinary applications. It is presumed that mainly library and middleware developers will use this.

Call this function before the `OS_Init` function.

With the `OS_InitPrintServer` function, allocate a buffer for ARM7 debug output in an area shared by ARM9 and ARM7 on the main memory. Later, store the string in this buffer by performing debug output with the ARM7. With the ARM9, periodically output the content of this buffer. (It is preferable to output about once every frame.) Call the `OS_PrintServer` function to output the buffer content.

> Example:

>     void NitroMain(void)
>     {
>         OS_InitPrintServer();
>         OS_Init();
>             :

>         //---- main loop
>         while(1)
>         {
>             OS_PrintServer();
>             SVC_WaitVBlankIntr();
>                 :
>         }

>     }

If you are outputting ARM7 strings using this OS PrintServer feature, no matter where the output destination console is set for the ARM7, the output destination is the standard one for ARM9.

In FINALROM builds, the `OS_InitPrintServer` function and the `OS_PrintServer` function are replaced with code that does nothing.

### Memory Used

The location to allocate the buffer that stores ARM7 debugging output is an area shared by ARM9 and ARM7 on the main memory. The size is 1 KB for the string buffer and 8 bytes for the pointer to specify the output position.

## See Also

`OS_PrintServer`

## Revision History

2009/06/25 Described the method for using the function.
2005/08/19 Initial version.

CONFIDENTIAL