增加一个从c语言使用x86_64中sysret指令的接口

This commit is contained in:
pointer-to-bios 2024-02-18 03:54:48 +08:00
parent 5bd549328f
commit 0613dadeaf
2 changed files with 7 additions and 0 deletions

View File

@ -26,6 +26,9 @@ init64:
lea rax, [systemcall_procedure]
wrmsr
; 加载中断相关寄存器
; 需要加载寄存器IA32_INTERRUPT_SSP_TABLE
jmp kmain
section .multiboot2 align=8

View File

@ -50,6 +50,10 @@ set_kernel_stack_cache:
pop rax
ret
; void return_from_systemcall()
return_from_systemcall:
sysret
save_kernel_stack:
endbr64
lea rbx, [kernel_stack_cache]