From c446ca3608b88e02db4094f689d17ad76546480f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Mon, 2 Apr 2007 13:47:30 +0000 Subject: [PATCH] feat: initialisation de l'idt Initialisation du controleur 8259a Installation du handler "timer" Installation du handler "clavier" --- system/system.c | 46 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/system/system.c b/system/system.c index 60e746b..e656776 100644 --- a/system/system.c +++ b/system/system.c @@ -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); } +