Initial commit

This commit is contained in:
2026-02-04 01:58:49 +01:00
commit 0e01345abf
117 changed files with 5076 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#pragma once
#include <kernel/compiler.h>
#include <stdint.h>
#include "tss.h"
struct [[__packed]] gdt {
uint64_t null;
uint64_t kernel_code32;
uint64_t kernel_data32;
uint64_t kernel_code64;
uint64_t kernel_data64;
uint64_t user_code;
uint64_t user_data;
uint64_t user_code64;
uint64_t tss[2];
};
struct [[__packed]] gdtr {
uint16_t limit;
struct gdt* base;
};
// Initializes a GDT on the local core.
void gdt_init();
// Sets the Task State Segment in the given GDT.
void gdt_set_tss(struct gdt* gdt, struct tss* tss);