28extern void sbus_tty_puts(
const char *str);
30static int ttyfs_init()
36static int ttyfs_deinit()
42static int ttyfs_open(
iop_file_t *file,
const char *name,
int flags)
52static int ttyfs_dopen(
iop_file_t *file,
const char *name)
69static int ttyfs_write(
iop_file_t *file,
void *ptr,
int size) {
81 toWrite = (size - bCount);
85 memcpy(temp, &(((u8 *)ptr)[bCount]), toWrite);
95IOMAN_RETURN_VALUE_IMPL(
EPERM);
101 IOMAN_RETURN_VALUE(
EPERM),
104 IOMAN_RETURN_VALUE(
EPERM),
106 IOMAN_RETURN_VALUE(
EPERM),
107 IOMAN_RETURN_VALUE(
EPERM),
108 IOMAN_RETURN_VALUE(
EPERM),
109 IOMAN_RETURN_VALUE(
EPERM),
110 IOMAN_RETURN_VALUE(
EPERM),
113 IOMAN_RETURN_VALUE(
EPERM),
114 IOMAN_RETURN_VALUE(
EPERM),
115 IOMAN_RETURN_VALUE(
EPERM),
127void sprintf_putchar(
void *context,
int c)
129 char **
string = (
char **)context;
131 if(c < 0x100) { ((*string)++)[0] = c; }
132 else { (*string)[0] = 0; }
135extern int _vsprintf(
char * str,
const char * format, va_list ap);
137static char kprint_buffer[1024];
139int _kPrintf(
void *context,
const char * format, va_list ap)
143 int r = prnt(&sprintf_putchar, &format, format, ap);
144 sbus_tty_puts(kprint_buffer);
148int sbus_tty_init(
void)
152 DelDrv(tty_fsd.name);
155 if(AddDrv(&tty_fsd) != 0) {
return(-1); }
157 open(
"tty:", O_RDONLY);
158 open(
"tty:", O_WRONLY);
160 KprintfSet(&_kPrintf, NULL);