system calls

This commit is contained in:
Matheus
2022-08-15 21:52:57 -03:00
parent 21e6a0ad1a
commit 432e85b837
17 changed files with 187 additions and 26 deletions
+3 -1
View File
@@ -8,6 +8,8 @@
// syscall, sse, etc
// for the current cpu
extern void asm_syscall_entry();
void cpu_state_init(){
// syscall
@@ -28,7 +30,7 @@ void cpu_state_init(){
star |= (uint64_t)0x28 << 32;
wrmsr(MSR_STAR, star);
wrmsr(MSR_LSTAR, 0xDEADBEEF); // FIXME add 64 bit handler here
wrmsr(MSR_LSTAR, asm_syscall_entry);
wrmsr(MSR_CSTAR, 0); // no compat mode syscall handler
wrmsr(MSR_FMASK, 0x200); // disable interrupts on syscall
}