summaryrefslogtreecommitdiff
path: root/kernel/GDT/gdt.h
diff options
context:
space:
mode:
authormanzerbredes <loic.guegan_secondary@yahoo.fr>2015-07-28 14:19:00 +0400
committermanzerbredes <loic.guegan_secondary@yahoo.fr>2015-07-28 14:19:00 +0400
commite0c565f7ff7620dca9dfc6c607f4798f5291c7bf (patch)
treec18099687db0202e32ae47f4c991b895191f030e /kernel/GDT/gdt.h
parentaac010a9e30e479968e277ebdaf41ad366a77098 (diff)
Go back to C and adapt codeHEADmasterdevelop
Diffstat (limited to 'kernel/GDT/gdt.h')
-rw-r--r--kernel/GDT/gdt.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/kernel/GDT/gdt.h b/kernel/GDT/gdt.h
new file mode 100644
index 0000000..86cdaf3
--- /dev/null
+++ b/kernel/GDT/gdt.h
@@ -0,0 +1,37 @@
+#ifndef __GDT__
+#define __GDT__
+
+#include "../Helpers/types.h"
+
+
+//Define GDT pointer
+struct GdtPointerStruct{
+ u16 size;
+ u32 segment;
+} __attribute__ ((packed));
+
+
+//Define GDT descriptor
+struct GdtDescriptorStruct{
+ u16 limit1;
+ u16 base1;
+ u8 base2;
+ u8 access;
+ u8 limit2 : 4;
+ u8 flags : 4;
+ u8 base3;
+} __attribute__ ((packed));
+
+
+//Typedef :
+typedef struct GdtPointerStruct GdtPointerStruct;
+typedef struct GdtDescriptorStruct GdtDescriptorStruct;
+
+
+//Functions :
+void gdt_initGdtDesc(u32 base, u32 limit, u8 access, u8 flags, GdtDescriptorStruct *Descriptor);
+void gdt_loadGdt();
+
+
+
+#endif