This commit is contained in:
2026-09-14 02:50:35 +02:00
parent cf3f1f9e99
commit 9e5ed517bc
45 changed files with 210 additions and 212 deletions
+6 -1
View File
@@ -1,6 +1,7 @@
#include <zinnia/archctl.h>
#include <zinnia/status.h>
#include <common/compiler.h>
#include <kernel/arch.h>
#include <kernel/init.h>
#include <kernel/percpu.h>
#include <x86_64/apic.h>
@@ -9,7 +10,7 @@
#include <x86_64/gdt.h>
[[__init, __naked, __used]]
void _start() {
void arch_start() {
asm volatile(
"lea rsp, [rip + %0]\n"
"jmp %1"
@@ -25,6 +26,10 @@ zn_status_t arch_archctl(zn_archctl_t op, uintptr_t arg) {
case ZN_ARCHCTL_SET_FSBASE:
asm_wrmsr(MSR_FS_BASE, arg);
return 0;
case ZN_ARCHCTL_SET_GSBASE:
// Slightly misleading, but KERNEL_GS_BASE is the currently inactive register.
asm_wrmsr(MSR_KERNEL_GS_BASE, arg);
return 0;
default:
return ZN_ERR_INVALID;
}