Added the Global Descriptor Table.

This commit is contained in:
2020-06-19 12:08:17 -05:00
parent b409b3e9d2
commit 84f64badaf
6 changed files with 102 additions and 5 deletions
+22
View File
@@ -0,0 +1,22 @@
#ifndef GDT_H
#define GDT_H
struct gdt {
unsigned short size;
unsigned int address;
} __attribute__((packed));
struct gdt_entry
{
unsigned short limit_low;
unsigned short base_low;
unsigned char base_middle;
unsigned char access;
unsigned char granularity;
unsigned char base_high;
} __attribute__((packed));
void gdt_install();
void load_gdt(struct gdt *);
void gdt_set_gate(unsigned long, unsigned long, unsigned char, unsigned char, struct gdt_entry*);
#endif
+1 -2
View File
@@ -1,5 +1,4 @@
#ifndef KERNEL_H
#define KERNEL_H
int strlen(char*);
void kmain();
#endif