add: kernel task

This commit is contained in:
2025-01-20 15:11:22 +01:00
parent b3be29246e
commit d889a251ef
5 changed files with 34 additions and 21 deletions

View File

@ -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