Switch to cpp
This commit is contained in:
parent
78f219c0ec
commit
9b856ae4d7
8 changed files with 62 additions and 30 deletions
33
kernel/GDT/gdt.hpp
Normal file
33
kernel/GDT/gdt.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
#ifndef __GDT__
|
||||
#define __GDT__
|
||||
|
||||
#include "../Types/types.hpp"
|
||||
|
||||
//Define GDT pointer
|
||||
struct gdtPointerStruct{
|
||||
u16 size;
|
||||
u32 segment;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
//Define GDT descriptor
|
||||
struct gdtDescriptorStruct{
|
||||
u16 limit1;
|
||||
u16 base1;
|
||||
u8 base2;
|
||||
u8 type : 4;
|
||||
u8 param1 : 4;
|
||||
u8 limit2 : 4;
|
||||
u8 param2 : 4;
|
||||
u8 base3;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
|
||||
//Typedef :
|
||||
typedef struct gdtPointerStruct gdtPointerStruct;
|
||||
typedef struct gdtDescriptorStruct gdtDescriptorStruct;
|
||||
|
||||
//Functions :
|
||||
void initGdtDesc(u32 base, u32 limit, u8 type, u8 param, gdtDescriptorStruct *descriptor);
|
||||
void initGdt();
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue