also I got my scheduler to deviate from james molloy's.. it worked after a few trial and error...
here is my code for doing the actual switch...
Code: Select all
asm volatile( "pushl %%edi;"
"pushl %%esi;"
"pushl %%ebx;"
"movl %%esp, %0;"
"movl $1f, %1;"
"movl %%ebp, %2;"
"movl %6, %%eax;" // load new cr3
"movl %%eax, %%cr3;"
"movl %5, %%ebp;"
"movl %4, %%esp;" // load new esp
"jmp *%3;"
"1: ;"
"popl %%ebx;"
"popl %%esi;"
"popl %%edi;"
:"=m"(prev->esp),"=m"(prev->eip), "=m"(prev->ebp)
:"r"(current_task->eip), "m"(current_task->esp),"g"(current_task->ebp),"m"(current_task->page_dir->phy_addr)
:
);
why is that the case? Can't I jump to a eip located in a memory location?