mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-05 12:29:19 +00:00
Compiles on x86 but everything is broken
This commit is contained in:
99
Architecture/i686/cpu/GlobalDescriptorTable.cpp
Normal file
99
Architecture/i686/cpu/GlobalDescriptorTable.cpp
Normal file
@ -0,0 +1,99 @@
|
||||
#include "gdt.hpp"
|
||||
|
||||
#include <memory.hpp>
|
||||
#include <smp.hpp>
|
||||
#include <cpu.hpp>
|
||||
#include <debug.h>
|
||||
|
||||
namespace GlobalDescriptorTable
|
||||
{
|
||||
static GlobalDescriptorTableEntries GDTEntriesTemplate = {
|
||||
// null
|
||||
{.Length = 0x0,
|
||||
.BaseLow = 0x0,
|
||||
.BaseMiddle = 0x0,
|
||||
.Access = {.Raw = 0x0},
|
||||
.Flags = {.Raw = 0x0},
|
||||
.BaseHigh = 0x0},
|
||||
|
||||
// kernel code
|
||||
{.Length = 0x0,
|
||||
.BaseLow = 0x0,
|
||||
.BaseMiddle = 0x0,
|
||||
.Access = {.A = 0,
|
||||
.RW = 1,
|
||||
.DC = 0,
|
||||
.E = 1,
|
||||
.S = 1,
|
||||
.DPL = 0,
|
||||
.P = 1},
|
||||
.Flags = {.Unknown = 0x0, .L = 1},
|
||||
.BaseHigh = 0x0},
|
||||
|
||||
// kernel data
|
||||
{.Length = 0x0,
|
||||
.BaseLow = 0x0,
|
||||
.BaseMiddle = 0x0,
|
||||
.Access = {.A = 0,
|
||||
.RW = 1,
|
||||
.DC = 0,
|
||||
.E = 0,
|
||||
.S = 1,
|
||||
.DPL = 0,
|
||||
.P = 1},
|
||||
.Flags = {.Raw = 0x0},
|
||||
.BaseHigh = 0x0},
|
||||
|
||||
// user data
|
||||
{.Length = 0x0,
|
||||
.BaseLow = 0x0,
|
||||
.BaseMiddle = 0x0,
|
||||
.Access = {.A = 0,
|
||||
.RW = 1,
|
||||
.DC = 0,
|
||||
.E = 0,
|
||||
.S = 1,
|
||||
.DPL = 3,
|
||||
.P = 1},
|
||||
.Flags = {.Raw = 0x0},
|
||||
.BaseHigh = 0x0},
|
||||
|
||||
// user code
|
||||
{.Length = 0x0,
|
||||
.BaseLow = 0x0,
|
||||
.BaseMiddle = 0x0,
|
||||
.Access = {.A = 0,
|
||||
.RW = 1,
|
||||
.DC = 0,
|
||||
.E = 1,
|
||||
.S = 1,
|
||||
.DPL = 3,
|
||||
.P = 1},
|
||||
.Flags = {.Unknown = 0x0, .L = 1},
|
||||
.BaseHigh = 0x0},
|
||||
|
||||
// tss
|
||||
{}};
|
||||
|
||||
GlobalDescriptorTableEntries GDTEntries[MAX_CPU];
|
||||
GlobalDescriptorTableDescriptor gdt[MAX_CPU];
|
||||
|
||||
TaskStateSegment tss[MAX_CPU] = {
|
||||
0,
|
||||
{0, 0, 0},
|
||||
0,
|
||||
{0, 0, 0, 0, 0, 0, 0},
|
||||
0,
|
||||
0,
|
||||
};
|
||||
|
||||
void *CPUStackPointer[MAX_CPU];
|
||||
|
||||
SafeFunction void Init(int Core)
|
||||
{
|
||||
}
|
||||
|
||||
SafeFunction void SetKernelStack(void *Stack)
|
||||
{
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user