diff options
| author | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2015-07-20 16:34:46 +0400 |
|---|---|---|
| committer | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2015-07-20 16:34:46 +0400 |
| commit | 9b856ae4d7ad3dafc5cc6eac9194ff3803965d94 (patch) | |
| tree | a2ed8285af123c8276c6acfcda41e8d0888d7632 | |
| parent | 78f219c0ec049a08312896fdb1194ce03a54769a (diff) | |
Switch to cpp
| -rw-r--r-- | Readme.md | 4 | ||||
| -rw-r--r-- | kernel/GDT/Makefile | 5 | ||||
| -rw-r--r-- | kernel/GDT/gdt.cpp | 11 | ||||
| -rw-r--r-- | kernel/GDT/gdt.h | 22 | ||||
| -rw-r--r-- | kernel/GDT/gdt.hpp | 33 | ||||
| -rw-r--r-- | kernel/Makefile | 11 | ||||
| -rw-r--r-- | kernel/Types/types.hpp (renamed from kernel/Types/types.h) | 0 | ||||
| -rw-r--r-- | kernel/main.cpp (renamed from kernel/main.c) | 6 |
8 files changed, 62 insertions, 30 deletions
@@ -7,13 +7,13 @@ ##Programmers Zone -> Langages utilisés: nasm, C, AT&T ... +> Langages utilisés: nasm, C++, AT&T ... ##Utilitaires requis pour la compilation > Shell Unix (avec dd, cp etc...)<br /> > Make <br /> -> GCC, ld etc...<br/> +> G++, ld etc...<br/> > Nasm ##Comment utilisé le Noyaux Générer ? diff --git a/kernel/GDT/Makefile b/kernel/GDT/Makefile new file mode 100644 index 0000000..6e1b2c8 --- /dev/null +++ b/kernel/GDT/Makefile @@ -0,0 +1,5 @@ +gdt.o: gdt.cpp + g++ -m32 -c -o gdt.o gdt.cpp + +clean: + rm *.o diff --git a/kernel/GDT/gdt.cpp b/kernel/GDT/gdt.cpp new file mode 100644 index 0000000..5aa8065 --- /dev/null +++ b/kernel/GDT/gdt.cpp @@ -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(){ +} diff --git a/kernel/GDT/gdt.h b/kernel/GDT/gdt.h deleted file mode 100644 index 3df5698..0000000 --- a/kernel/GDT/gdt.h +++ /dev/null @@ -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 diff --git a/kernel/GDT/gdt.hpp b/kernel/GDT/gdt.hpp new file mode 100644 index 0000000..4b16886 --- /dev/null +++ b/kernel/GDT/gdt.hpp @@ -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 diff --git a/kernel/Makefile b/kernel/Makefile index 8b0c1bf..c366b55 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -1,12 +1,15 @@ -kernel.bin:entry.o main.o +kernel.bin:entry.o main.o GDT/gdt.o ld -m elf_i386 --entry=_start -Ttext=0x100000 -o $@ $^ entry.o:entry.asm nasm -f elf $^ -main.o:main.c - gcc -m32 -c $^ -o $@ +main.o:main.cpp + g++ -Wall -m32 -c $^ -o $@ +GDT/gdt.o: + cd GDT && make clean: + cd ./GDT/ && make clean rm ./*.o - rm kernel.bin + rm ./kernel.bin diff --git a/kernel/Types/types.h b/kernel/Types/types.hpp index a6f334e..a6f334e 100644 --- a/kernel/Types/types.h +++ b/kernel/Types/types.hpp diff --git a/kernel/main.c b/kernel/main.cpp index e0e9ebf..af5f048 100644 --- a/kernel/main.c +++ b/kernel/main.cpp @@ -1,8 +1,10 @@ - +#include "GDT/gdt.hpp" //----- PiegOS kernel main ----- -void main(){ +int main(){ while(1); + + return 0; } |
