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 "vga.h"
#include "video.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) { int _main(void) {
setvmode(0x84); cli();
cls(); setvmode(0x02);
int x,y; /* Efface l'ecran */
for(x=0;x<120;x++) print("\033[2J");
for(y=0;y<120;y++) print("Noyau charge en memoire");
{ print(printok);
writepxl(x,y,4); print("Initilisation de la table d'interruption");
} initidt();
for(x=0;x<20000;x++) print(printok);
{ print("Initialisation du controleur d'interruption");
print("C'est 2 test 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 c un test!"); 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); while(1);
} }