2 * Copyright (C) 2003, 2004 Stefan Reinauer
4 * See the file "COPYING" for further information about
5 * the copyright and warranty status of this work.
9 #include "libopenbios/bindings.h"
10 #include "libopenbios/console.h"
11 #include "kernel/kernel.h"
12 #include "drivers/drivers.h"
13 #include "libopenbios/fontdata.h"
15 #include "libc/vsprintf.h"
16 #include "libopenbios/sys_info.h"
19 /* ******************************************************************
20 * simple polling video/keyboard console functions
21 * ****************************************************************** */
23 #ifdef CONFIG_DEBUG_CONSOLE
24 /* ******************************************************************
25 * common functions, implementing simple concurrent console
26 * ****************************************************************** */
28 static int arch_putchar(int c)
30 #ifdef CONFIG_DEBUG_CONSOLE_SERIAL
36 static int arch_availchar(void)
38 #ifdef CONFIG_DEBUG_CONSOLE_SERIAL
39 if (uart_charav(CONFIG_SERIAL_PORT))
42 #ifdef CONFIG_DEBUG_CONSOLE_VGA
43 if (pc_kbd_dataready())
49 static int arch_getchar(void)
51 #ifdef CONFIG_DEBUG_CONSOLE_SERIAL
52 if (uart_charav(CONFIG_SERIAL_PORT))
53 return (uart_getchar(CONFIG_SERIAL_PORT));
55 #ifdef CONFIG_DEBUG_CONSOLE_VGA
56 if (pc_kbd_dataready())
57 return (pc_kbd_readdata());
62 struct _console_ops arch_console_ops = {
63 .putchar = arch_putchar,
64 .availchar = arch_availchar,
65 .getchar = arch_getchar
68 #endif // CONFIG_DEBUG_CONSOLE