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, %es \n \
movw %ax, %fs \n \ movw %ax, %fs \n \
movw %ax, %gs \n \ movw %ax, %gs \n \
movl 0x0C(%esp), %eax \n \ movl 0x0C(%esp), %ebx \n \
movw $0x18, %ax \n \ movw $0x18, %ax \n \
movw %ax, %ss \n \ movw %ax, %ss \n \
movl $0x20000, %esp \n \ movl $0x20000, %esp \n \
pushl %eax \n \
ljmp $0x08, $raz \n \ ljmp $0x08, $raz \n \
raz: \n \ raz: \n \
pushl %ebx \n \
ret\n"); ret\n");
} }

View File

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

View File

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