I'm debugging my multitasking code, because sometimes system goes crazy because of multitasking.
I suspect the code that jumps to first task;
Code: Select all
void start_tasking()
{
asm volatile ("mov %0, %%eax" : : "a"(first_task->regs->eax));
asm volatile ("mov %0, %%ebx" : : "b"(first_task->regs->ebx));
asm volatile ("mov %0, %%ecx" : : "c"(first_task->regs->ecx));
asm volatile ("mov %0, %%edx" : : "d"(first_task->regs->edx));
asm volatile ("mov %0, %%esi" : : "S"(first_task->regs->esi));
asm volatile ("mov %0, %%edi" : : "D"(first_task->regs->edi));
asm volatile ("pushl $0x10"); // ss (kernel)
asm volatile ("pushl %0" : : "m"(first_task->regs->esp)); // esp
asm volatile ("pushf"); // flags
asm volatile ("pushl $0x8"); // cs (kernel)
asm volatile ("pushl %0" : : "m"(first_task->regs->eip)); // eip
asm volatile("iret");
}
What can I do?
Other code is good I think. I miss something that in front of my eyes.
Thanks