Tiberiu Chibici
caa7718af9
==================================================== Mainly changed: HAL.FSs + Updated 'mount' call in floppy driver, now done after controller is initialized + Added 'detect' function for FAT file systems + Implemented 'initdr' driver, however still bugged + Improved logger
42 lines
795 B
C
42 lines
795 B
C
#include "hal/hal.h"
|
|
#include "drivers/drivers.h"
|
|
#include <debugio.h>
|
|
#include <time.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <memory.h>
|
|
#include <multiboot.h>
|
|
|
|
extern uint32 _end;
|
|
|
|
extern void luxInitrdInstall (MultibootInfo* info);
|
|
|
|
void k_main(MultibootInfo* info)
|
|
{
|
|
uint32 KernelEnd = (uint32)&_end;
|
|
|
|
// Find kernel's end
|
|
if (info->Flags & 0x8) {
|
|
|
|
uint32 i = 0;
|
|
MultibootModule* modules = (MultibootModule*) info->ModulesAddress;
|
|
|
|
for (i = 0; i < info->ModulesCount; i++)
|
|
KernelEnd = Max(KernelEnd, modules[i].ModuleEnd);
|
|
}
|
|
|
|
ConsoleClear();
|
|
MemoryTempInitialize(KernelEnd);
|
|
MemoryInitialize(info);
|
|
|
|
HalInitialize();
|
|
luxInitrdInstall(info);
|
|
|
|
DriversInstall();
|
|
|
|
// Set up memory manager
|
|
Log("Console", "All ready. Starting console...\n\n");
|
|
|
|
ConsoleMain();
|
|
}
|