diff --git a/src/multitasking/switch_to_task.s b/src/multitasking/switch_to_task.s index 555dd14..35f3f91 100644 --- a/src/multitasking/switch_to_task.s +++ b/src/multitasking/switch_to_task.s @@ -15,7 +15,7 @@ switch_to_task: mov [eax+0], esp // save the old eip pointer - mov ebx, [[esp_backup]] + mov ebx, [[[esp_backup]]] mov [eax+16], ebx // stack pointer + the 4 regs pushed @@ -23,10 +23,12 @@ switch_to_task: mov esi, [esp+(4+1)*4] mov [current_task], esi - mov esp, [current_task] // esp - mov eax, [current_task+4] // esp0 -// mov ebx, [current_task+8] // cr3 -// mov edi, [current_task+12] // page_directory + mov edi, [current_task] + + mov esp, [edi+0] // esp + mov eax, [edi+4] // esp0 +// mov ebx, [edi+8] // cr3 +// mov edi, [edi+12] // page_directory // mov [page_directory], edi // mov [TSS+4], eax // tss.esp0 // mov ecx, cr3 @@ -38,7 +40,7 @@ switch_to_task: .END: - mov eax, [current_task+16] + mov eax, [edi+16] mov ebx, [esp_backup] mov [ebx], eax