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
+4 -2
View File
@@ -34,8 +34,10 @@ static void reloadgdtr(){
gdtr.offset = &arch_getcls()->gdt;
gdtr.size = sizeof(gdt_t) - 1;
asm("lgdt (%%rax)" : : "a"(&gdtr) : "memory");
asm("ltr %%ax" : : "a"(0x48));
asm volatile("lgdt (%%rax)" : : "a"(&gdtr) : "memory");
asm volatile("ltr %%ax" : : "a"(0x48));
asm volatile("swapgs;mov $0, %%ax;mov %%ax, %%gs;mov %%ax, %%fs;swapgs;" : : : "ax");
}
void gdt_init(){