diff --git a/src/multitasking/switch_to_task.s b/src/multitasking/switch_to_task.s index 3194d3c..cff5f5f 100644 --- a/src/multitasking/switch_to_task.s +++ b/src/multitasking/switch_to_task.s @@ -11,7 +11,7 @@ switch_to_task: // save the current stack pointer to the old stack mov [current_task+0], esp - + mov edi, [esp_backup] // get eip mov [current_task+16], edi // save instruction before Interrupt @@ -31,13 +31,14 @@ switch_to_task: je .END // mov cr3, ebx - // TODO replace the eip store in stack by the [current_task+16](current_task->eip) + +.END: mov edi, [current_task+16] mov [esp_backup], edi -.END: + pop esi pop edi pop ebp pop ebx - ret // this will also change eip to the next task's instructions + ret