fix: switch to task: dereference variable rightly
This commit is contained in:
parent
19eea56a7e
commit
dc84d5856b
@ -15,7 +15,7 @@ switch_to_task:
|
|||||||
mov [eax+0], esp
|
mov [eax+0], esp
|
||||||
|
|
||||||
// save the old eip pointer
|
// save the old eip pointer
|
||||||
mov ebx, [[esp_backup]]
|
mov ebx, [[[esp_backup]]]
|
||||||
mov [eax+16], ebx
|
mov [eax+16], ebx
|
||||||
|
|
||||||
// stack pointer + the 4 regs pushed
|
// stack pointer + the 4 regs pushed
|
||||||
@ -23,10 +23,12 @@ switch_to_task:
|
|||||||
mov esi, [esp+(4+1)*4]
|
mov esi, [esp+(4+1)*4]
|
||||||
mov [current_task], esi
|
mov [current_task], esi
|
||||||
|
|
||||||
mov esp, [current_task] // esp
|
mov edi, [current_task]
|
||||||
mov eax, [current_task+4] // esp0
|
|
||||||
// mov ebx, [current_task+8] // cr3
|
mov esp, [edi+0] // esp
|
||||||
// mov edi, [current_task+12] // page_directory
|
mov eax, [edi+4] // esp0
|
||||||
|
// mov ebx, [edi+8] // cr3
|
||||||
|
// mov edi, [edi+12] // page_directory
|
||||||
// mov [page_directory], edi
|
// mov [page_directory], edi
|
||||||
// mov [TSS+4], eax // tss.esp0
|
// mov [TSS+4], eax // tss.esp0
|
||||||
// mov ecx, cr3
|
// mov ecx, cr3
|
||||||
@ -38,7 +40,7 @@ switch_to_task:
|
|||||||
|
|
||||||
|
|
||||||
.END:
|
.END:
|
||||||
mov eax, [current_task+16]
|
mov eax, [edi+16]
|
||||||
mov ebx, [esp_backup]
|
mov ebx, [esp_backup]
|
||||||
mov [ebx], eax
|
mov [ebx], eax
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user