fix: switch to task: dereference variable rightly

This commit is contained in:
Starnakin 2025-01-23 15:53:42 +01:00
parent 19eea56a7e
commit dc84d5856b

View File

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