summaryrefslogtreecommitdiff
path: root/src/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel.c')
-rw-r--r--src/kernel.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/src/kernel.c b/src/kernel.c
index 355067a..e33d509 100644
--- a/src/kernel.c
+++ b/src/kernel.c
@@ -11,22 +11,17 @@
static jmp_buf panic_jmp_buf;
-static vga_t vga;
-static console_t console;
-// static serial_t serial;
-
void entry( void )
{
+ serial_t serial;
+ serial_init( &serial );
-// serial_t serial;
-// serial_init( &serial );
-
-// vga_t vga;
+ vga_t vga;
vga_init( &vga );
vga_set_color( &vga, VGA_COLOR_LIGHT_GREY );
vga_set_background_color( &vga, VGA_COLOR_BLACK );
-// console_t console;
+ console_t console;
console_init( &console );
console_add_vga_output( &console, &vga );
// console_add_serial_output( &console, &serial );
@@ -39,17 +34,18 @@ void entry( void )
puts( "Initializing interrupts" );
interrupt_t interrupt;
interrupts_init( &interrupt );
- interrupts_enable( );
-
-//~ vga_put_char_at( &vga, 81, 20, 'X' );
// exit point in case of kernel panic, do this as soon as
// possible
- int v = setjmp( panic_jmp_buf );
- printf( "setjmp returned %d\n", v );
- if( v > 0 ) {
+ if( setjmp( panic_jmp_buf ) > 0 ) {
goto TERMINATE;
}
+
+ // TODO: initialize hardware here
+
+ interrupts_enable( );
+
+//~ vga_put_char_at( &vga, 81, 20, 'X' );
console_put_string( &console, "Running.." );
@@ -62,9 +58,9 @@ void entry( void )
vga_put_char_at( &vga, x_pos, y_pos, '.' );
x_pos++;
// serial_put_char( &serial, '.' );
-int y = 0;
-int x = 12 / y;
-printf( "Hex number is 0x%X and string is '%s'\n", x, "abaos" );
+//~ int y = 0;
+//~ int x = 12 / y;
+//~ printf( "Hex number is 0x%X and string is '%s'\n", x, "abaos" );
}
vga_put_char_at( &vga, x_pos, y_pos, bar[i%4] );