wip: TSS added to the gdt and start to implement scheduler

This commit is contained in:
2025-01-13 15:46:09 +01:00
parent 916e8b6f19
commit b9691b1948
9 changed files with 156 additions and 8 deletions

View File

@ -1,9 +1,10 @@
#pragma once
#include "tss.h"
#include <stdint.h>
#define GDT_ADDRESS 0xC0105040
#define GDT_SIZE 7
#define GDT_SIZE 8
// https://wiki.osdev.org/Global_Descriptor_Table#GDTR
struct gdt_descriptor {
@ -11,6 +12,8 @@ struct gdt_descriptor {
uint32_t base;
} __attribute__((packed));
extern struct tss TSS;
void init_gdt();
#define GDT_FLAG_64BIT_MODE 0b0010
@ -39,3 +42,4 @@ extern uint8_t gdt_entries[GDT_SIZE * 8];
#define GDT_OFFSET_USER_CODE 0x20
#define GDT_OFFSET_USER_DATA 0x28
#define GDT_OFFSET_USER_STACK 0x30
#define GDT_OFFSET_TSS 0x38