fix: correction initialisation GDT

This commit is contained in:
Nicolas Hordé 2018-09-17 13:14:27 +02:00
parent b1abb2f5a2
commit 8e9987ba8a
3 changed files with 12 additions and 13 deletions

View File

@ -35,13 +35,13 @@ void initgdt()
movw %ax, %es \n \
movw %ax, %fs \n \
movw %ax, %gs \n \
movl 0x0C(%esp), %eax \n \
movl 0x0C(%esp), %ebx \n \
movw $0x18, %ax \n \
movw %ax, %ss \n \
movl $0x20000, %esp \n \
pushl %eax \n \
ljmp $0x08, $raz \n \
raz: \n \
pushl %ebx \n \
ret\n");
}

View File

@ -106,7 +106,7 @@ u8* getstring(u8* temp) {
pointer--;
putchar(ascii);
}
else if (ascii>31 && pointer<=&temp+80) {
else if (ascii>31 && pointer<=temp+80) {
*pointer++=ascii;
putchar(ascii);
}
@ -252,6 +252,12 @@ unsigned convert(u32 keypressed)
outkbd(0x60, temp); /* 3 bits de poids faible pour les LEDs */
return 0;
}
/* Appuie de CRTL + ALT + SUPR ? */
if ((kbdstatus & STATUS_CTRL) && (kbdstatus & STATUS_ALT)
(key == 73)) {
print("redemarrage du systeme");
reboot();
}
/* est ce un code etendu */
if ((bufferscan[lastscan] == 0xE0)
|| ((kbdstatus & STATUS_NUM) && (key >= 0x47) && (key <= 0x53)
@ -311,16 +317,9 @@ unsigned convert(u32 keypressed)
else
temp = set1_normal[key];
}
/* si scancode non reconnu fin de fonction */
if (temp == 0)
return temp;
/* Appuie de CRTL + ALT + SUPR ? */
if ((kbdstatus & STATUS_CTRL) && (kbdstatus & STATUS_ALT) &&
(key == 76)) {
print("redemarrage du systeme");
reboot();
}
/* Renvoie le Code ascii */
return temp;
}

View File

@ -60,17 +60,17 @@ int main(void)
ok();
print(" -Installation du handler timer (IRQ 0)\000");
setidt((u32) timer, 0x20, INTGATE, 32);
setidt((u32) timer, 0x8, INTGATE, 32);
enableirq(0);
ok();
print(" -Installation du handler clavier (IRQ 1)\000");
setidt((u32) keyboard, 0x20, INTGATE, 33);
setidt((u32) keyboard, 0x8, INTGATE, 33);
enableirq(1);
ok();
print(" -Installation du handler souris (IRQ12+Cascade IRQ2)\000");
setidt((u32) mouse, 0x20, INTGATE, 100);
setidt((u32) mouse, 0x8, INTGATE, 100);
enableirq(2);
enableirq(12);
if (initmouse() != 1)