Clear interrupt stack in yield sycall

This commit is contained in:
pjht 2019-02-11 14:13:49 -06:00
parent d54a55aad0
commit 9c5e5e91d0
3 changed files with 7 additions and 0 deletions

View File

@ -70,6 +70,10 @@ void gdt_init() {
");
}
void tss_stack_reset() {
tss.esp0=int_stack_top+0xC0000000;
}
void set_entry(int i,uint32_t base,uint32_t limit,uint8_t access) {
gdt[i].limit_low16=limit&0xFFFF;
gdt[i].base_low16=base&0xFFFFF;

View File

@ -2,5 +2,6 @@
#define GDT_H
void gdt_init();
void tss_stack_reset();
#endif

View File

@ -1,5 +1,6 @@
#include "isr.h"
#include "idt.h"
#include "gdt.h"
#include "ports.h"
#include "../halt.h"
#include "../drivers/vga.h"
@ -166,6 +167,7 @@ void isr_handler(registers_t r) {
break;
case 80:
if (r.eax==1) {
tss_stack_reset();
tasking_yield();
} else if (r.eax==2) {
tasking_createTask((void*)r.ebx);