fix creating ring 3 tasks finally
This commit is contained in:
+9
-10
@@ -15,29 +15,28 @@ global switchProcess
|
||||
extern current
|
||||
extern trapret
|
||||
|
||||
; void switchProcess(Process* next_process_ptr)
|
||||
switchProcess:
|
||||
mov eax, [esp + 4] ; eax = old
|
||||
mov edx, [esp + 8] ; edx = new
|
||||
mov edx, [esp + 4] ; edx = next_process_ptr (получаем аргумент СРАЗУ)
|
||||
cli ; Запретить прерывания
|
||||
|
||||
push ebp
|
||||
push ebx
|
||||
push esi
|
||||
push edi
|
||||
|
||||
mov [eax+4], esp
|
||||
mov esp, [edx+4]
|
||||
mov eax, [current]
|
||||
mov [eax + 4], esp ; current->kesp = esp
|
||||
|
||||
;mov eax, [edx+12]
|
||||
;sub eax, 0xC0000000
|
||||
;mov cr3, eax
|
||||
; edx уже содержит next_process_ptr
|
||||
mov esp, [edx + 4] ; esp = next_process_ptr->kesp
|
||||
mov [current], edx ; current = next_process_ptr
|
||||
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
pop ebp
|
||||
|
||||
|
||||
ret ; Для ring 0 просто возвращаемся
|
||||
ret
|
||||
|
||||
|
||||
trapret:
|
||||
|
||||
Reference in New Issue
Block a user