00001 /*define for src/mboot.cpp*/ 00002 #ifndef _CORE_MBOOT_HPP 00003 #define _CORE_MBOOT_HPP 00004 00005 namespace Mboot { 00006 00007 00008 void init(); //preserve the syms data by changing the first_free_page var 00009 00010 /*the bits telling if module info is availlable*/ 00011 const uint32 DEF_MBOOT_MODS = 0x08; /*modules*/ 00012 const uint32 DEF_MBOOT_ELF_SH = 0x20; /*kernel section headers*/ 00013 00014 /*the struct of the multiboot info on kernel section headers*/ 00015 struct mboot_sht 00016 { 00017 uint32 num; 00018 uint32 entry_size; 00019 uint32 addr; 00020 uint32 shndx; 00021 }; 00022 00023 /*the structure provided by a mboot compatible bloader, like grub*/ 00024 struct mboot_struct 00025 { 00026 uint32 flags; 00027 uint32 mem_lower; 00028 uint32 mem_upper; 00029 uint32 boot_device; 00030 uint32 cmdline; 00031 uint32 mods_count; 00032 uint32 mods_addr; 00033 mboot_sht syms; 00034 uint32 mmap_length; 00035 uint32 mmap_addr; 00036 }; 00037 00038 /*struct module info*/ 00039 struct mod_info 00040 { 00041 uint32 mod_start; 00042 uint32 mod_end; 00043 uint32 string; 00044 uint32 _reserved; 00045 }; 00046 00047 /*the object is defined in wrapper.s*/ 00048 extern mboot_struct *mb_info asm ("mb_info"); 00049 00050 /*but we copy the contents because they might be overwritten*/ 00051 extern mboot_struct multiboot_info; 00052 00053 /*returns the number of loaded modules*/ 00054 uint32 mods_count(); 00055 /*returns a pointer to modinfo no. n*/ 00056 mod_info *mods_info(uint32 n); 00057 mboot_sht *mboot_syms();/*checks if syms info is availlable. if yes, return the struct*/ 00058 00059 00060 }; /*namespace Mboot*/ 00061 00062 #endif