Ejemplo n.º 1
0
/***
 * 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++;
    }
}
Ejemplo n.º 2
0
/* 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;
}
Ejemplo n.º 3
0
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;
}