tasks, so I'm doing some housekeeping. gdt structure and related pointers go to gdt.structure. multiboot magic numbers go into multiboot.s. main code routine goes to start.s for bootstrapping C.
32 lines
897 B
C
32 lines
897 B
C
//Our own code, at this point...
|
|
//#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include "kio.h"
|
|
#include "kttools.h"
|
|
#include "kmultiboot.h"
|
|
|
|
//finally, main.
|
|
void kern_main(uint32_t multiboot_magic, mb_info_t* multiboot_info)
|
|
{
|
|
//Hello C! Let's get to work in cleaning up our environment a bit and creating some safety.
|
|
//First interrupts.
|
|
|
|
|
|
|
|
//wipe the screen
|
|
vga_clear();
|
|
//We're going to use this buffer as our 8char hex representation for reading mem
|
|
|
|
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);
|
|
}
|
|
|