Working pre-handlers

This commit is contained in:
Mercier Pierre-Olivier 2013-02-17 05:00:14 +01:00
parent 8221396eff
commit 757b9d7222
7 changed files with 3170 additions and 12 deletions

View File

@ -30,5 +30,11 @@ void handler(int num)
//asm volatile ("\t movl %%eax,%0" : "=r"(syscall));
module_call(console, message,
'+', "spawning the 'system' server\n");
'+', "youhou, interruption %d\n", num);
}
void handler_err(int err, int num)
{
module_call(console, message,
'!', "youhou, interruption d'erreur %d\n", num);
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,45 @@
#!/bin/sh
if [ -n "$1" ]
then
FILEOUT=$1
else
FILEOUT=${0:0:$(($#0 - 3))}
fi
echo ".section .text" > $FILEOUT
echo " .align 4" >> $FILEOUT
echo "" >> $FILEOUT
for i in `seq 0 255`
do
echo " .global idt_wrapper_$i" >> $FILEOUT
echo "idt_wrapper_$i:" >> $FILEOUT
echo " cli" >> $FILEOUT
echo " pusha" >> $FILEOUT
echo " push %ds" >> $FILEOUT
echo " push %es" >> $FILEOUT
echo " push %fs" >> $FILEOUT
echo " push %gs" >> $FILEOUT
echo " push %ss" >> $FILEOUT
echo " push \$$i" >> $FILEOUT
if [ $i -eq 8 ] || ( [ $i -ge 10 ] && [ $i -lt 15 ])
then
echo " push \$0" >> $FILEOUT
echo " call handler_err" >> $FILEOUT
echo " pop %ebx" >> $FILEOUT
else
echo " call handler" >> $FILEOUT
fi
echo " pop %ebx" >> $FILEOUT
echo " pop %ss" >> $FILEOUT
echo " pop %gs" >> $FILEOUT
echo " pop %fs" >> $FILEOUT
echo " pop %es" >> $FILEOUT
echo " pop %ds" >> $FILEOUT
echo " popa" >> $FILEOUT
echo " sti" >> $FILEOUT
echo " iret" >> $FILEOUT
echo "" >> $FILEOUT
done

View File

@ -55,6 +55,8 @@
void handler(int num);
void handler_err(int err, int num);
/*
* eop

View File

@ -173,6 +173,14 @@ t_error architecture_idt_insert(t_uint16 index,
t_paddr offset,
t_flags flags);
t_error architecture_idt_reserve(t_paddr base,
t_flags flags,
t_uint16* index);
t_error architecture_idt_delete(t_uint16 index);
t_error architecture_idt_build(void);
/*
* eop

View File

@ -37,8 +37,8 @@ d_event glue_event_dispatch =
NULL,
NULL,
NULL,
NULL,
NULL,
glue_event_enable,
glue_event_disable,
NULL,
NULL,
glue_event_initialize,
@ -51,6 +51,20 @@ d_event glue_event_dispatch =
* ---------- functions -------------------------------------------------------
*/
t_error glue_event_enable(void)
{
ARCHITECTURE_STI();
MACHINE_LEAVE();
}
t_error glue_event_disable(void)
{
ARCHITECTURE_CLI();
MACHINE_LEAVE();
}
t_error glue_event_initialize(void)
{
t_uint16 i;

View File

@ -75,6 +75,10 @@
* ../event.c
*/
t_error glue_event_enable(void);
t_error glue_event_disable(void);
t_error glue_event_initialize(void);