加入收藏 | 设为首页 | 会员中心 | 我要投稿 网站开发网_安阳站长网 (https://www.0372zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长百科 > 正文

深度解析Linux根文件系统的挂载过程

发布时间:2020-12-30 22:41:23 所属栏目:站长百科 来源:网络整理
导读:副标题#e# 《深度解析Linux根文件系统的挂载过程》要点: 本文介绍了深度解析Linux根文件系统的挂载过程,希望对您有用。如果有疑问,可以联系我们。 在前面的文章中介绍《Linux操作系统启动过程》,而Linux系统的根文件系统(root file system)的挂载过程则

real_root_dev = new_encode_dev(ROOT_DEV);
create_dev("/dev/root.old",Root_RAM0);
/* mount initrd on rootfs’ /root */
mount_block_root("/dev/root.old",root_mountflags & ~MS_RDONLY);
sys_mkdir("/old",0700);
root_fd = sys_open("/",0);
old_fd = sys_open("/old",0);
/* move initrd over / and chdir/chroot in initrd root */
sys_chdir("/root");
sys_mount(".",NULL);
sys_chroot(".");

/*
* In case that a resume from disk is carried out by linuxrc or one of
* its children,we need to tell the freezer not to wait for us.
*/
current->flags |= PF_FREEZER_SKIP;

pid = kernel_thread(do_linuxrc,"/linuxrc",SIGCHLD);
if (pid > 0)
while (pid != sys_wait4(-1,NULL))
yield();

current->flags &= ~PF_FREEZER_SKIP;

(编辑:网站开发网_安阳站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!