/*** * Writes a null terminated string to the polling TTY. This routine is * used for kernel messages. User program prints should use the * interrupt driven TTY drivers. * * @param s The null-terminated string to be printed. */ void kwrite(char *s) { while(*s) { polltty_putchar(*s); s++; } }
/* output the given char either to the string or to the TTY */ static void printc(char *buf, char c, int flags) { if (flags & FLAG_TTY) { /* do not output (terminating) zeros to TTY */ if (c != '\0') polltty_putchar(c); /* synched in k(v)printf */ } else *buf = c; }
int syscall_write(const char *buffer, int length) { /* Not a G1 solution! */ for (int i = 0; i < length; i++, *buffer++) polltty_putchar(*buffer); return length; }