Switch to cpp

This commit is contained in:
manzerbredes 2015-07-20 16:34:46 +04:00
parent 78f219c0ec
commit 9b856ae4d7
8 changed files with 62 additions and 30 deletions

5
kernel/GDT/Makefile Normal file
View 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
View 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(){
}

View file

@ -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
View 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