add: kernel task
This commit is contained in:
@ -11,6 +11,8 @@ switch_to_task:
|
||||
|
||||
// save the current stack pointer to the old stack
|
||||
mov [current_task], esp
|
||||
mov edi, [eip_backup]
|
||||
mov [current_task+16], edi // save instruction before Interrupt
|
||||
|
||||
// stack pointer + the 4 regs pushed
|
||||
// and + 1 to get the argument (next task)
|
||||
@ -26,7 +28,9 @@ switch_to_task:
|
||||
// if cr3 hasn't change, do nothing
|
||||
cmp ecx, ebx
|
||||
je .END
|
||||
mov cr3, ebx
|
||||
// mov cr3, ebx
|
||||
|
||||
// TODO replace the eip store in stack by the [current_task+16](current_task->eip)
|
||||
|
||||
.END:
|
||||
pop esi
|
||||
@ -34,6 +38,4 @@ switch_to_task:
|
||||
pop ebp
|
||||
pop ebx
|
||||
|
||||
push [eip_backup]
|
||||
|
||||
iretd // this will also change eip to the next task's instructions
|
||||
ret // this will also change eip to the next task's instructions
|
||||
|
||||
Reference in New Issue
Block a user