cowos attempted gdt, but at least we have vga drivers now

This commit is contained in:
cowmonk 2025-07-18 23:50:07 -07:00
parent b08b0728ae
commit 41b34d2a9d
14 changed files with 253 additions and 140 deletions

28
kernel/include/gdt.h Normal file
View file

@ -0,0 +1,28 @@
#include <stdint.h>
#ifndef GDT_H
#define GDT_H
typedef struct GDTEntry {
uint16_t limit;
uint16_t base_low;
uint16_t base_mid;
uint8_t base_high;
uint8_t access;
uint8_t granularity;
} __attribute__((packed)) GDTEntry;
typedef struct GDTPtr {
uint16_t limit;
uint64_t base;
} __attribute__((packed)) GDTPtr;
#define GDT_NUM_ENTRIES 5 /* including null descriptor */
#define GDT_KERNEL_CODE 0x08
#define GDT_KERNEL_DATA 0x10
#define GDT_USER_CODE 0x18
#define GDT_USER_DATA 0x20
void initGDT();
#endif /* GDT_H */