Sun 12 Jan 19:29:58 CET 2025

This commit is contained in:
sbosse 2025-01-12 19:30:17 +01:00
parent 9d3a32fb76
commit cb55d61788

View File

@ -10,6 +10,13 @@ See the file LICENSE for details.
#include "kmalloc.h" #include "kmalloc.h"
#include "string.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 console {
struct window *window; struct window *window;
struct graphics *gx; struct graphics *gx;
@ -174,12 +181,18 @@ int console_getchar( struct console *c )
void console_putchar( struct console *c, char ch ) 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) 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 ) struct console *console_create( struct window *w )