problem with task switching
Posted: Fri Nov 13, 2009 5:13 pm
when I call schedule from the kernel, tasks switch properly and I have no problems, however, whenever I put the call to schedule in a timer callback, I get a page fault. Any suggestions as to what to look into? here is the code for my proc switch function
the stack copies correctly and I verified this by printing each processes pid.
Code: Select all
asm_proc_switch:
mov eax, [esp + 8]
mov [eax], ebx
mov [eax + 4], esi
mov [eax + 8], edi
mov [eax + 12], esp
mov [eax + 16], ebp
mov ecx, [esp]
mov [eax + 24], ecx
;; second half
mov eax, [esp + 4]
mov ebx, [eax]
mov esi, [eax + 4]
mov edi, [eax + 8]
mov esp, [eax + 12]
mov ebp, [eax + 16]
mov ecx, [eax + 24]
mov [esp], ecx
ret