Fix huge bug! Idle task could handle its stack pointer wrong!

=> depending on the config file and the started apps, we got different failure
This commit is contained in:
Stefan Lankes 2011-08-28 08:42:39 -07:00
parent 4fe2562839
commit 291aeabb8a
2 changed files with 3 additions and 3 deletions

View file

@ -63,7 +63,7 @@ SECTION .text
ALIGN 4
stublet:
; initialize stack pointer.
mov esp, default_stack_pointer
mov esp, [default_stack_pointer]
; initialize cpu features
call cpu_init
; interpret multiboot information

View file

@ -28,10 +28,10 @@
gdt_ptr_t gp;
static tss_t task_state_segments[MAX_TASKS] __attribute__ ((aligned (PAGE_SIZE)));
static unsigned char kstacks[MAX_TASKS][KERNEL_STACK_SIZE] __attribute__ ((aligned (PAGE_SIZE), section (".data")));
static unsigned char kstacks[MAX_TASKS][KERNEL_STACK_SIZE] __attribute__ ((aligned (PAGE_SIZE))) = {[0 ... MAX_TASKS-1][0 ... KERNEL_STACK_SIZE-1] = 0xCD};
uint32_t default_stack_pointer = (uint32_t) kstacks[0] + KERNEL_STACK_SIZE - sizeof(size_t);
// currently, our kernel has full access to the ioports
static gdt_entry_t gdt[GDT_ENTRIES] = {[0 ... GDT_ENTRIES-1] = {0, 0, 0, 0, 0, 0}};
unsigned char* default_stack_pointer __attribute__ ((section (".data"))) = kstacks[0] + KERNEL_STACK_SIZE - sizeof(size_t);
/*
* This is defined in entry.asm. We use this to properly reload