2009年4月16日 星期四

101.1 Determine and configure hardware settings 硬體設定的確認與組態

101.1 Determine and configure hardware settings 硬體設定的確認與組態
Weight 2
Description Candidates should be able to determine and configure fundamental system hardware.
Key Knowledge Areas
‧ Enable and disable integrated peripherals(外部設備).
‧ Configure systems with or without external peripherals such as keyboards.
‧ Differentiate between the various types of mass storage devices.
‧ Set the correct hardware ID for different devices, especially the boot device.
‧ Know the differences between coldplug and hotplug devices.
‧ Determine hardware resources for devices.
‧ Tools and utilities to list various hardware information (e.g. lsusb, lspci, etc.)
‧ Tools and utilities to manipulate USB devices
‧ Conceptual understanding of sysfs, udev, hald, dbus
sysfs - get file system type informaton
http://www.redhat.com/docs/manuals/enterprise/RHEL-5-manual/zh-TW/Installation_Guide/s1-s390info-sysfs.html
Linux 2.6 核心加入了 sysfs 檔案系統,它可說是proc、devfs、與 devpty 的集合。
sysfs 檔案系統列舉了連到系統的裝置與匯流排,整合到一個階層性的檔案系統下,
可以從 user space(使用者空間)存取。sysfs 檔案系統用來處理之前位於 /proc/
目錄中的裝置與驅動程式特定選項,同時包括了之前 devfs 所提供的動態裝置功能。
早期的 sysfs 中,許多驅動程式與工具程式還使用較老的 proc 項目;但可以確知的
是,將來會走向 sysfs。sysfs 檔案系統掛載在 /sys/ 之下,其中的目錄將連接到系
統的裝置分成多種項目並安裝在 /sysfs/ 子目錄下。


udev (dynamic device management) hald dbus
http://blog.csdn.net/colorant/archive/2008/07/04/2611559.aspx
http://mkl-note.blogspot.com/2008/03/hal-d-bus-udev.html
1. Linux 2.6 kernel 包含 hotplug,來判斷硬體的插入、移除。

2. Linux OS 透過 udev 來搭配 hotplug,專門維護 /dev 下的 device file,
這也就是我之前在摩托學園發的問題的所在點,它會動態的建立出各種裝置的 device file。

3. Linux OS 透過 D-BUS 來轉發系統訊息,告知 HAL 硬體的插入、拔出動作。

4. HAL 則呼叫相對應的應用程式來執行相對應的操作。

整個 auto mount 或 auto umount 就是上述的流程,實際上 HAL 還是一組 library,
除非應用程式以 HAL 的 library 來開發,否則應用程式通常無法直接收到 HAL 的消息,
簡單的說,HAL 還太低階,雖然他能夠直接操作特定的系統消息(像 DVD影片 插入時),
但彈性不足(設定煩雜,不容易設定、修改),因此通常還需要一個 manager 來進行真正的
HAL 操作。 這在 GNOME 就是 Gnome Volume Manager。

將整個堆疊以文字分層來表示,大致如下:

GNOME Volume Manager
HAL(Hardware Abstraction Layer)
D-Bus
udev
kernel hotplug

The following is a partial list of the used files, terms and utilities:
‧ /sys

‧ /proc
‧ /dev
‧ modprobe
‧ lsmod
‧ lspci
‧ lsusb

沒有留言: