Every architecture supported by KOS supports the concept of a debug I/O console. Sometimes this may not be connected to anything (especially in the really embedded ports like GBA) but this is where all debug and printf output goes by default, and this is where any pieces (such as DC's libconio) will grab their key input if configured to do so from the dbgio channel.
Set a function to capture all debug output that comes through dbgio_printf, and return the old function. This is used by, e.g., dc-tool. The type for the function is:
Set serial parameters; this is not as platform independent as I want it to be, but it should be generic enough to be useful. The baud rate will be set to baud and if fifo is non-zero, the serial FIFO will be enabled.
Write one char to the debug port. You must call dbgio_flush() to actually ensure that the output was sent.
Flush all buffered bytes out of the port buffer, if any.
Send an entire buffer of data. This is just a shortcut for sending each byte of data with dbgio_write.
Read an entire block of data. This is just a shortcut for reading each byte of data with dbgio_read. Note that this function will block until it has len bytes of data.
Send a C string (null-terminated).
Read one char from the debug port (-1 if nothing to read).
Disable debug I/O globally; all debug output will be discarded and debug input will always return failure. This can be used as a quick way to disable all of your debug output before burning a final copy of your game/demo, etc.
Enable debug I/O globally (after calling dbgio_disable).
Works like dbgio_write_str, but provides formatting capabilities. There is a limit to the number of characters that can be in the resulting string, so don't pass arbitrarily long strings to this function.