You are on page 1of 80

「節能減碳新主張」Linux 研討會

有了 Embedded,
生活更 Easy!!
陳永昇 (Cd Chen)
cd_chen@uuu.com.tw
精誠資訊 恆逸資訊 資深講師
陳永昇 (Cd Chen)
‣精誠資訊 恆逸教育訓練中心 資深講師
‣證照:
‣RHCT/RHCE/RHCX
‣MCP/MCSA/MCSE/MCDST
‣LPIC/NCLP/TCSE
‣著作:
‣企業級 Linux 使用寶典
‣企業級 Linux 系統管理寶典
‣Red Hat Enterprise Linux 系統管理寶典
Embedded
System
?
Embedded
System
?
Embedded
System
“ An embedded system is a special-purpose
computer system designed to perform one
or a few dedicated functions,
often with real-time computing constraints. “
- Wikipedia.
電信 監控
設備 設備
遊戲機 提款機

行動電 網路
話 設備

機上盒
Embedded 列印
System 裝置

儲存
PDA
裝置

數位 資訊
手錶 家電
測試 醫療
裝置 儀器
案例
架構
Normal Linux Embedded Linux

CPU
‣快 ‣慢
‣可更換 ‣無法更換
RAM
‣大 ‣小
‣可擴充 ‣無法擴充
‣HDD、DVD、... ‣Flash ROM
Storage ‣大 ‣小,甚至沒有
‣可擴充與更換 ‣無法擴充

Others ‣可更換或擴充 ‣無法更換


Normal Linux
應用軟體 httpd、ssh、X、mplayer、...

基礎程式 coreutils、glibc、bash、...

核心 Huge Kernel & Drivers

硬體平台 CPU、RAM、Storage、NIC、...
Embedded Linux
應用軟體 httpd、ssh、NanoX、mplayer、...

基礎程式 BusyBox、ucLibc、Newlib、...

核心 Small Kernel & Drivers

硬體平台 CPU、RAM、Storage、NIC、...
展示 Ⅰ
利用 GeeXboX 建構家庭劇院電腦 (HTPC)
原理
Normal Linux 啟動流程

S
Normal Linux 啟動流程

Boot
S BIOS
Loader
Kernel init

rc Scripts

E
Normal Linux 啟動流程

Boot
S BIOS
Loader
Kernel init

rc Scripts

E
Normal Linux 啟動流程

Boot
S BIOS
Loader
Kernel init

rc Scripts
BIOS 負責:
1.偵測硬體設備
2.執行 Boot Loader E
Normal Linux 啟動流程

Boot
S BIOS
Loader
Kernel init

rc Scripts
BIOS 負責: Boot Loader 負責:
1.偵測硬體設備 1.載入核心
2.執行 Boot Loader E
2.掛載 INITRD 成為根檔案系統
Normal Linux 啟動流程

Boot
S BIOS
Loader
Kernel init

rc Scripts

E
Normal Linux 啟動流程
儲存於根檔案系統上

Boot
S BIOS
Loader
Kernel init

rc Scripts

E
Normal Linux 啟動流程
儲存於根檔案系統上

Boot
S BIOS
Loader
Kernel init

為了能順利執行 init,Kernel 會: rc Scripts

E
Normal Linux 啟動流程
儲存於根檔案系統上

Boot
S BIOS
Loader
Kernel init

為了能順利執行 init,Kernel 會: rc Scripts


1.載入儲存於 INITRD 中必要的驅動程式

E
Normal Linux 啟動流程
儲存於根檔案系統上

Boot
S BIOS
Loader
Kernel init

為了能順利執行 init,Kernel 會: rc Scripts


1.載入儲存於 INITRD 中必要的驅動程式
2.掛載真正的根檔案系統
E
Normal Linux 啟動流程
儲存於根檔案系統上

Boot
S BIOS
Loader
Kernel init

為了能順利執行 init,Kernel 會: rc Scripts


1.載入儲存於 INITRD 中必要的驅動程式
2.掛載真正的根檔案系統
3.卸載 INITRD 的檔案系統 (Optional) E
Embedded Linux 啟動流程

