diff --git a/kernel/console.c b/kernel/console.c index 91ff7ba..8475e96 100644 --- a/kernel/console.c +++ b/kernel/console.c @@ -10,6 +10,13 @@ See the file LICENSE for details. #include "kmalloc.h" #include "string.h" +/* + Switch to serial consol #portnr ? + If not, -1 + else using serial_device_write from serial.c ... +*/ +int console_serial=-1; + struct console { struct window *window; struct graphics *gx; @@ -174,12 +181,18 @@ int console_getchar( struct console *c ) void console_putchar( struct console *c, char ch ) { - console_write(c,&ch,1); + if (console_serial!=-1) + serial_putchar(console_serial,ch); + else + console_write(c,&ch,1); } void console_putstring( struct console *c, const char *str) { - console_write(c,str,strlen(str)); + if (console_serial!=-1) + serial_device_write(console_serial,str,strlen(str),0); + else + console_write(c,str,strlen(str)); } struct console *console_create( struct window *w )