2025-05-29 03:19:50 +00:00
|
|
|
//Our own code, at this point...
|
|
|
|
|
//#include <stddef.h>
|
2025-05-23 05:18:12 +00:00
|
|
|
#include <stdint.h>
|
2025-06-08 05:27:41 +00:00
|
|
|
#include "kio.h"
|
|
|
|
|
#include "kttools.h"
|
2025-06-09 02:44:17 +00:00
|
|
|
#include "kmultiboot.h"
|
2025-05-23 05:18:12 +00:00
|
|
|
|
|
|
|
|
//finally, main.
|
2025-06-11 03:41:51 +00:00
|
|
|
void kern_main(uint32_t multiboot_magic, mb_info_t* multiboot_info)
|
2025-05-23 05:18:12 +00:00
|
|
|
{
|
2025-06-11 04:27:15 +00:00
|
|
|
//Hello C! Let's get to work in cleaning up our environment a bit and creating some safety.
|
|
|
|
|
//First interrupts.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-05-23 05:18:12 +00:00
|
|
|
//wipe the screen
|
2025-05-29 03:19:50 +00:00
|
|
|
vga_clear();
|
2025-06-08 20:18:06 +00:00
|
|
|
//We're going to use this buffer as our 8char hex representation for reading mem
|
2025-06-08 05:27:41 +00:00
|
|
|
|
2025-06-08 20:18:06 +00:00
|
|
|
vga_printf("Entry eax:%X\n", multiboot_magic);
|
|
|
|
|
|
|
|
|
|
if(multiboot_magic != 0x2BADB002) {
|
|
|
|
|
vga_println("Bootloader not multiboot1 compliant! Needed for mmap, etc. Can't work without it, kthxbye!");
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
vga_println("Multiboot detected! Continuing...");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vga_printf("MEM_LOWER:%X\n", multiboot_info->mem_lower);
|
|
|
|
|
vga_printf("MEM_UPPER:%X\n", multiboot_info->mem_upper);
|
2025-05-23 05:18:12 +00:00
|
|
|
}
|
|
|
|
|
|