problem with task switching

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
yemista
Member
Member
Posts: 299
Joined: Fri Dec 26, 2008 12:31 pm
Location: Boston
Contact:

problem with task switching

Post 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.
User avatar
djsilence
Member
Member
Posts: 70
Joined: Wed Oct 01, 2008 11:18 am
Location: Ukraine, Kiev
Contact:

Re: problem with task switching

Post 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.
Don't think a ****, but in ukrainian schools English is TOO BAD!
Post Reply