fix bug in the calculation of esp0
This commit is contained in:
parent
6259892c00
commit
3c1b270160
1 changed files with 8 additions and 2 deletions
|
@ -799,8 +799,14 @@ common_switch:
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
%endif
|
%endif
|
||||||
add eax, task_state_segments
|
add eax, task_state_segments
|
||||||
; set esp0 in TSS
|
|
||||||
mov [eax+4], esp
|
; determine and set esp0 in TSS
|
||||||
|
mov ebx, esp
|
||||||
|
mov ecx, KERNEL_STACK_SIZE-1
|
||||||
|
not ecx
|
||||||
|
and ebx, ecx
|
||||||
|
add ebx, KERNEL_STACK_SIZE-16
|
||||||
|
mov [eax+4], ebx
|
||||||
|
|
||||||
; call cleanup code
|
; call cleanup code
|
||||||
call finish_task_switch
|
call finish_task_switch
|
||||||
|
|
Loading…
Add table
Reference in a new issue