BarinkOS/source/kernel/kernel.cpp
Nigel 94a2de3847 Started on path resolution algorithm
- The algorithm will work once I am of better mind to deal with
raw C strings
- The resolution should look at each entry divided by '/'.
  if the entry is not there then we can quit early, however for
now I am mostly concerned with getting the names of directory entries
we would need to look for.
2023-02-19 22:17:56 +01:00

63 lines
1.3 KiB
C++

/*
Copyright © Nigel Barink 2023
*/
extern "C"{
#include "../lib/include/string.h"
}
#include "memory/memory.h"
#include "memory/KernelHeap.h"
#include "memory/gdt/gdtc.h"
#include "memory/TaskStateSegment.h"
#include "supervisorterminal/superVisorTerminal.h"
#include "drivers/vga/VBE.h"
#include "drivers/pci/pci.h"
#include "drivers/pit/pit.h"
#include "drivers/acpi/acpi.h"
#include "i386/processor.h"
#include "terminal/kterm.h"
#include "interrupts/idt.h"
#include "serial.h"
#include "vfs/VFS.h"
extern "C" void LoadGlobalDescriptorTable();
extern "C" void jump_usermode();
extern "C" void kernel ()
{
init_serial();
kterm_init();
setup_tss();
initGDT();
initidt();
LoadGlobalDescriptorTable();
flush_tss();
printf("Memory setup complete!\n");
// Enable interrupts
asm volatile("STI");
initHeap();
pit_initialise();
// ACPI::initialize(); // FIXME: improper reading of bios memory
PCI::Scan();
processor::initialize();
processor::enable_protectedMode();
FileSystem::initialize();
// Testing my path resolution functions
Path test = Path("/boot/myos.bin");
FileSystem::ResolvePath(test);
#ifdef USERMODE_RELEASE
// Lets jump into user mode
jump_usermode();
#else
startSuperVisorTerminal();
#endif
}