Linux0.01版本源代码-main.c程序说明-主程序解释说明

Linux0.01版本-main.c主程序说明

Linux0.01版本源代码

还没有 Linux0.01 版本源代码的小伙伴可以在这里获取:Linux0.01版本源代码,提取码:r0nx。

核心函数解释说明

主程序 main.c 在最外层目录的 init 文件夹中。

void main(void)		/* This really IS void, no error here. */
{			/* The startup routine assumes (well, ...) this */
/*
 * Interrupts are still disabled. Do necessary setups, then
 * enable them
 */
	time_init(); //读取 CMOS 数据,初始化系统时间
	tty_init(); //初始化 tty 子系统
	trap_init(); //陷阱门(硬件中断向量)初始化
	sched_init(); //调度程序初始化
	buffer_init(); //缓冲管理初始化(初始化系统块设备缓冲区)
	hd_init(); //初始化硬盘中断处理程序
	sti(); //所有初始化工作完成,开启中断
	move_to_user_mode(); //转入用户模式
	if (!fork()) {		/* we count on this going ok */
		init();
	}
/*
 * NOTE!!   For any other task 'pause()' would mean we have to get a
 * signal to awaken, but task0 is the sole exception (see 'schedule()')
 * as task 0 gets activated at every idle moment (when no other tasks
 * can run). For task0 'pause()' just means we go check if some other
 * task can run, and if not we return here.
 */
	for(;;) pause();
}
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值