luxos/init.c

37 lines
876 B
C

#include <system.h>
void system_init()
{
// Detect if color/monochrome screen
char c = (*(volatile unsigned short*)0x410)&0x30;
if (c==0x30) TextVideoRam = (byte *)0xb0000;
else TextVideoRam = (byte *)0xb8000;
// Reset cursor, use 80x25 text video mode
current_mode_width = 80;
current_mode_height = 25;
cursor_x = cursor_y = 0;
// Install GDT, IDT, ISRs and IRQs; Enable interrupts
gdt_install();
idt_install();
isrs_install();
irq_install();
__asm__ __volatile__ ("sti");
// Install PIT timer
timer_ticks = 0;
irq_install_handler(0, timer_handler);
timer_phase (100);
// Install keyboard
kb_modifier_status = 0;
kb_lights_status = 0xFF; kb_update_LED();
kb_lights_status = 0; kb_update_LED();
irq_install_handler(1, kb_handler);
// mouse_driver();
}