feat: initialisation de la souris Détection du processeur Affichage du logo au format ANSI

This commit is contained in:
Nicolas Hordé 2007-04-02 14:19:44 +00:00
parent 55419d76ae
commit e005a10e65
1 changed files with 80 additions and 30 deletions

View File

@ -3,38 +3,88 @@
#include "idt.h" #include "idt.h"
#include "timer.h" #include "timer.h"
#include "keyboard.h" #include "keyboard.h"
#include "mouse.h"
#include "asm.h" #include "asm.h"
#include "cpu.h"
#include "string.h"
u8 printok[]=" \033[37m\033[1m[ \033[32mOK\033[37m ]\033[0m\r\n"; #include "ansi.c"
static cpuinfo cpu;
static u8 noproc[]="\033[31mInconnu\033[0m\000";
void ok()
{
static u8 okmsg[]="\033[99C\033[8D\033[37m\033[1m[ \033[32mOK\033[37m ]\033[0m\000";
print(okmsg);
return;
}
int _main(void) { int _main(void) {
cli(); cli();
setvmode(0x02); setvmode(0x02);
/* Efface l'ecran */ /* Efface l'ecran */
print("\033[2J"); print("\033[2J\000");
print("Noyau charge en memoire"); printf(ansilogo);
print(printok); print("\033[0mNoyau charge en memoire\000");
print("Initilisation de la table d'interruption"); ok();
print("Initilisation de la table d'interruption\000");
initidt(); initidt();
print(printok); ok();
print("Initialisation du controleur d'interruption");
print("Initialisation du controleur d'interruption\000");
initpic(); initpic();
print(printok);
print("Activation logicielle des interruptions");
sti(); sti();
print(printok); ok();
print("Installation du handler timer");
setidt((u32)timer, 0x30, INTGATE, 32); print("Installation du handler timer\000");
print(printok); setidt((u32)timer, 0x20, INTGATE, 32);
print("Activation de l'IRQ 0"); ok();
print("Activation de l'IRQ 0\000");
enableirq(0); enableirq(0);
print(printok); ok();
print("Installation du handler clavier");
setidt((u32)keyboard, 0x30, INTGATE, 33); print("Installation du handler clavier\000");
print(printok); setidt((u32)keyboard, 0x20, INTGATE, 33);
print("Activation de l'IRQ 1"); ok();
print("Activation de l'IRQ 1\000");
enableirq(1); enableirq(1);
print(printok); ok();
while(1);
print("Installation du handler souris\000");
setidt((u32)mouse, 0x20, INTGATE, 100);
ok();
print("Initialisation du controleur souris :\000");
if (initmouse()==1)
print(" \033[1m\033[32mSouris Presente\033[0m\000");
else
print(" \033[1m\033[31mSouris non detecte\033[0m\000");
ok();
print("Activation de l'IRQ 2 (Controleur esclave)\000");
enableirq(2);
ok();
print("Activation de l'IRQ 12\000");
enableirq(12);
ok();
strcpy(&noproc,&cpu.detectedname);
getcpuinfos(&cpu);
printf("Processeur detecte\r Revision \t:%d\r Modele \t:%d\r Famille \t:%d\r Nom cpuid\t:%s\rJeux\t:%s\000",cpu.stepping,cpu.models,cpu.family,&cpu.detectedname,&cpu.techs);
ok();
u8 key=0;
while(1)
{
key=waitascii();
putchar(key);
}
} }