<!-- /* Font Definitions */ @font-face {font-family:"MS 明朝"; panose-1:2 2 6 9 4 2 5 8 3 4; mso-font-alt:"MS Mincho"; mso-font-charset:128; mso-generic-font-family:roman; mso-font-pitch:fixed; mso-font-signature:-536870145 1791491579 18 0 131231 0;} @font-face {font-family:SimSun; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:宋体; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 680460288 22 0 262145 0;} @font-face {font-family:Century; panose-1:2 4 6 4 5 5 5 2 3 4; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:647 0 0 0 159 0;} @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:"/@SimSun"; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 680460288 22 0 262145 0;} @font-face {font-family:"/@MS 明朝"; panose-1:2 2 6 9 4 2 5 8 3 4; mso-font-charset:128; mso-generic-font-family:roman; mso-font-pitch:fixed; mso-font-signature:-536870145 1791491579 18 0 131231 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0mm; margin-bottom:.0001pt; text-align:justify; text-justify:inter-ideograph; mso-pagination:none; font-size:10.5pt; mso-bidi-font-size:11.0pt; font-family:"Century","serif"; mso-fareast-font-family:"MS 明朝"; mso-bidi-font-family:"Times New Roman"; mso-font-kerning:1.0pt;} p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {mso-style-priority:34; mso-style-unhide:no; mso-style-qformat:yes; margin-top:0mm; margin-right:0mm; margin-bottom:0mm; margin-left:42.0pt; margin-bottom:.0001pt; mso-para-margin-top:0mm; mso-para-margin-right:0mm; mso-para-margin-bottom:0mm; mso-para-margin-left:4.0gd; mso-para-margin-bottom:.0001pt; text-align:justify; text-justify:inter-ideograph; mso-pagination:none; font-size:10.5pt; mso-bidi-font-size:11.0pt; font-family:"Century","serif"; mso-fareast-font-family:"MS 明朝"; mso-bidi-font-family:"Times New Roman"; mso-font-kerning:1.0pt;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:10.0pt; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt; mso-ascii-font-family:Century; mso-fareast-font-family:"MS 明朝"; mso-hansi-font-family:Century; mso-font-kerning:0pt;} /* Page Definitions */ @page {mso-page-border-surround-header:no; mso-page-border-surround-footer:no;} @page Section1 {size:595.3pt 841.9pt; margin:99.25pt 30.0mm 30.0mm 30.0mm; mso-header-margin:42.55pt; mso-footer-margin:49.6pt; mso-paper-source:0; layout-grid:18.0pt;} div.Section1 {page:Section1;} /* List Definitions */ @list l0 {mso-list-id:809130965; mso-list-type:hybrid; mso-list-template-ids:-1650280476 -1720022196 67698711 67698705 67698703 67698711 67698705 67698703 67698711 67698705;} @list l0:level1 {mso-level-number-format:decimal-enclosed-circle; mso-level-text:%1; mso-level-tab-stop:none; mso-level-number-position:left; margin-left:39.0pt; text-indent:-18.0pt;} @list l1 {mso-list-id:1591936008; mso-list-type:hybrid; mso-list-template-ids:-1600850506 1018838600 -11907436 67698705 67698703 67698711 67698705 67698703 67698711 67698705;} @list l1:level1 {mso-level-number-format:japanese-counting; mso-level-text:%1、; mso-level-tab-stop:none; mso-level-number-position:left; margin-left:21.0pt; text-indent:-21.0pt; mso-ansi-language:EN-US;} @list l1:level2 {mso-level-number-format:decimal-enclosed-circle; mso-level-text:%2; mso-level-tab-stop:none; mso-level-number-position:left; margin-left:39.0pt; text-indent:-18.0pt;} @list l2 {mso-list-id:2087922433; mso-list-type:hybrid; mso-list-template-ids:1734221212 1831100770 67698711 67698705 67698703 67698711 67698705 67698703 67698711 67698705;} @list l2:level1 {mso-level-text:%1、; mso-level-tab-stop:none; mso-level-number-position:left; margin-left:39.0pt; text-indent:-18.0pt;} ol {margin-bottom:0mm;} ul {margin-bottom:0mm;} -->
一、 系统启动
系统启动时会将 CPU 重置 (Reset) ,被重置后 CPU 会执行重置 Vector 中的代码。在 X86 平台中通常都是 BIOS ,在其他平台上可以使 ROM 或直接跳至 IPL 。 BIOS 或 ROM 执行后通常跳至 IPL(Initial Program Load) 。 IPL 将启动镜像复制到内存中,并跳至启动 (Startup) 。启动代码会初始化硬件,并为内核的启动收集硬件信息。然后加载并启动 procnto( 内核和进程管理器 ) 。 IPL 和 startup 通常都是 BSP(Board Support Package) 的一部分。 Procnto 启动后会执行启动脚本 (boot script) ,启动脚本控制具体的执行环境和第三方程序的启动。
二、 加载 Neutrino 镜像
当选择了一个 QNX 的分区汇, Boot Loader(OS Loader) 会启动并加载系统的核心。它是预付有文件系统的类型的。
1、 Power-safe 文件系统
Power-safe 文件系统中的 Boot Loader 会确认文件系统,并查找 .boot 目录下的所有可用的系统核心文件。如果 .boot 目录下只有一个可用的核心文件,就会立即加载这个核心,否则的回就会等个 3 、 4 秒让选择合适的核心文件。
可以通过命令 [mkqnx6fs -B] 来更新分区中的 Boot Loader ,而不影响分区中的其他内容。如果一个 512byte 块的分区不能作为启动分区,因为他的 Boot Loader 只有 128KB 。而一个 1KB 块 ( 默认 ) 它的 Boot Loader 最大可以 1GB 。
2、 QNX4 文件系统
QNX4 文件系统在启动的时候会显示 [Hit Esc for .altboot] ,如果让它超时,加载器就会加载 /.boot ,如果输入 Escape 就会加载 /.altboot 。这两个核心的区别是 /.boot 以 DMA 模式加载,而 /.altboot 不是。
三、 Diskboot
diskboot 的作用
① 启动 slogger
② 启动 seedres 来读取 PnP BIOS 并且填充 procnto 的 资源数据
③ 启动 pci-bios 来支持 PCI BIOS
④ 启动 devb-eide 或其他磁盘驱动
⑤ 查询需要 mount 的文件系统
⑥ 可选:其松 fesh[Fat embedded shell]
⑦ 启动控制台驱动 [devc-con-hid] 或 [devc-con]
⑧ 最后执行 /etc/system/sysinit
1 、 /etc/system/sysinit
/etc/system/sysinit 文件是启动整个系统服务的脚本文件。它负责启动:
① 如果 slogger 没有启动,就启动 slogger
② 启动 pipe 。
③ 启动 mqueue
④ 如果是安装后的第一次启动就会执行 /etc/rc.d/rc.setup-once ,它会创建目录和 swap 文件
⑤ 根据 /etc/TIMEZONE 设定时区。
⑥ 如果 /etc/rc.d/rc.rtc 存在并能够执行,就执行它来设定时间 (realtime clock)
⑦ 设定主机名 (HostName) 。通常从 hostname 命令中取得主机名,如果 不成功会从 /etc/HOSTNAME 中加载
⑧ 根据 /etc/rc.d/rc.devices 来遍历设备,并加载相应驱动
⑨ 如果 /etc/system/config/useqnet 存在并且 io-pkt 已经运行,就配置网络环境
⑩ 执行启动脚本 /etc/rc.d/rc.sysinit
⑪ 如果启动失败 sysinit 就会试图启动一个 sh ,如果再失败就会试图启动一个 fesh
四、 设备遍历 [Device enumeration]
QNX 会通过 /etc/rc.d/rc.devices 脚本来启动 enum-devices( 设备管理器 ) ,来加载所有已知设备并启动对应驱动。
五、
六、
七、