#include
#include
/*Check if the bit BIT in FLAGS is set.*/
#define CHECK_FLAG(flags,bit) ((flags) & (1 << (bit)))
struct MultibootInfo bootInfo;
extern void early_serial_init();
void setup_param(uint8_t *addr, int magic)
{
early_serial_init();
struct MultibootInfo *mbi = (struct MultibootInfo *)addr;
bootInfo = *mbi;
KPRINTF("cs = %x, ds = %x, es = %x, fs = %x, gs = %x, ss = %x\n",
get_cs(), get_ds(), get_es(), get_fs(), get_gs(), get_ss());
KPRINTF("magic = %x\n", magic);
KPRINTF("Start = %x\n", &kernelStart);
KPRINTF("End = %x\n", &kernelEnd);
KPRINTF("low = %dK, upper = %dK\n", bootInfo.memLower, bootInfo.memUpper);
/*Is the command line passed?*/
if(CHECK_FLAG(mbi->flags, 2))
{
char *src = (char *)mbi->cmdline;
KPRINTF("cmdline : %s\n", src);
}
/*Are mods_* valid?*/
if(CHECK_FLAG(mbi->flags, 3))
{
struct MultibootModule *mod;
int i;
for(i = 0, mod=(struct MultibootModule *)mbi->modsAddress; imodsCount; i++, mod++)
{
char *src = (char *)mod->string;
KPRINTF("mod : %s\n", src);
}
}
}
阅读(1592) | 评论(0) | 转发(0) |