mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-02 07:28:21 +00:00
x86_64: properly set kernel data segments on syscall/interrupt entry
This commit is contained in:
@@ -41,6 +41,11 @@ isr_%+ i:
|
|||||||
mov rdi,cr2
|
mov rdi,cr2
|
||||||
push rdi
|
push rdi
|
||||||
|
|
||||||
|
; set up kernel segments
|
||||||
|
mov rdi, 0x10
|
||||||
|
mov ds, rdi
|
||||||
|
mov es, rdi
|
||||||
|
|
||||||
; save ctx pointer and interrupt vector number
|
; save ctx pointer and interrupt vector number
|
||||||
mov rdi, i
|
mov rdi, i
|
||||||
mov rsi, rsp
|
mov rsi, rsp
|
||||||
|
|||||||
@@ -211,6 +211,10 @@ arch_syscall_entry:
|
|||||||
mov rbx, cr2
|
mov rbx, cr2
|
||||||
push rbx
|
push rbx
|
||||||
|
|
||||||
|
mov rbx, 0x10
|
||||||
|
mov es, rbx
|
||||||
|
mov ds, rbx
|
||||||
|
|
||||||
; prepare arguments for the functions
|
; prepare arguments for the functions
|
||||||
push r9
|
push r9
|
||||||
mov r9, r8
|
mov r9, r8
|
||||||
|
|||||||
Reference in New Issue
Block a user