Transcript 投影片 1

嵌入式系統
Embedded system
1
Application of Embedded System

On Potable / PDA Solution
2
Application of Embedded System

On Potable / PDA & Smartphone Solution
3
Introduce
Embedded OS
4
Embedded OS Introduction(1)

Windows CE
 Microsoft
 Support
CPU: x86, ARM, MIPS, …etc
 Windows CE Platform Builder
 eVC, eVB
 Friendly GUI
 Application: PDA, WebPAD, PVR, Thin
Client, …etc
5
Embedded OS Introduction(2)

DOS
 Microsoft
 16
bits, single user single task
 Application: LED billboard, industry control
6
Embedded OS Introduction(3)

Palm OS
 Palm
Computing
 Succinct architecture
 Small hardware
requirement
 low-power
 Application: PDA
7
Embedded OS Introduction(4)

VxWorks
 WindRiver
 Support CPU: x86, i960, MIPS, PowerPC
 Popularly use in embedded systems
 GNU compiler and debugger
 Hard
real time
 It’s famous to apply to robot on Mars and Sony robot

MicroC/OS
 Hard
real time
8
Embedded OS Introduction(5)

Symbian
 The
mobile operating
system
 Friendly GUI
 Development with Microsoft
Virtual C++ 6.0 and S60
(SDK)
 The main competitor is
Windows
9
Embedded OS Introduction(6)

Linux
 Support
CPU: x86, ARM, MIPS, SH, i960,
PowerPC, …etc
 Open Source
 Powerful Network Functions
 Easy Software Porting
 GNU Complier and Debugger
10
Embedded
Systems
Development
11
Cross-Development Environment


Target has limited resource (memory, storage, low speed
processor) .
Host and Target are different architecture
Host
Target
Cross-platform
Development
Environment
•Bootloader
•Kernel
•Root Filesystem
12
Hardware Connection
13
Linux Architecture
hardware
Linux
Kernel
Bash Shell
Applications
14
Linux Architecture
Applications
Java
GUI
GLIBC
Other Libraries
Kernel System Call Interface
File System
Bootloader
Protocol Stacks
Drivers
Kernel
Hardware
15
All the things we need


Cross-Platform development toolchain
Bootloader


Linux kernel


Provide by vendor
Linux kernel + some patches if needed
Filesystem

Busybox

Device node

Configuration
16
The Bootloader's Job
One main mission: load the operating system(s). Tasks:
 Initialize the machine properly (the kernel can do part of
this later too).
 Access the kernel and initrd files in their storage
medium (need to support the corresponding filesystem
too)
 Because of the above 2 tasks, bootloaders are often
platform specific!
 Load the kernel and initrd files
 Execute the kernel file with the right command line
17
bootloader
18
Some Bootloaders

LILO: LInux LOad. Original Linux bootloader. Still in use!

http://freshmeat.net/projects/lilo/
 Supports: x86

GRUB: GRand Unified Bootloader from GNU. More powerful.

http://www.gnu.org/software/grub/
 Supports: x86

LinuxBIOS: Linux based BIOS replacement

http://www.linuxbios.org/
 Supports: x86
19
Some Bootloaders (cont.)

UBoot: Universal Bootloader. The most used on arm.



http://uboot.sourceforge.net/
Supports: arm, ppc, mips, x86
RedBoot: eCos based bootloader from RedHat


http://sources.redhat.com/redboot/
Supports: x86, arm, ppc, mips, sh, m68k...
20
Why Use Linux





Open Source
Reliability
Salability
Secure
Supports Virtually All Network Communication
Protocols
21
GNU Introduction


一九八四年,在美國麻省理工學院任教的
理查·史托曼(Richard M. Stallman)創辦
「自由軟體基金會(Free Software
Foundation)」,並提出GNU(Gnu is Not
Unix)計畫
提出GNU計畫中所發展的一整套自由軟體,
內容包括了編譯器、組譯器、文書處理軟
體等各式各樣的應用軟體
 ftp://ftp.gnu.org/gnu
 http://www.gnu.org
22
GCC
Cross Compiler就是在一個平台上(如x86)產生出
另外一個平台上(如arm)的可執行檔案ELF
(Executable and Linking Format)
 如果要在ARM上面建立Linux Kernel必需使用到
Cross Compiler
而一般編譯Linux Kernel的一定是GCC
http://www.kernel.org

23
GCC = GNU Compiler Collection

Features






Portable
Cross-compiling
Support different language
C, C++, Objective-C, Fortran, Java, and Ada
Free Software
http://gcc.gnu.org
程式編譯器 arm-linux-gcc
用來將原始碼編譯成arm平台上執行的程式
$ arm-linux-gcc hello.c –o hello
/usr/local/arm/include/asm,linux
http://0rz.net/2508A
http://people.debian.org/~debacle/cross.html
24
System Boot Flow
Bootloader
Extract and decompress the
Kernel Image and RAMDISK
Launch kernel
Kernel
Initialize Memory and
Hardware
Mount Root Filesystem
(RAMDISK)
Run /sbin/init
User Programs
25
System Storage


