Events working

This commit is contained in:
Mercier Pierre-Olivier 2013-02-17 06:17:41 +01:00
parent 757b9d7222
commit e9b620220e
4 changed files with 19 additions and 34 deletions

View File

@ -24,17 +24,22 @@
/* FIXME[complete if necessary] */
void handler(int num)
{
// asm volatile ("\t movl %%ebx,%0" : "=r"(param1));
//asm volatile ("\t movl %%ecx,%0" : "=r"(param2));
//asm volatile ("\t movl %%edx,%0" : "=r"(param3));
//asm volatile ("\t movl %%eax,%0" : "=r"(syscall));
o_event *irs;
module_call(console, message,
'+', "youhou, interruption %d\n", num);
if (event_exist(num) == ERROR_TRUE)
{
event_get(num, &irs);
irs->handler.routine(irs->id, irs->data);
}
}
void handler_err(int err, int num)
{
module_call(console, message,
'!', "youhou, interruption d'erreur %d\n", num);
o_event *irs;
if (event_exist(num) == ERROR_TRUE)
{
event_get(num, &irs);
irs->handler.routine(irs->id, irs->data);
}
}

View File

@ -89,31 +89,9 @@ t_error architecture_idt_import(void)
lidt.limit = ARCHITECTURE_IDT_SIZE * sizeof (at_idte);
lidt.base = (t_paddr) &_idt;
asm volatile ("lidt %0\n"
:
: "m" (lidt));
ARCHITECTURE_LIDT(lidt);
//ICW1
asm volatile ("mov $0x11, %al\n"
"outb %al, $0x20\n"
"outb %al, $0xA0\n");
//ICW2
asm volatile ("mov $0x40, %al\n"
"outb %al, $0x21\n"
"add $0x10, %al\n"
"outb %al, $0xA1\n");
//ICW3
asm volatile ("mov $0x04, %al\n"
"outb %al, $0x21\n"
"mov $0x02, %al\n"
"outb %al, $0xA1\n");
//ICW4
asm volatile ("mov $0x01, %al\n"
"outb %al, $0x21\n"
"outb %al, $0xA1\n");
platform_pic_initialize();
MACHINE_LEAVE();
}

View File

@ -380,7 +380,9 @@ idt_wrapper_17:
push %gs
push %ss
push $17
call handler
push $0
call handler_err
pop %ebx
pop %ebx
pop %ss
pop %gs

View File

@ -24,7 +24,7 @@ do
echo " push %ss" >> $FILEOUT
echo " push \$$i" >> $FILEOUT
if [ $i -eq 8 ] || ( [ $i -ge 10 ] && [ $i -lt 15 ])
if [ $i -eq 8 ] || [ $i -eq 17 ] || ( [ $i -ge 10 ] && [ $i -lt 15 ])
then
echo " push \$0" >> $FILEOUT
echo " call handler_err" >> $FILEOUT