Switch to cpp
This commit is contained in:
parent
78f219c0ec
commit
9b856ae4d7
8 changed files with 62 additions and 30 deletions
5
kernel/GDT/Makefile
Normal file
5
kernel/GDT/Makefile
Normal file
|
@ -0,0 +1,5 @@
|
|||
gdt.o: gdt.cpp
|
||||
g++ -m32 -c -o gdt.o gdt.cpp
|
||||
|
||||
clean:
|
||||
rm *.o
|
11
kernel/GDT/gdt.cpp
Normal file
11
kernel/GDT/gdt.cpp
Normal file
|
@ -0,0 +1,11 @@
|
|||
#include "gdt.hpp"
|
||||
#include "../Types/types.hpp"
|
||||
|
||||
|
||||
void initGdtDesc(u32 base, u32 limit, u8 type, u8 param, gdtDescriptorStruct *descriptor){
|
||||
|
||||
}
|
||||
|
||||
|
||||
void initGdt(){
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
#ifndef __GDT__
|
||||
#define __GDT__
|
||||
|
||||
#include "../Types/types.h"
|
||||
|
||||
struct gdtPointer{
|
||||
u16 size;
|
||||
u32 segment;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct gdtDescriptor{
|
||||
u16 limit1;
|
||||
u16 base1;
|
||||
u8 base2;
|
||||
u8 type : 4;
|
||||
u8 param1 : 4;
|
||||
u8 limit2 : 4;
|
||||
u8 param2 : 4;
|
||||
u8 base3;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#endif
|
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