feat: initialisation de l'idt Initialisation du controleur 8259a Installation du handler "timer" Installation du handler "clavier"

This commit is contained in:
Nicolas Hordé 2007-04-02 13:47:30 +00:00
parent 571ba62e2c
commit c446ca3608
1 changed files with 34 additions and 12 deletions

View File

@ -1,18 +1,40 @@
#include "vga.h"
#include "video.h"
#include "idt.h"
#include "timer.h"
#include "keyboard.h"
#include "asm.h"
u8 printok[]=" \033[37m\033[1m[ \033[32mOK\033[37m ]\033[0m\r\n";
int _main(void) {
setvmode(0x84);
cls();
int x,y;
for(x=0;x<120;x++)
for(y=0;y<120;y++)
{
writepxl(x,y,4);
}
for(x=0;x<20000;x++)
{
print("C'est 2 test 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 c un test!");
}
cli();
setvmode(0x02);
/* Efface l'ecran */
print("\033[2J");
print("Noyau charge en memoire");
print(printok);
print("Initilisation de la table d'interruption");
initidt();
print(printok);
print("Initialisation du controleur d'interruption");
initpic();
print(printok);
print("Activation logicielle des interruptions");
sti();
print(printok);
print("Installation du handler timer");
setidt((u32)timer, 0x30, INTGATE, 32);
print(printok);
print("Activation de l'IRQ 0");
enableirq(0);
print(printok);
print("Installation du handler clavier");
setidt((u32)keyboard, 0x30, INTGATE, 33);
print(printok);
print("Activation de l'IRQ 1");
enableirq(1);
print(printok);
while(1);
}