The steps I take:
1. Change page directory
2. Set TSS to kernel stack
3. Swtitch task using the following code:
What could be the reason for that ?
Code: Select all
run_kernel_task:
mov eax, [esp+4] ; load task_register_t pointer to eax
mov ebx, [eax+4]
mov ecx, [eax+8]
mov edx, [eax+12]
mov ebp, [eax+16]
mov esi, [eax+20]
mov edi, [eax+24]
; restore the stack pointer
mov esp, [eax+32]
; push information for iret onto the stack
push DWORD [eax+36] ; push EFLAGS
push DWORD [eax+40] ; push the segment selector
push DWORD [eax+44] ; push EIP
mov eax, [eax] ; restore eax
iret