linux-0.11调试教程,task3(01),/etc/rc文件

来源:互联网 发布:东方财富for mac 编辑:程序博客网 时间:2024/06/04 08:36

init/main.c相关代码:

   if (!(pid=fork())) {
        close(0);
        if (open("/etc/rc",O_RDONLY,0))
            _exit(1);
        execve("/bin/sh",argv_rc,envp_rc);
        _exit(2);
    }


/etc/rc文件内容:


/etc/update &
echo "/dev/hd1 /" > /etc/mtab
echo " Ok. "




/etc/update的作用是每隔30秒调用sync()一次,既刷新一次。

原创粉丝点击