Syscalls working as expected

This commit is contained in:
Alex
2022-11-15 15:09:52 +02:00
parent 5dd496a73f
commit c2628019b7
10 changed files with 61 additions and 53 deletions

View File

@ -79,7 +79,6 @@ extern "C" __attribute__((naked, used, no_stack_protector)) void SystemCallHandl
void InitializeSystemCalls()
{
wrmsr(MSR_EFER, rdmsr(MSR_EFER) | 1);
// TODO: THIS IS NOT WORKING! USER CODE AND USER DATA SHOULD BE CS:0x23 AND SS:0x1B
wrmsr(MSR_STAR, ((uint64_t)(GDT_KERNEL_CODE) << 32) | ((uint64_t)(GDT_KERNEL_DATA | 3) << 48));
wrmsr(MSR_LSTAR, (uint64_t)SystemCallHandlerStub);
wrmsr(MSR_SYSCALL_MASK, (uint64_t)(1 << 9));