fix: (maybe): remove gdt address
This commit is contained in:
parent
24c7ea8b19
commit
4ec1a4962d
@ -3,7 +3,6 @@
|
||||
#include "tss.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#define GDT_ADDRESS 0xC0105040
|
||||
#define GDT_SIZE 8
|
||||
|
||||
// https://wiki.osdev.org/Global_Descriptor_Table#GDTR
|
||||
|
@ -7,7 +7,7 @@ extern void set_gdt(uint32_t gdt_ptr);
|
||||
|
||||
struct tss TSS;
|
||||
uint8_t gdt_entries[GDT_SIZE * 8];
|
||||
struct gdt_descriptor *gdtr = (struct gdt_descriptor *)GDT_ADDRESS;
|
||||
struct gdt_descriptor gdtr;
|
||||
|
||||
static void set_gdt_entry_value(uint8_t *target, uint32_t base, uint32_t limit,
|
||||
uint8_t access, uint8_t granularity)
|
||||
@ -37,8 +37,8 @@ static void set_gdt_entry_value(uint8_t *target, uint32_t base, uint32_t limit,
|
||||
|
||||
void init_gdt(void)
|
||||
{
|
||||
gdtr->size = 8 * GDT_SIZE - 1;
|
||||
gdtr->base = (uint32_t)&gdt_entries[0];
|
||||
gdtr.size = 8 * GDT_SIZE - 1;
|
||||
gdtr.base = (uint32_t)&gdt_entries[0];
|
||||
|
||||
set_gdt_entry_value(gdt_entries + 0x00, 0, 0, 0, 0); // Null segment
|
||||
|
||||
@ -95,5 +95,5 @@ void init_gdt(void)
|
||||
set_gdt_entry_value(gdt_entries + GDT_OFFSET_TSS, (uint32_t)&TSS,
|
||||
sizeof(struct tss) - 1, 0x89, 0);
|
||||
|
||||
set_gdt(((uint32_t)gdtr));
|
||||
set_gdt(((uint32_t)&gdtr));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user