mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-11 15:29:18 +00:00
Added syscalls stub
This commit is contained in:
14
Architecture/aarch64/SystemCalls.cpp
Normal file
14
Architecture/aarch64/SystemCalls.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
#include <syscalls.hpp>
|
||||
|
||||
#include <cpu.hpp>
|
||||
|
||||
extern "C" __attribute__((naked, used, no_stack_protector)) void SystemCallHandlerStub()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
extern "C" uint64_t SystemCallsHandler(SyscallsRegs *regs);
|
||||
|
||||
void InitializeSystemCalls()
|
||||
{
|
||||
}
|
23
Architecture/amd64/SystemCalls.cpp
Normal file
23
Architecture/amd64/SystemCalls.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include <syscalls.hpp>
|
||||
|
||||
#include <cpu.hpp>
|
||||
|
||||
#include "cpu/gdt.hpp"
|
||||
|
||||
using namespace CPU::x64;
|
||||
|
||||
extern "C" __attribute__((naked, used, no_stack_protector)) void SystemCallHandlerStub()
|
||||
{
|
||||
asmv(".loop\n"
|
||||
"jmp .loop\n");
|
||||
}
|
||||
|
||||
extern "C" uint64_t SystemCallsHandler(SyscallsRegs *regs);
|
||||
|
||||
void InitializeSystemCalls()
|
||||
{
|
||||
wrmsr(MSR_EFER, rdmsr(MSR_EFER) | 1);
|
||||
wrmsr(MSR_STAR, ((uint64_t)(GDT_KERNEL_CODE) << 32) | ((uint64_t)(GDT_KERNEL_DATA | 3) << 48));
|
||||
wrmsr(MSR_LSTAR, (uint64_t)SystemCallsHandler);
|
||||
wrmsr(MSR_SYSCALL_MASK, 0);
|
||||
}
|
13
Architecture/i686/SystemCalls.cpp
Normal file
13
Architecture/i686/SystemCalls.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
#include <syscalls.hpp>
|
||||
|
||||
#include <cpu.hpp>
|
||||
|
||||
#include "cpu/gdt.hpp"
|
||||
|
||||
using namespace CPU::x32;
|
||||
|
||||
extern "C" uint32_t SystemCallsHandler(SyscallsRegs *regs);
|
||||
|
||||
void InitializeSystemCalls()
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user