diff options
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/SecondaryInit.cpp | 11 | ||||
| -rw-r--r-- | arch/SecondaryInit.h | 9 | ||||
| -rw-r--r-- | arch/x86/PrimaryInit.cpp | 16 | ||||
| -rw-r--r-- | arch/x86/PrimaryInit.h | 12 | ||||
| -rwxr-xr-x | arch/x86/gdt/Gdt.cpp | 2 | ||||
| -rw-r--r-- | arch/x86/gdt/GlobalObj.cpp | 6 | ||||
| -rw-r--r-- | arch/x86/gdt/GlobalObj.h | 11 | ||||
| -rw-r--r-- | arch/x86/gdt/GoToGdtMemSeg.s | 13 | ||||
| -rw-r--r-- | arch/x86/io/GlobalObj.cpp | 3 | ||||
| -rw-r--r-- | arch/x86/io/GlobalObj.h | 8 | ||||
| -rw-r--r-- | arch/x86/io/VGADisplay.cpp | 2 | ||||
| -rw-r--r-- | arch/x86/io/VGADisplay.h | 8 |
12 files changed, 60 insertions, 41 deletions
diff --git a/arch/SecondaryInit.cpp b/arch/SecondaryInit.cpp new file mode 100644 index 0000000..900f84b --- /dev/null +++ b/arch/SecondaryInit.cpp @@ -0,0 +1,11 @@ +#include "SecondaryInit.h" + +void SecondaryInitialization::processorInitialize() +{ + PrimaryInitialization::processorInitialize(); +}; + +void SecondaryInitialization::devicesInitialize() +{ + PrimaryInitialization::devicesInitialize(); +}; diff --git a/arch/SecondaryInit.h b/arch/SecondaryInit.h new file mode 100644 index 0000000..f9aa5be --- /dev/null +++ b/arch/SecondaryInit.h @@ -0,0 +1,9 @@ +#include "x86/PrimaryInit.h" + +class SecondaryInitialization : protected PrimaryInitialization +{ + public: + void processorInitialize() override final; + void devicesInitialize() override final; +}; + diff --git a/arch/x86/PrimaryInit.cpp b/arch/x86/PrimaryInit.cpp new file mode 100644 index 0000000..7de690e --- /dev/null +++ b/arch/x86/PrimaryInit.cpp @@ -0,0 +1,16 @@ +#include "PrimaryInit.h" + + +void PrimaryInitialization::processorInitialize() +{ + MngGdt mngGdt = MngGdt(); + + mngGdt.addDescriptor(DescSeg32::flatCodeKernel()); + mngGdt.addDescriptor(DescSeg32::flatDataKernel()); + mngGdt.loadGdt(); +}; + +void PrimaryInitialization::devicesInitialize() +{ + out::display = VGADisplay(); +}; diff --git a/arch/x86/PrimaryInit.h b/arch/x86/PrimaryInit.h new file mode 100644 index 0000000..8d16549 --- /dev/null +++ b/arch/x86/PrimaryInit.h @@ -0,0 +1,12 @@ +#include "gdt/Gdt.h" +#include "io/VGADisplay.h" + + +#define x86_ARCH + +class PrimaryInitialization +{ + protected: + virtual void processorInitialize(); + virtual void devicesInitialize(); +}; diff --git a/arch/x86/gdt/Gdt.cpp b/arch/x86/gdt/Gdt.cpp index 80fcd13..21941b4 100755 --- a/arch/x86/gdt/Gdt.cpp +++ b/arch/x86/gdt/Gdt.cpp @@ -1,6 +1,8 @@ #include "Gdt.h" +uint64 MngGdt::gdt[MngGdt::size]; + DescSeg32::DescSeg32(uint32 base, uint32 limit, uint8 access, uint8 flags) { this->baseLow = base & 0x0000FFFF; diff --git a/arch/x86/gdt/GlobalObj.cpp b/arch/x86/gdt/GlobalObj.cpp deleted file mode 100644 index fbceeef..0000000 --- a/arch/x86/gdt/GlobalObj.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "GlobalObj.h" - - -uint64 MngGdt::gdt[MngGdt::size]; - -MngGdt mngGdt; diff --git a/arch/x86/gdt/GlobalObj.h b/arch/x86/gdt/GlobalObj.h deleted file mode 100644 index 3c62847..0000000 --- a/arch/x86/gdt/GlobalObj.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef GDTGLOBALOBJ_H -#define GDTGLOBALOBJ_H - -#include <types.h> -#include "Gdt.h" - -extern MngGdt mngGdt; - -void mngGdtInit(); - -#endif diff --git a/arch/x86/gdt/GoToGdtMemSeg.s b/arch/x86/gdt/GoToGdtMemSeg.s deleted file mode 100644 index 2b5dd62..0000000 --- a/arch/x86/gdt/GoToGdtMemSeg.s +++ /dev/null @@ -1,13 +0,0 @@ -global GOTOGDTMEMSEG -GOTOGDTMEMSEG: - lgdt [esp + 4] - jmp 0x08:.reloadCS -.reloadCS: - mov ax, 0x10 - mov ds, ax - mov es, ax - mov fs, ax - mov gs, ax - mov ss, ax - ret -.end: diff --git a/arch/x86/io/GlobalObj.cpp b/arch/x86/io/GlobalObj.cpp deleted file mode 100644 index a1c4f03..0000000 --- a/arch/x86/io/GlobalObj.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "VGADisplay.h" - -VGADisplay display; diff --git a/arch/x86/io/GlobalObj.h b/arch/x86/io/GlobalObj.h deleted file mode 100644 index 72c6b06..0000000 --- a/arch/x86/io/GlobalObj.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef GLOBALOBJ_H -#define GLOBALOBJ_H - -#include "VGADisplay.h" - -extern VGADisplay display; - -#endif diff --git a/arch/x86/io/VGADisplay.cpp b/arch/x86/io/VGADisplay.cpp index 0cd0bed..ceb4862 100644 --- a/arch/x86/io/VGADisplay.cpp +++ b/arch/x86/io/VGADisplay.cpp @@ -1,5 +1,7 @@ #include "VGADisplay.h" +VGADisplay out::display; + VGADisplay::VGADisplay() { isBright = isBlink = shift = 0; diff --git a/arch/x86/io/VGADisplay.h b/arch/x86/io/VGADisplay.h index db4c4df..326ae95 100644 --- a/arch/x86/io/VGADisplay.h +++ b/arch/x86/io/VGADisplay.h @@ -36,4 +36,12 @@ class VGADisplay void setBlink(bool blinkAttr); void setBright(bool brigthAttr); }; + +// Global variables + +namespace out +{ + extern VGADisplay display; +}; + #endif |