The storage devices used in embedded systems are often quite
different from those used in workstations and servers.
Embedded systems tend to use solid-state storage devices such as
flash chips and flash disks.
boot parameters
kernel
root filesystem
bootloader

Need the MTD subsystem to support
26
Kernel Considerations
27
Kernel Configuration

make config


make xconfig


這種模式需要逐行輸入所需要設定的項目,無法往前修改設定,
所以目前很少使用這種方式來設定 Kernel 的項目了;
這種模式則是使用 X-Window 為主要環境的設定模式!除非你有
X-Window 在執行,否則沒有辦法使用這種模式;
make menuconfig

這種模式有點像是文字界面的選單模式,較為簡便,而且可以在
純文字界面下面執行編輯動作!是目前最常使用的模式。
28
Kernel Configuration
29
Kernel Compiling

make dep


make clean


開始編譯模組!這個動作視您剛剛編譯的模組數量!
make modules_install


開始編譯核心!這個核心是經過壓縮的,此外,這個步驟也很長!
make modules


將舊的資料去除掉
make bzImage


建立相依的屬性關係!
將modules資料安裝在 /lib/modules/`uname -r` 裡面!
make install

安裝 bzImage建立完成的核心
30
Root Filesystem
Content
31
Filesystem
/
根目錄
一般常用指令
/bin
Kernel image的位置
/boot
grub設定
/grub
硬體裝置
/dev
系統設定
/etc
一般使用者的家目錄
/home
函式庫
/lib
儲存裝置
/mnt
系統裝置訊息
/proc
管理使用指令
/sbin
暫存檔
/tmp
其他軟體放的目錄
/usr
原始程式碼
/src
一般可執行程式碼
/bin
/sbin
管理使用程式碼
/var
系統記錄檔案
/log
登入檔以及錯誤訊息檔案
/spool
郵件檔案
32
Building Root Filesystem

Download the BusyBox source code from
http://www.busybox.net/

Building BusyBox
 make clean
 make all
 make install
After make complete, the busybox will be
at ./path/to/busybox_src/_install/

33
AP
C Source
ASM Source
C Libraries
C Compiler
Assembler
.aof
Object
Libraries
Linker
.aif
debug
System model
ARMsd
ARMulator
Development
board
34
Application and
Graphic User
Interface
35
Graphic User Interface
Window System





X Window (TinyX)
 http://www.xfree86.org/
QPE (Qt Plamtop Environment) / Qtopia
 http://www.trolltech.com/products/qtopia/index.html
GPE (GPE Palmtop Environment)
 http://gpe.handhelds.org/
Microwindows
 http://microwindows.org/
MiniGUI
 http://www.minigui.org/
36
Qtopia
37
Ap.
Opera
ACCESS
NetFront
MIDP
38
GPE
39
Opie screenshots
40
Microwindows
MP3 Player
Games
41
MiniGUI
Mail
Browser
42
web reference















http://www.delphiresearch.com
http://www.embeddedlinuxjournal.com
http://www.embedded-linux.org
http://www.ibm.com
http://www.lineo.com
http://www.linux.org
http://www.linuxdevices.com
http://www.lynuxworks.com
http://www.microcross.com
http://www.mvista.com
http://www.oncoresystems.com
http://www.redhat.com
http://www.sleepycat.com
http://www.trolltech.com
http://www.nsa.gov/selinux
Local Service Provider
Embedded Magazine
Embedded Trade Association
Tool Developer
Distribution
Linux Association
Embedded Magazine
Distribution
Tool Developer
Distribution
RTOS
Service Provider
Embedded Database
Tool Developer
Secure Linux from NSA
43
Development Tools
44
開發工具




ARM SDT(ARM Software Development Kit)是ARM公司為
方便使用者在ARM晶片上進行應用程式的開發而推出的一
整套整合開發工具
目前的最高版本為SDT2.5.2
從SDT2.5.1開始,ARM公司宣佈推出一套新的整合開發工
具ARM ADS1.0,取代ARM SDT
SDT與ADS保持了良好的相容性
45
開發工具




ARM ADS(ARM Developer Suite)是ARM公司推出的新一
代ARM整合開發工具,用以取代ARM公司以前推出的開發工
具ARM SDT。
目前ARM ADS的最新版本為ADS1.2。
ARM ADS是ARM SDT的升級版本,對ARM SDT的模組進行了
增強,並替換了部分SDT的部件,ARM ADS支援所有的ARM
系列處理器,包括最新的ARM9E和ARM10
除了Windows作業系統外,還支援在Linux作業系統的執行。
46
開發工具
47
THE END
Thanks you.
48