//kernel/trunk/arch/ia32/src/drivers/i8042.c |
---|
66,8 → 66,8 |
static volatile int keyflags; /**< Tracking of multiple keypresses. */ |
static volatile int lockflags; /**< Tracking of multiple keys lockings. */ |
static void i8042_suspend(void); |
static void i8042_resume(void); |
static void i8042_suspend(chardev_t *); |
static void i8042_resume(chardev_t *); |
static chardev_t kbrd; |
static chardev_operations_t ops = { |
241,7 → 241,7 |
trap_register(VECTOR_KBD, i8042_interrupt); |
trap_virtual_enable_irqs(1<<IRQ_KBD); |
spinlock_initialize(&keylock, "i8042_lock"); |
chardev_initialize(&kbrd, &ops); |
chardev_initialize("i8042_kbd", &kbrd, &ops); |
stdin = &kbrd; |
} |
322,11 → 322,11 |
} |
/* Called from getc(). */ |
void i8042_resume(void) |
void i8042_resume(chardev_t *d) |
{ |
} |
/* Called from getc(). */ |
void i8042_suspend(void) |
void i8042_suspend(chardev_t *d) |
{ |
} |
//kernel/trunk/arch/ia32/src/drivers/ega.c |
---|
34,6 → 34,8 |
#include <arch/types.h> |
#include <arch/asm.h> |
#include <memstr.h> |
#include <console/chardev.h> |
#include <console/console.h> |
/* |
* The EGA driver. |
43,6 → 45,13 |
static spinlock_t egalock; |
static __u32 ega_cursor; |
static void ega_putchar(chardev_t *d, const char ch); |
chardev_t ega_console; |
static chardev_operations_t ega_ops = { |
.write = ega_putchar |
}; |
void ega_move_cursor(void); |
void ega_init(void) |
55,7 → 64,11 |
outb(0x3d4,0xf); |
lo = inb(0x3d5); |
ega_cursor = (hi<<8)|lo; |
ega_putchar('\n'); |
chardev_initialize("ega_out", &ega_console, &ega_ops); |
stdout = &ega_console; |
putchar('\n'); |
} |
static void ega_display_char(char ch) |
78,7 → 91,7 |
ega_cursor = ega_cursor - ROW; |
} |
void ega_putchar(const char ch) |
void ega_putchar(chardev_t *d, const char ch) |
{ |
ipl_t ipl; |
111,8 → 124,3 |
outb(0x3d4,0xf); |
outb(0x3d5,ega_cursor&0xff); |
} |
void putchar(const char ch) |
{ |
ega_putchar(ch); |
} |