Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1800910
  • 博文数量: 286
  • 博客积分: 3713
  • 博客等级: 少校
  • 技术积分: 2275
  • 用 户 组: 普通用户
  • 注册时间: 2012-01-11 09:47
个人简介

http://blog.chinaunix.net/uid/16979052.html

文章分类

全部博文(286)

文章存档

2018年(1)

2017年(16)

2016年(9)

2015年(17)

2014年(15)

2013年(112)

2012年(116)

分类: LINUX

2012-06-27 10:48:23

#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);
}
}
}

阅读(1544) | 评论(0) | 转发(0) |
0

上一篇:boot/entry32.S

下一篇:单网卡绑定多MAC

给主人留下些什么吧!~~