2021-09-14 15:48:57 +00:00
|
|
|
// HARDWARE ABSTRACTION LAYER
|
|
|
|
#include "cpu/gdt.h"
|
|
|
|
#include "cpu/idt.h"
|
|
|
|
#include "cpu/isrs.h"
|
|
|
|
#include "cpu/irq.h"
|
|
|
|
|
|
|
|
#include "clock/clock.h"
|
|
|
|
#include "keyboard/keyboard.h"
|
|
|
|
#include "mouse/mouse.h"
|
|
|
|
|
2021-09-14 15:52:47 +00:00
|
|
|
//#include "filesys/fat/fat.h"
|
2021-09-14 15:51:43 +00:00
|
|
|
|
2021-09-14 15:50:50 +00:00
|
|
|
#include <fileio.h>
|
2021-09-14 15:48:57 +00:00
|
|
|
#include <debugio.h>
|
|
|
|
|
|
|
|
void HalInitialize()
|
|
|
|
{
|
|
|
|
// Initialize cpu
|
2021-09-14 15:51:43 +00:00
|
|
|
GdtInstall(); Log("HAL", "Installed GDT\n");
|
|
|
|
IdtInstall(); Log("HAL", "Installed IDT\n");
|
|
|
|
IsrsInstall(); Log("HAL", "Installed ISRs\n");
|
|
|
|
IrqInstall(); Log("HAL", "Installed IRQs\n");
|
2021-09-14 15:48:57 +00:00
|
|
|
|
|
|
|
// Start interrupts
|
|
|
|
asm volatile ("sti");
|
2021-09-14 15:51:43 +00:00
|
|
|
Log("HAL", "%#Interrupts are started...\n", ColorLightMagenta);
|
2021-09-14 15:48:57 +00:00
|
|
|
|
|
|
|
// Install keyboard
|
|
|
|
IrqInstallHandler(0, TimeHandler);
|
|
|
|
IrqInstallHandler(1, KeyboardHandler);
|
|
|
|
IrqInstallHandler(12, MouseHandler);
|
|
|
|
|
2021-09-14 15:51:43 +00:00
|
|
|
KeyboardInstallA(); Log("HAL", "Installing keyboard... %#[1/2] ", ColorLightGreen);
|
|
|
|
KeyboardInstallB(); Log("HAL", "%#[2/2]\n", ColorLightGreen);
|
2021-09-14 15:48:57 +00:00
|
|
|
|
|
|
|
// Install mouse driver
|
2021-09-14 15:54:59 +00:00
|
|
|
//MouseInstall(); Log("HAL", "Installed mouse driver\n");
|
2021-09-14 15:50:50 +00:00
|
|
|
|
|
|
|
// Install VFS
|
|
|
|
VfsInstall();
|
2021-09-14 15:52:47 +00:00
|
|
|
//FatInstall();
|
2021-09-14 15:48:57 +00:00
|
|
|
}
|