osSyncPrintf (function)

Outputs formatted printing through the debug port

Syntax

#include <os.h> /* os.h */
void osSyncPrintf(const char *format, .../* args */);

Description

osSyncPrintf performs text formatting similar to the libc function printf. The text output is transmitted from the target system through the debug port to the gload process running on the debug host workstation. The text is then written to the standard output device (normally a shell window) of the gload process.

To make osSyncPrintf more efficient, set up an rdb output buffer first by calling osInitRdb. The osSyncPrintf tool requires that the interrupt service handler be functional before it is used. Consequently, osSyncPrintf should not be called from the boot thread.

Because multiple threads can use the printing facility, it is possible for data to be mixed as threads swap in and out. Changes effective with release 2.0f cause osSyncPrintf to have significantly less impact on game performance. In the past, a call to osSyncPrintf would cause the interrupt processing and thread swapping to stop the thread until all data get transferred to the host Indy. This is no longer the case.

Note

If large quantities of data are printed at once, it is possible to overflow the kernel's printf buffers. When this happens, the system will attempt to print a warning message to the console. If a continual stream of data is printed, it is possible to generate enough data to cause the Indy to spend all of its time servicing the interrupts associated with the osSyncPrintf. When this happens it will appear as if the Indy is frozen because interrupts have priority over processing user interaction. If the stream of osSyncPrintf can be stopped, the Indy should recover and resume normal functioning.

See Also

sprintf, osInitalize, and printf

Revision History

1999/04/30 Changed Format