Boot
S BIOS
Loader
Kernel init

rc Scripts

E
Embedded Linux 啟動流程

Boot
S BIOS
Loader
Kernel init

Application
rc Scripts

E
Embedded Linux 啟動流程

Boot
S BIOS
Loader
Kernel init

Application
可能會由 Embedded System
硬體平台直接實作其功能
E
Embedded Linux 啟動流程

Boot
S BIOS
Loader
Kernel init

Application

E
Embedded Linux 啟動流程

Boot
S BIOS
Loader
Kernel init

Application

E
Embedded Linux 啟動流程

Boot
S BIOS
Loader
Kernel init

將所有必要的驅動程式 Application
直接編譯進 Kernel Image
E
Embedded Linux 啟動流程

Boot
S BIOS
Loader
Kernel init

將所有必要的驅動程式 Application
直接編譯進 Kernel Image
E
1.初始化系統環境
2.直接啟動 Application
有可能更名為 linuxrc
展示 Ⅱ
拆解 GeeXboX 之 USB Linux
Tea Time!
開發
源碼與編譯
程式語言:多半使用 C/C++ 開發應用軟體
編譯:產生二進位執行檔
跨平台編譯:產生嵌入式系統之執行檔
ARM Binary
Source Code 010101110 11001010
int main(int argc, 100100110 00010101
const char *argv[], ...
const char *env[]) {

printf(“Hello World!!\n”); gcc


return 0;
MIPS Binary
} 110010001 10011110
100110000 00110111
...
應用軟體

程式庫

核心與驅動程式
Top-Down 應用軟體

程式庫

核心與驅動程式 Bottom-Up
開發環境
uClinux - http://www.uclinux.org/
OpenEmbedded - http://www.openembedded.org/
MiniDoochun - http://minidoochun.openfoundry.org/
...
模擬器
項目 官網 模擬平台

PearPC http://pearpc.sf.net/ ‣PowerPC


SkyEye http://www.skyeye.org/ ‣ARM

‣x86 32bit
‣x86 64bit
QEMU http://www.qemu.org/ ‣MIPS
‣SPARC
‣PowerPC
解決方案
C 程式庫
uCibc
http://www.uclibc.org/
dietlibc
http://www.fefe.de/dietlibc/
Newlib
http://www.sourceware.org/newlib/
基礎環境
使用原始套件
優點:功能較完善
缺點:需自己整合、體積較大
BusyBox (http://www.busybox.net/)
優點:快速、體積小
缺點:功能較少
圖形介面
Nano-X Window System (Aka. MicroWindows)
http://www.microwindows.org/
Qtopia - http://trolltech.com/products/qtopia
MiniGUI - http://www.minigui.org/
OpenGUI - http://sourceforge.net/projects/opengui/
其他...
OPIE - http://opie.handhelds.org/
OpenMoko - http://www.openmoko.org/
Maemo - http://www.maemo.org/
OpenWRT - http://openwrt.org/
FREESCO - http://www.freesco.org/index.php
GPE - http://gpe.handhelds.org/
...
OPIE Screenshot -
About Screen
OPIE Screenshot -
Appearance Settings
OPIE Screenshot -
Calendar
OPIE Screenshot -
Contacts
OPIE Screenshot -
Games Screen
OPIE Screenshot -
Todo List
OPIE Screenshot -
Console
展示 Ⅲ
使用 uClinux 配合 ARM 模擬器開發軟體
學習
操作

開發 整合
操作
RHCE 課程
開發 整合 RH033
基本操作與使用
RH133
基礎系統管理
RH253
網路服務與
整合
嵌入式系統
開發
整合
課程編號:URH073
從大到小逐步實做嵌入式系統
Live-CD
USB-Key
ARM 模擬器
NetStar! 開發版 (ARM7)
整合
Linux 程式開發
開發 開發
Linux 系統程式開發
核心開發
Linux 應用軟體開發
PHP/MySQL
Sqlite
Embedded GTK
Qt/Embedded、Qtopia
結論
Q
A
&
Thanks!

You might also like