#include "hos_types.h" #include "hos_defines.h" #include "multiboot.h" #include "k_early_panic.h" #include "mm/mm.h" #define DEBUG_LETTER(col,chr) *(u16_t *)(CONSOLE_MEMORY + 160 * 8 + (col) * 2) \ = 0x0700 | (chr) /************************************************************************** * This function is invoked before paging is enabled. Segmentation is * * utilized to map virtual address 0xE000_0000 to physical address 0x0. * *************************************************************************/ u32_t k_bootstrap(mb_info_t * mb_info, u32_t mb_magic) { DEBUG_LETTER(2, 'c'); if (mb_magic != MB_BOOTLOADER_MAGIC) { k_early_panic("Bad multiboot magic identifier!"); } if ( ! (mb_info->flags & MB_BOOTLOADER_MMAP) ) { k_early_panic("No memory map provided by bootloader!"); } mb_mmap_t * mmap = (mb_mmap_t *) (mb_info->mmap_addr + HOS_KERNEL_OFFSET - 4); { int sz; for (sz = 0; sz < mb_info->mmap_length; sz += mmap->size + 4) { mm_record_mmap_entry(mmap); mmap = (mb_mmap_t *) (((u32_t)mmap) + mmap->size + 4); } } DEBUG_LETTER(3, 'd'); return 0; }