当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

中国科学技术大学:《嵌入式操作系统 Embedded Operating Systems》课程教学资源(课件讲义)Ubuntu中的系统初始化

资源类别:文库,文档格式:PDF,文档页数:25,文件大小:208.26KB,团购合买
点击下载完整版文档(PDF)

嵌入式操作系统 7 Ubuntu中的系统初始化 陈香兰(xlanchenc@ustc.edu.cn) 计算机应用教研室。计算机学院 嵌入式系统实验室●苏州研究院 中国科学技术大学 Fa112014 December 9,2014 1口401是42在刀00 陈香兰(xlanchenoustc,edu,cn)(升界款应 长人式操作系统 December 9.2014 1 /29

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 嵌入式操作系统 7 Ubuntu中的系统初始化 陈香兰(xlanchen@ustc.edu.cn) 计算机应用教研室@计算机学院 嵌入式系统实验室@苏州研究院 中国科学技术大学 Fall 2014 December 9, 2014 陈香兰(xlanchen@ustc.edu.cn) (计算机应用教研室@计算机学院嵌入式系统实验室 嵌入式操作系统 @苏州研究院中国科学技术大学Fall 2014) December 9, 2014 1 / 29

Outline 概述 ② Upstart简介 ®小结 4口4四1是4P在刀0C 陈香兰(xlanchenoustc,edu,cn)(计界轧应 长人式样饰系统 December 9.2014 2 /29

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Outline 1. 概述 .2 Upstart简介 .3 小结 陈香兰(xlanchen@ustc.edu.cn) (计算机应用教研室@计算机学院嵌入式系统实验室 嵌入式操作系统 @苏州研究院中国科学技术大学Fall 2014) December 9, 2014 2 / 29

Ubuntu的init系统历史变迁 ●Ubuntu是Debian的下游版本o 。Liux发行版在内核启动之后,都需要启动一个 init进程(1号进程)】 ①System-V init,又写作sysvinit Upstart http://upstart.ubuntu.com event-based init daemon ubuntu-6.l0开始逐步用upstart代替原来的System-V init Systemd https://wiki.ubuntu.com/systemd 根据目前了解的信息 0 ubuntu-15.04将正式开始 ©ubunut-14.10已经可以安装,待完善o 4口4四是4P在刀00 陈香兰(xlanchenoustc,ed加,cn)(升异数应 瓷人式操作委蛇 Dece0er9.20144/29

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ubuntu的init系统历史变迁 Ubuntu是Debian的下游版本。 Linux发行版在内核启动之后,都需要启动一个 init进程(1号进程) 1. System-V init,又写作sysvinit 2. Upstart:http://upstart.ubuntu.com event-based init daemon ubuntu-6.10开始逐步用upstart代替原来的System-V init 3. Systemd:https://wiki.ubuntu.com/systemd 根据目前了解的信息 1. ubuntu-15.04将正式开始 2. ubunut-14.10已经可以安装,待完善。 陈香兰(xlanchen@ustc.edu.cn) (计算机应用教研室@计算机学院嵌入式系统实验室 嵌入式操作系统 @苏州研究院中国科学技术大学Fall 2014) December 9, 2014 4 / 29

Outline 桃递 ② Upstart简介 @小结 4口4四1是4P刀00 陈香兰(xlanchenoustc,edu,cn)(计界轧应 长人式样饰系统 December 9.2014 5 /29

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Outline . 1. 概述 .2 Upstart简介 .3 小结 陈香兰(xlanchen@ustc.edu.cn) (计算机应用教研室@计算机学院嵌入式系统实验室 嵌入式操作系统 @苏州研究院中国科学技术大学Fall 2014) December 9, 2014 5 / 29

upstart ●Upstart is an event-based(基于事件的)replacement for the /sbin/init daemon which handles starting of tasks and services during boot, stopping them during shutdown and O supervising them while the system is running. o In essence,Upstart is an event engine:it O creates events, handles the consequences of those events being emitted and O starts and stops processes as required. 。关于Upstart的详细介绍, 参见http://upstart.ubuntu.com/cookbook/,或者 参见/usr/shard/,doc/upstart下的README(需要解压缩),或者 使用下列命令可以查看upstart和init相关信息 man init 或者 man upstart o Ubuntu-14.04 upstart-1.12.1 4口4四是4P在刀0C 东香兰(xlanchenoustc,edu.cn)(计年丸应 长人式控作系蛇 December 9.2014 6/29

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . upstart Upstart is an event-based(基于事件的) replacement for the /sbin/init daemon which handles 1. starting of tasks and services during boot, 2. stopping them during shutdown and 3. supervising them while the system is running. In essence, Upstart is an event engine: it 1. creates events, 2. handles the consequences of those events being emitted and 3. starts and stops processes as required. 关于Upstart的详细介绍, 参见http://upstart.ubuntu.com/cookbook/,或者 参见/usr/shard/doc/upstart下的README(需要解压缩),或者 使用下列命令可以查看upstart和init相关信息 man init 或者 man upstart Ubuntu-14.04:upstart-1.12.1 陈香兰(xlanchen@ustc.edu.cn) (计算机应用教研室@计算机学院嵌入式系统实验室 嵌入式操作系统 @苏州研究院中国科学技术大学Fall 2014) December 9, 2014 6 / 29

阅读upstart的README 。/usr/shard/doc/upstart下的README(需要解压缩) O Where are initscripts installed? How are initscripts started and stopped? O What order are initscripts started and stopped in? O How do I find the current/previous runlevel? 运行runlevel命令 运行man runlevel How do I change the runlevel? How do I change the default runlevel? How do I shutdown the machine? O How do I change the behaviour of Control-Alt-Delete? 4口4四1是4P,刀00 练奇兰(xlancher南uste,ed加,cn)(升界丸应 瓷人式操作委蛇 December 9.2014 7 29

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 阅读upstart的README /usr/shard/doc/upstart下的README(需要解压缩) 1. Where are initscripts installed? 2. How are initscripts started and stopped? 3. What order are initscripts started and stopped in? 4. How do I find the current/previous runlevel? ▶ 运行runlevel命令 ▶ 运行man runlevel 5. How do I change the runlevel? 6. How do I change the default runlevel? 7. How do I shutdown the machine? 8. How do I change the behaviour of Control-Alt-Delete? 9. ... 陈香兰(xlanchen@ustc.edu.cn) (计算机应用教研室@计算机学院嵌入式系统实验室 嵌入式操作系统 @苏州研究院中国科学技术大学Fall 2014) December 9, 2014 7 / 29

阅读upstart帮助信息I man upstart ●关于init init is the parent of all processes on the system,it is executed by the kernel and is responsible for starting all other processes;it is the parent of all processes whose natural parents have died and it is responsible for reaping those when they die. 。关于job Processes managed by init are known as jobs and are defined by files in the /etc/init directory. job与job配置文件 o关于事件event ·job会因为事件的发生而自动的start.或者stop(根据其配置文件) 4口4四¥是42在刀00 陈香兰(xlanchenoustc,ed加,cn)(升异数应 长人式择作系统 Dece0er9.20148/29

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 阅读upstart帮助信息 I man upstart 关于init ▶ init is the parent of all processes on the system, it is executed by the kernel and is responsible for starting all other processes; it is the parent of all processes whose natural parents have died and it is responsible for reaping those when they die. 关于job ▶ Processes managed by init are known as jobs and are defined by files in the /etc/init directory. ▶ job与job配置文件 关于事件event ▶ job会因为事件的发生而自动的start或者stop (根据其配置文件) 陈香兰(xlanchen@ustc.edu.cn) (计算机应用教研室@计算机学院嵌入式系统实验室 嵌入式操作系统 @苏州研究院中国科学技术大学Fall 2014) December 9, 2014 8 / 29

阅读upstart帮助信息II ·关键的几个事件 ,startup事件 ★由init产生 starting~started、stopping、stopped事件 ★产生:随着job状态的改变 oJob的状态和lifecycle(参见man upstart) 4口4四1是42刀00 陈香兰(xlanchenoustc,edu,cn)(升界丸应 长人式操作系统 December9.20149/29

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 阅读upstart帮助信息 II 关键的几个事件 ▶ startup事件 ⋆ 由init产生 ▶ starting、started、stopping、stopped事件 ⋆ 产生:随着job状态的改变 Job的状态和lifecycle(参见man upstart) 陈香兰(xlanchen@ustc.edu.cn) (计算机应用教研室@计算机学院嵌入式系统实验室 嵌入式操作系统 @苏州研究院中国科学技术大学Fall 2014) December 9, 2014 9 / 29

Upstart中的事件 。Init即Upstart,是一个基于事件的守护进程 ●事件代表系统状态的变化,产生的事件会发送给init进程 ·job的状态也是系统状态,因此job状态的变化会产生相关事件 。事件可以带参数,如runlevel事件 ●job的配置文件中,列出了job启动、停止的条件, 这些条件与事件有关 ●job在运行时,可能会根据需要触发某些事件 (具体参见相关配置文件) 1口4¥是4P在刀00 陈香兰(xlanchenoustc,edu,cn)(升界丸应 长人式操作香统 December 9.2014 10 /29

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Upstart中的事件 Init即Upstart,是一个基于事件的守护进程 事件代表系统状态的变化,产生的事件会发送给init进程 ▶ job的状态也是系统状态,因此job状态的变化会产生相关事件 事件可以带参数,如runlevel事件 job的配置文件中,列出了job启动、停止的条件, 这些条件与事件有关 job在运行时,可能会根据需要触发某些事件 (具体参见相关配置文件) 陈香兰(xlanchen@ustc.edu.cn) (计算机应用教研室@计算机学院嵌入式系统实验室 嵌入式操作系统 @苏州研究院中国科学技术大学Fall 2014) December 9, 2014 10 / 29

Upstart中的job及其配置文件I 。一个job由其job配置文件定义: .conf 。Job的状态(参见man upstart) Goal 序号 当前状态 start stop 1 waiting starting n/a 2 starting pre-start stoping 2 pre-start spawned stopping spawned post-start stopping 5 post-start running stopping 6 running stoping stopping 7 pre-stop running pre-stop/stopping(◆)】 8 stopping killed killed 9 killed post-stop post-stop 0 post-stop starting waiting 0是42刀00 陈香兰(xlancheroustc,edu,cn) (计算机回 长人式操作系线 December9,201411/29

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Upstart中的job及其配置文件 I 一个job由其job配置文件定义: .conf Job的状态(参见man upstart) 序号 当前状态 Goal start stop 1 waiting starting n/a 2 starting pre-start stoping 3 pre-start spawned stopping 4 spawned post-start stopping 5 post-start running stopping 6 running stoping stopping 7 pre-stop running pre-stop/stopping(*) 8 stopping killed killed 9 killed post-stop post-stop 0 post-stop starting waiting 陈香兰(xlanchen@ustc.edu.cn) (计算机应用教研室@计算机学院嵌入式系统实验室 嵌入式操作系统 @苏州研究院中国科学技术大学Fall 2014) December 9, 2014 11 / 29

点击下载完整版文档(PDF)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
共25页,试读已结束,阅读完整版请下载
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有