Page 1 of 1

problem with task switching

Posted: Fri Nov 13, 2009 5:13 pm
by yemista
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

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
the stack copies correctly and I verified this by printing each processes pid.

Re: problem with task switching

Posted: Tue Nov 17, 2009 11:15 pm
by djsilence
are all registers in your timer IRQ stored correctly?

see, if you get page fault it means then you return not to that place, where you started "your trip"...

Daniel.