summaryrefslogtreecommitdiff
path: root/src/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel.c')
-rw-r--r--src/kernel.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/kernel.c b/src/kernel.c
index 3f873ef..3c520d6 100644
--- a/src/kernel.c
+++ b/src/kernel.c
@@ -2,7 +2,7 @@
#include <stdint.h>
#include <stdarg.h>
-#include "vga.h"
+#include "vgatext.h"
#include "serial.h"
#include "console.h"
#include "stdlib.h"
@@ -35,14 +35,14 @@ void kernel_main( void )
serial_t serial;
serial_init( &serial );
- vga_t vga;
- vga_init( &vga );
- vga_set_color( &vga, VGA_COLOR_LIGHT_GREY );
- vga_set_background_color( &vga, VGA_COLOR_BLACK );
+ vga_text_t vga_text;
+ vga_text_init( &vga_text );
+ vga_text_set_color( &vga_text, VGA_TEXT_COLOR_LIGHT_GREY );
+ vga_text_set_background_color( &vga_text, VGA_TEXT_COLOR_BLACK );
console_t console;
console_init( &console );
- console_add_vga_output( &console, &vga );
+ console_add_vga_text_output( &console, &vga_text );
console_add_serial_output( &console, &serial );
// initialize the early console of the kernel
@@ -68,14 +68,14 @@ void kernel_main( void )
// hard-wired drivers
keyboard_t keyboard;
- keyboard_init( &keyboard, &handle_keyboard_event, (void *)&vga );
+ keyboard_init( &keyboard, &handle_keyboard_event, (void *)&vga_text );
interrupt_handler_t keyboard_interrupt_handler;
interrupt_handler_init( &keyboard_interrupt_handler, IRQ_BASE + 0x01, &interrupt, keyboard_handle_interrupt, &keyboard );
interrupts_register_interrupt_handler( keyboard_interrupt_handler );
driver_manager_add_driver( &driver_manager, (driver_t *)&keyboard );
mouse_t mouse;
- mouse_init( &mouse, &handle_mouse_event, (void *)&vga );
+ mouse_init( &mouse, &handle_mouse_event, (void *)&vga_text );
interrupt_handler_t mouse_interrupt_handler;
interrupt_handler_init( &mouse_interrupt_handler, IRQ_BASE + 0x0C, &interrupt, mouse_handle_interrupt, &mouse );
interrupts_register_interrupt_handler( mouse_interrupt_handler );
@@ -136,9 +136,9 @@ static void handle_keyboard_event( keyboard_event_t *event, void *context )
{
static int pos = 0;
static char buf[80];
- vga_t *vga = (vga_t *)context;
+ vga_text_t *vga_text = (vga_text_t *)context;
- vga_hide_mouse_cursor( vga );
+ vga_text_hide_mouse_cursor( vga_text );
if( event->type == KEYBOARD_EVENT_TYPE_KEY_PRESSED ) {
if( event->key == KEYBOARD_KEY_ASCII ) {
@@ -177,26 +177,26 @@ static void handle_keyboard_event( keyboard_event_t *event, void *context )
static void handle_mouse_event( mouse_event_t *event, void *context )
{
- vga_t *vga = (vga_t *)context;
+ vga_text_t *vga_text = (vga_text_t *)context;
switch( event->type ) {
case MOUSE_EVENT_TYPE_BUTTON_UP:
- vga_hide_mouse_cursor( vga );
+ vga_text_hide_mouse_cursor( vga_text );
printf( "MOUSE UP %d AT X:%d, Y:%d\n", event->button, event->cursor_x,
event->cursor_y );
- vga_show_mouse_cursor( vga );
+ vga_text_show_mouse_cursor( vga_text );
break;
case MOUSE_EVENT_TYPE_BUTTON_DOWN:
- vga_hide_mouse_cursor( vga );
+ vga_text_hide_mouse_cursor( vga_text );
printf( "MOUSE DOWN %d AT X:%d, Y:%d\n", event->button, event->cursor_x,
event->cursor_y );
- vga_show_mouse_cursor( vga );
+ vga_text_show_mouse_cursor( vga_text );
break;
case MOUSE_EVENT_TYPE_MOVE:
- vga_move_mouse_cursor( vga, event->cursor_x, event->cursor_y );
- vga_show_mouse_cursor( vga );
+ vga_text_move_mouse_cursor( vga_text, event->cursor_x, event->cursor_y );
+ vga_text_show_mouse_cursor( vga_text );
break;
}
}