clean-up
This commit is contained in:
parent
6384d6e533
commit
dca1dd3168
|
@ -110,16 +110,31 @@ void BtInitBootInfo(multiboot_info_t *mbi)
|
|||
}
|
||||
}
|
||||
|
||||
void BtInitSanity(uint mbMagic){
|
||||
uint tmp;
|
||||
|
||||
KernLog("%c%c%c OS/K\n \n", 219, 219, 219);
|
||||
|
||||
if (!(mbMagic == MULTIBOOT_BOOTLOADER_MAGIC))
|
||||
KeStartPanic("[Init] Magic number %x is incorrect\n", mbMagic);
|
||||
|
||||
tmp = (BtGetBootInfo(btldr).kernelEndAddr
|
||||
- BtGetBootInfo(btldr).kernelAddr) / KB;
|
||||
DebugLog("[Init] Kernel successfully loaded at %p with %x magic\n"
|
||||
" and it uses %d Kio\n\n",
|
||||
BtGetBootInfo(btldr).kernelAddr,
|
||||
mbMagic,tmp);
|
||||
}
|
||||
|
||||
|
||||
extern void pstest(void);
|
||||
extern error_t IoInitVGABuffer(void);
|
||||
|
||||
//
|
||||
// Entry point of the Kaleid kernel
|
||||
//
|
||||
noreturn void BtStartKern(multiboot_info_t *mbInfo, int mbMagic)
|
||||
noreturn void BtStartKern(multiboot_info_t *mbInfo, uint mbMagic)
|
||||
{
|
||||
int tmp;
|
||||
|
||||
// We're not ready to deal with interrupts
|
||||
KeDisableIRQs();
|
||||
|
||||
|
@ -129,25 +144,16 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, int mbMagic)
|
|||
// Get ready to print things
|
||||
IoInitVGABuffer();
|
||||
|
||||
// Hello world
|
||||
KernLog("%c%c%c OS/K\n \n", 219, 219, 219);
|
||||
|
||||
KalAlwaysAssert(mbMagic == MULTIBOOT_BOOTLOADER_MAGIC);
|
||||
|
||||
tmp = (BtGetBootInfo(btldr).kernelEndAddr
|
||||
- BtGetBootInfo(btldr).kernelAddr) / KB;
|
||||
KernLog("[Init] Kernel successfully loaded at %p with %x magic\n"
|
||||
" and it uses %d Kio\n\n",
|
||||
BtGetBootInfo(btldr).kernelAddr,
|
||||
mbMagic,tmp);
|
||||
// Sanity checks and hello world
|
||||
BtInitSanity(mbMagic);
|
||||
|
||||
//Memory mapping
|
||||
MmInitMemoryMap();
|
||||
|
||||
MmInitHeap();
|
||||
|
||||
int i = 0;
|
||||
while(i < 512) { KernLog("%d\n", i++);}
|
||||
//int i = 0;
|
||||
//while(i < 512) { KernLog("%d\n", i++);}
|
||||
|
||||
PsInitSched();
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@ void *MmGetFirstAvailZone(void *start) {
|
|||
void MmPrintMemoryMap(void) {
|
||||
char *avStr = "";
|
||||
|
||||
for (int i=0; i < memoryMap.length; i++) {
|
||||
for (uint i=0; i < memoryMap.length; i++) {
|
||||
|
||||
switch (memoryMap.entry[i].type) {
|
||||
case AVAILABLE_ZONE: avStr="Available";
|
||||
|
|
Loading…
Reference in New Issue