1 / 11

開機程序

開機程序. 載入開機磁區 載入核心 硬體裝置驅動程式初始化 載入 Linux 服務 -init 程序 關機相關訊息同時寫到螢幕以及 /var/log/messages dmesg. BIOS. LILO/GRUB. KERNEL. 讀取 /etc/inittab 檔 執行 /etc/rc.d/rc.sysinit, /etc/rc.d/rc, /etc/rc.local. init. 在文字模式下 , 執行 mingetty 顯示 login 畫面. mingetty. xdm. 進入 X window 的 login 畫面.

brendy
Download Presentation

開機程序

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 開機程序 • 載入開機磁區 • 載入核心 • 硬體裝置驅動程式初始化 • 載入Linux服務-init程序 • 關機相關訊息同時寫到螢幕以及/var/log/messages • dmesg

  2. BIOS LILO/GRUB KERNEL 讀取/etc/inittab檔 執行/etc/rc.d/rc.sysinit, /etc/rc.d/rc, /etc/rc.local init 在文字模式下,執行mingetty顯示login 畫面 mingetty xdm 進入X window的 login畫面 啟動使用者的shell 執行/etc/profile, /etc/bashrc $HOME/.bash_profile $HOME/.bashrc 依/etc/passwd與 /etc/shadow檔判 繼使用者的合法性 login shell logout Linux啟動流程

  3. 硬體裝置驅動程式初始化 • 核心版本 Linux version 2.4.7-10 • 控制台初始化 Console: colour VGA+ 80 x 25 • 速率指標及記憶體計算 BogoMIPS Memory • CPU檢視 • 匯流排的初始化及偵測 • TCP/IP初始化 NT4:Linux TCP/IP… • 序列埠的初始化 • 磁碟機的初始化

  4. 載入Linux服務-init程序 • init是kernel在啟動時第一個執行的process • PID是1,是所有porcess的parents • 讀取/etc/inittab • 系統初始化執行/etc/rc.d/rc.sysinit • 執行/etc/rc.d /rc以執行預設的run level裏所有的scripts • rc.local

  5. /etc/rc.d/sysinit • init在起始時第一個執行的檔案 • 執行許多功能 • 初始化swap空間 • 設定系統變數 • 檢查檔案系統 • 設定使用者硬碟空間 • mount /proc檔案系統

  6. /etc/rc.d/rc • 這一個shell script會負責將系統轉換到不同的run level • 它會接受一個數字的參數,該數用來指定新的run level

  7. /etc/rc.d/rc.local • 會在所有其他開機script都執行完畢後再執行 • 若你新增3rd party軟體,可以將開啟程式碼置於rc.local中 • 若要設定系統某個程式在每一次開機時自動執行,就設定在這個檔裏,例如要每次開機時均自動執行quota可加入 quotaon –avug echo ‘quota is running’

  8. 關機 • 重新開機 shutdown –r now • 傳送關機訊息(11分鐘後重開機) shutdown –r + 11 The system will be reset ! • 下午5:00關機 shutdown –h 17:00

  9. reboot • 讓系統停止運作,並重新開機

  10. halt • 關閉系統 • 先偵測系統的run level,若run level不為0或6,則關閉系統,否則即呼叫shudown 來關閉系統 • 關閉系統並關閉電源 halt -p

  11. sync • 將記憶體緩衝區內的資料寫入磁碟

More Related