28extern void sbus_tty_puts(
const char *str);
44static int ttyfs_open(
iop_file_t *file,
const char *name,
int flags)
54static int ttyfs_dopen(
iop_file_t *file,
const char *name)
71static int ttyfs_write(
iop_file_t *file,
void *ptr,
int size) {
83 toWrite = (size - bCount);
87 memcpy(temp, &(((u8 *)ptr)[bCount]), toWrite);
97IOMAN_RETURN_VALUE_IMPL(
EPERM);
103 IOMAN_RETURN_VALUE(
EPERM),
106 IOMAN_RETURN_VALUE(
EPERM),
108 IOMAN_RETURN_VALUE(
EPERM),
109 IOMAN_RETURN_VALUE(
EPERM),
110 IOMAN_RETURN_VALUE(
EPERM),
111 IOMAN_RETURN_VALUE(
EPERM),
112 IOMAN_RETURN_VALUE(
EPERM),
115 IOMAN_RETURN_VALUE(
EPERM),
116 IOMAN_RETURN_VALUE(
EPERM),
117 IOMAN_RETURN_VALUE(
EPERM),
129void sprintf_putchar(
void *context,
int c)
131 char **
string = (
char **)context;
133 if(c < 0x100) { ((*string)++)[0] = c; }
134 else { (*string)[0] = 0; }
137extern int _vsprintf(
char * str,
const char * format, va_list ap);
139static char kprint_buffer[1024];
141int _kPrintf(
void *context,
const char * format, va_list ap)
145 int r = prnt(&sprintf_putchar, &format, format, ap);
146 sbus_tty_puts(kprint_buffer);
150int sbus_tty_init(
void)
154 DelDrv(tty_fsd.name);
157 if(AddDrv(&tty_fsd) != 0) {
return(-1); }
159 open(
"tty:", O_RDONLY);
160 open(
"tty:", O_WRONLY);
162 KprintfSet(&_kPrintf, NULL);