This commit adds GDT initialization with proper code/data segments and reloads CS. It also adds the initial IDT structure and loads an empty IDT. Build configuration updated to disable SSE/MMX to prevent compiler generation of unsupported instructions in early boot.
26 lines
450 B
C
26 lines
450 B
C
#ifndef GDT_H
|
|
#define GDT_H
|
|
|
|
#include <stdint.h>
|
|
|
|
/* GDT Entry Structure */
|
|
struct gdt_entry {
|
|
uint16_t limit_low;
|
|
uint16_t base_low;
|
|
uint8_t base_middle;
|
|
uint8_t access;
|
|
uint8_t granularity;
|
|
uint8_t base_high;
|
|
} __attribute__((packed));
|
|
|
|
/* GDT Pointer Structure */
|
|
struct gdt_ptr {
|
|
uint16_t limit;
|
|
uint32_t base;
|
|
} __attribute__((packed, aligned(1)));
|
|
|
|
/* Initialize GDT */
|
|
void init_gdt(void);
|
|
|
|
#endif // GDT_H
|