diff options
| -rw-r--r-- | asm/int_irq.asm | 4 | ||||
| -rw-r--r-- | kernel/interrupts.c | 6 | ||||
| -rw-r--r-- | kernel/syscalls.c | 6 |
3 files changed, 12 insertions, 4 deletions
diff --git a/asm/int_irq.asm b/asm/int_irq.asm index 8341074..8567aa3 100644 --- a/asm/int_irq.asm +++ b/asm/int_irq.asm @@ -127,7 +127,9 @@ int_irq13: int_irq14: cli - call exception_handle ;this will never return due to panic! + pop eax + pop eax + call exception_handle_14 ;this will never return due to panic! jmp $ int_irq15: diff --git a/kernel/interrupts.c b/kernel/interrupts.c index 349b842..2fa6310 100644 --- a/kernel/interrupts.c +++ b/kernel/interrupts.c @@ -36,6 +36,12 @@ void exception_handle() panic(FOOLOS_MODULE_NAME,"exception interrupt"); } +void exception_handle_14(uint32_t error_code) +{ + log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"error_code: 0x%08X",error_code); + log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"at addr: 0x%08X",x86_get_cr2()); + panic(FOOLOS_MODULE_NAME,"page fault !"); +} void int_default() { log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"default handler"); diff --git a/kernel/syscalls.c b/kernel/syscalls.c index 62b924f..9cabf25 100644 --- a/kernel/syscalls.c +++ b/kernel/syscalls.c @@ -165,8 +165,10 @@ int syscall_execve(char *name, char **argv1, char **env1) log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"execve (name=0x%08X(%s), argvs=0x%08X, env=0x%08X)", name,name,argv1,env1); #endif + uint32_t alloc; + *entry=load_elf(name,&alloc); - if(!entry) + if(!*entry) { #ifdef LOG_SYSCALLS log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"execve: bailing out!"); @@ -178,8 +180,6 @@ int syscall_execve(char *name, char **argv1, char **env1) //asm volatile("jmp ."); asm volatile("mov $0x8fff000,%esp"); // set stack at high end of process image - uint32_t alloc; - *entry=load_elf(name,&alloc); // TODO: avoid code duplication for argv and env!! char **env_new=alloc; |
