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] */ /* FIXME[complete if necessary] */
void handler(int num) void handler(int num)
{ {
// asm volatile ("\t movl %%ebx,%0" : "=r"(param1)); o_event *irs;
//asm volatile ("\t movl %%ecx,%0" : "=r"(param2));
//asm volatile ("\t movl %%edx,%0" : "=r"(param3));
//asm volatile ("\t movl %%eax,%0" : "=r"(syscall));
module_call(console, message, if (event_exist(num) == ERROR_TRUE)
'+', "youhou, interruption %d\n", num); {
event_get(num, &irs);
irs->handler.routine(irs->id, irs->data);
}
} }
void handler_err(int err, int num) void handler_err(int err, int num)
{ {
module_call(console, message, o_event *irs;
'!', "youhou, interruption d'erreur %d\n", num);
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.limit = ARCHITECTURE_IDT_SIZE * sizeof (at_idte);
lidt.base = (t_paddr) &_idt; lidt.base = (t_paddr) &_idt;
asm volatile ("lidt %0\n" ARCHITECTURE_LIDT(lidt);
:
: "m" (lidt));
//ICW1 platform_pic_initialize();
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");
MACHINE_LEAVE(); MACHINE_LEAVE();
} }

View File

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

View File

@ -24,7 +24,7 @@ do
echo " push %ss" >> $FILEOUT echo " push %ss" >> $FILEOUT
echo " push \$$i" >> $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 then
echo " push \$0" >> $FILEOUT echo " push \$0" >> $FILEOUT
echo " call handler_err" >> $FILEOUT echo " call handler_err" >> $FILEOUT