LOGO
UNIVERSITY OF SCIENCE Faculty of Electronics and
Telecommunications
SEMINAR
Embedded Systems
and
Embedded LinuxExecutors:Trần Trọng Tuấn – MSSV: 0620098Nguyễn Anh Tuấn – MSSV: 0620094 Guide:M.S. Nguyễn Duy Mạnh Thi
MAD
LOGOContents
INTRODUCTION1
EMBEDDED LINUX2
CONCLUSION3
Embedded Systems & Embedded Linux
INTRODUCTION1
LOGO
Embedded Systems & Embedded Linux
1. INTRODUCTION
1.31.3ExamplesExamples 1.21.2
CharacteristicsCharacteristicsOfOfESES
1.11.1What & WhyWhat & WhyEmbeddedEmbeddedSystems?Systems?
1.1.INTRODUCITONINTRODUCITON
1.41.4Embedded OSEmbedded OS
andand Why Linux?Why Linux?
1.51.5HistoryHistoryof Linux and of Linux and EmbeddedEmbeddedLinuxLinux
LOGO
1st: Information processing systems embedded
into enclosing products [1]
Embedded Systems & Embedded Linux
1.1 What & Why Embedded Systems?
EMBEDDED
???
2nd: A special-purpose computer system designed
to perform one or a few dedicated functions,
often with real-time computing constraints [wiki]3rd: System that consists of input/output (I/O) and
control logic stored in system firmware [2]
LOGO
Embedded Systems & Embedded Linux
1.1 What & Why Embedded Systems?
The 1st recognizably modern embedded system:The Apollo Guidance Computer (AGC) – 1960s
DSKY mounted on control panelDSKY user interface
LOGO
To make hardware devices more flexible: + Cost + Connectivity + Pervasive Computing + Hardware Combination
WHY?
We are in the post-PC era. (2000 - 2020)
Embedded Systems & Embedded Linux
1.1 What & Why Embedded Systems?
LOGO
1.2 CHARACTERISTICS OF EMBEDDED SYSTEMS
Dedicated to specific tasks
Wide range of Hardwareand Processors
Software failure severity
EmbeddedEmbeddedSystemsSystems
≠DesktopDesktopSystemsSystems
Real-time constraints
Using real-timeOperating systems (RTOS)
Cost sensitive
Power constraints
Operating under extremeenvironmental conditions
Fewer system resources than Desktop systems
Specialized tools andDesign methods
Dedicated debugging circuitry
etc…
Embedded Systems & Embedded Linux
x86, Power PC, ARM, MIPS, 8051…hard-core or soft-core?
Real-time: + hard real-time (time critical constraints) + soft real-time (time sensitive constraints)
LOGO1.3 EXAMPLES
Embedded Systems & Embedded Linux
EmbeddedSystems
CONSUMER ELECTRONICSTELECOMMUNICATIONS
AUTOMOTIVE
INDUSTRY
MEDICAL
USERS’ DESIGNS
LOGO
1.4 WHY USING AN OPERATING SYSTEM? WHY USING EMBEDDED LINUX?
Embedded Systems & Embedded Linux
WhyWhyEmbeddedEmbedded
OSesOSes??
1
2
Providing an abstraction layer for softwareon top of the OS to be less dependent on hardware→ Easier for middleware and applications designers
Managing various system hardware and softwareresources → Provide more features
LOGO
1.4 WHY USING AN OPERATING SYSTEM? WHY USING EMBEDDED LINUX?
Embedded Systems & Embedded Linux
Why Why Embedded Embedded
Linux?Linux?
Increasing of supported hardware & software
- Single to Multiprocessors- Simple to Complex Systems- Fully customizable in all its components (thanks to GPL, General Public License)
- Vendor Independence- Thousands of developers provide & enhance Linux kernel and other applications- Global support
- Fast, High Efficiency- Stable, low failure rate- Rich set of toolsets and utilities- Networking capabilities
- Development Cost-Training and Hiring Costs- Royalty free- Low system maintenance time
PowerfulHigh-performance
(Short Time to Market)
Varied Hardware Support(scalable & flexible)
Low Cost
OPEN SOURCE
POSIX® Standards (IEEE)Compliance
(Portable OperatingSystem Interface)
LOGO
1.5 HISTORY OF LINUX & EMBEDDED LINUX
Embedded Systems & Embedded Linux
- Linux / ’lɪnʊks / (original) or /’lɪnəks/ (English): A “Unix-like” operating system.
UNIX???UNIX Unix-like
UnixWare Solaris FreeBSD OpenBSD
…
MINIX IRIX AIXMac OS XLINUX
Timeline of Unix variants
1969, AT&T (Bell LABs)
LOGO
1.5 HISTORY OF LINUX & EMBEDDED LINUX
Embedded Systems & Embedded Linux
Linus Torvalds
(created Linux Kernel
in1991)
Richard Matthew Stallman
founder of The GNU project
(from 1984)
LOGO
1.5 HISTORY OF LINUX & EMBEDDED LINUX
Embedded Systems & Embedded Linux
LOGO
1.5 HISTORY OF LINUX & EMBEDDED LINUX
Embedded Systems & Embedded Linux
Linux Distributions (Distros)Linux Distributions (Distros)
kernel + tools+ window managers
+ many other applications
DebianDebian Red Hat / Fedora
MandrivaMandrivaSUSESUSE
(GNU/Linux)(GNU/Linux)Ret HatRet Hat
SUSESUSEUbuntuUbuntu
LOGO
1.5 HISTORY OF LINUX & EMBEDDED LINUX
RT-Linux research project
M. B
arabanov & V
. Yodaiken
μClinux
D. J. D
ionne & K
. Albanow
ski
Em
bedded System
s
Conference (E
SC
)
RTA
I
Lineo, FSM
Labs,
MontaV
ista®, and Zentropix
Real-tim
e: Mon
taVista,
Ret H
at EL
/IX 1.1
OS
DL (O
pen Source
Developm
ent Lab):
HP
®, Intel, IB
M, and N
EC
®
Sam
sung (PD
A + Linux)
Ericsson (M
obile+Internet+wireless+em
ail)
1996 1997 1999 2000
EMBEDDED LINUX (FIRST AGE)
Hard real-time No MMU
Embedded Systems & Embedded Linux
Support
BlueCatLynuxWorks
BusyBox0.43
New wave
LOGO
1.5 HISTORY OF LINUX & EMBEDDED LINUX
Embedded Systems & Embedded Linux
Embedded Linux vs Other Embedded OSesEmbedded Linux vs Other Embedded OSes
LinuxNon-Linux
AMIRIX, Coollogic: Coollinux,Coventive: Xlinux, Klinux,Esfia: RedBlue Linux,KYZO: PizzaBox Linux,Lineo: Embedix,LynuxWorks: BlueCat,Neoware: NeoLinux,TimeSys: Linux GPL,MontaVista Linux
eCos ,VxWorks,Win CE,Lynyos,BSD,Green Hills,QNXDOS…
LOGO
1.5 HISTORY OF LINUX & EMBEDDED LINUX
Embedded Systems & Embedded Linux
Linux kernel versionsLinux kernel versions
Newest: 2.6.27.9-rc2
LOGO
1.5 HISTORY OF LINUX & EMBEDDED LINUX
Embedded Systems & Embedded Linux
Embedded Linux: Real-time or not?Embedded Linux: Real-time or not?
Past
NOW Full real-time Full real-time LinuxLinux
General-purposes OS: NO REAL-TIME AT ALL!(Differences in deterministic timing behavior of all theOS services)
1st Dual-kernel (Co-kernel) approach : hard real-time2nd Fully Preemptive Kernel Approach:Patches supported to make soft real-time Linux
LOGO2. EMBEDDED LINUX
INTRODUCTION1
2
CONCLUSION3
Embedded Systems & Embedded Linux
INTRODUCTION1
EMBEDDED LINUX
LOGO2. EMBEDDED LINUX
Embedded Systems & Embedded Linux
2.32.3ProspectsProspects
2.22.2ImplementationImplementation
2.12.1Design lifeDesign life
circlecircle
2.2.EMBEDDEDEMBEDDED
LINUXLINUX
2.42.4ExamplesExamples
forforFUTUREFUTURE
2.52.5ChallengesChallenges
LOGO2.1 DESIGN LIFE CYCLE
Embedded Systems & Embedded Linux
LOGO2.1 DESIGN LIFE CYCLE
Embedded Systems & Embedded Linux
TRADITIONAL WORK-FLOW vs MODEL-BASED DESIGNED WORK-FLOW
PAST NOW
LOGO2.2 IMPLEMENTATION
Embedded Systems & Embedded Linux
Examine. . .HOW TO BUILD A PARTICULAR EMBEDDED LINUX SYSTEM?
Simplified work-flow (suitable for individuals)
LOGO2.2 IMPLEMENTATION
Embedded Systems & Embedded Linux
Examine. . .HOW TO BUILD A PARTICULAR EMBEDDED LINUX SYSTEM?
Step 1: Product specifications / System requirements
-Build a Linux-based platform on a specific hardware- Which hardware to choose (to order)?
+ Which development board?+ Which processor?
- Which Linux distro? (that supports the chosen hardware)
- Which software and toolchain(s) to design?Eclipse-based IDE(Integrated Development Environment)
- Which software application(s) to run?
Compatible with Linux or not?
LOGO2.2 IMPLEMENTATION
Embedded Systems & Embedded Linux
Examine. . .HOW TO BUILD A PARTICULAR EMBEDDED LINUX SYSTEM?
Step 2: Overall Architecture / Models
- Understand hardware’s architecture- Understand the Linux kernel- Choosing hardware components - Design block diagrams (at high level)+ hardware connecting and behavior + application(s)- Understand the cross-platform concept
Basic concepts
LOGO2.2 IMPLEMENTATION
Embedded Systems & Embedded Linux
HOW TO BUILD A PARTICULAR EMBEDDED LINUX SYSTEM?
Step 2: Overall Architecture / Models
- Understand hardware’s architecture- Understand the Linux kernel- Choosing hardware components - Design block diagrams (at high level)+ hardware connecting and behavior + application(s)- Understand the cross-platform concept
Examine. . .
EXAMPLE:+ Board + CPU
LOGO2.2 IMPLEMENTATION
Embedded Systems & Embedded Linux
HOW TO BUILD A PARTICULAR EMBEDDED LINUX SYSTEM?
Step 2: Overall Architecture / Models- Understand hardware’s architecture
+ Bus architectureEx:
Avalon Switch Fabric for Altera
IBM CoreConnect™ for Xilinx
LOGO2.2 IMPLEMENTATION
Embedded Systems & Embedded Linux
HOW TO BUILD A PARTICULAR EMBEDDED LINUX SYSTEM?
Step 2: Overall Architecture / Models- Understand the Linux kernel (overall)
The hardware abstraction layer (HAL) HAL = BSPs + processor-specific software Memory manager Scheduler File system I/O subsystem Networking subsystem IPC (Inter-process communication)
LOGO2.2 IMPLEMENTATION
Embedded Systems & Embedded Linux
HOW TO BUILD A PARTICULAR EMBEDDED LINUX SYSTEM?
Step 2: Overall Architecture / Models
- Understand hardware’s architecture- Understand the Linux kernel- Choosing hardware components - Design block diagrams (at high level)+ hardware connecting and behavior + application(s)- Understand the cross-platform concept
LOGO2.2 IMPLEMENTATION
Embedded Systems & Embedded Linux
Step 2: Overall Architecture / Models
- Understand the cross-platform concept
Desktop (Linux-x86)
ARM, PPC,MIPS, NIOS…
LOGO2.2 IMPLEMENTATION
Embedded Systems & Embedded Linux
Examine. . .HOW TO BUILD A PARTICULAR EMBEDDED LINUX SYSTEM?
Step 3: Hardware and Software configurations
HARDWARE: (Work becomes more easier with powerful tools)- Configure the CPU parameters
+ processor clock frequency, bus clock frequency+ Cache/ debug mode/ On-chip memory?
- Configure the peripherals + Using own designs (verilog .v or .vhdl files)+ Using supported / licensed IP cores (Intellectual Properties)
+ Enabled / Disabled – interrupt or not?
LOGO2.2 IMPLEMENTATION
Embedded Systems & Embedded Linux
Step 3: Hardware and Software configurationsHARDWARE: (Work becomes more easier with powerful tools)- Configure Software setting
+ Give more detailed information to the System Wizard+ Choose the embedded OS+ Connected peripherals
- Build and generate file Netlist + bitstream (will be uploaded to the FPGA )- Generate software Libraries and BSP (Board Support Packages)
BSP includes:+ drivers+ header files+ device ID number+system address map
will be used in the kernel compilation process
LOGO2.2 IMPLEMENTATION
Embedded Systems & Embedded Linux
Step 3: Hardware and Software configurationsSOFTWARE: (need to deal a lot with the Linux command console)-Preparations for cross-compilation of the kernel Create a cross-compiler environment (to compile CPU kernel and Linux root file system)
Crosstool: reliable & easy-to-use toolchain generator (by Dan Kegel)
• Linux kernel headers• C libraries (GCC – GNU Compiler Collection ) (glibc)• Binutils(manipulate binary object files)• …
- Build the Linux kernel• Download the Linux kernel (with the distro supporting the hardware)• Insert the BSP files + make some necessary modifications
Crosstool
(scripts)
Proper toolchain(suitable versions for target hardware)
(Created before)
LOGO2.2 IMPLEMENTATION
Embedded Systems & Embedded Linux
Step 3: Hardware and Software configurationsSOFTWARE: (need to deal a lot with the Linux command console)
- Build the Linux kernel (cont)• Compile the kernel → make kernel’s image (.elf – executable and linking format)
• Test the kernel without Root file system (optional)- Build Root filesystem (RFS)
• Using BusyBox Run a script file to:
+ Create root directories+ Copy Glibc into RFS folder+ Install BusyBox into RFS
+ Modifies permissions and ownerships of RFS
• Re-configure the kernel• Re-make the final image (.ace file - to load into the flash-card)
Top-level directories
Directory Contents
bin Binary executables, usable by all users on the system
dev Device nodes
etc Local system-configuration files
lib System libraries, such as the standard C library and many others
sbin Binary executables usually reserved for superuser accounts on the system
usr A secondary file system hierarchy for application programs, usually read-only
var Contains variable files, such as system logs and temporary configuration files
tmp Temporary files
LOGO2.2 IMPLEMENTATION
Embedded Systems & Embedded Linux
Step 3: Hardware and Software configurationsSOFTWARE: (need to deal a lot with the Linux command console)- Port kernel image into hardware
• Format CF card (flash card): Partition 1: Type = FAT16 (6) (contains created .ace file) Partition 2: Type = Linux Swap (82) Size = 1 ~ 1.5 main memory Partition 3: Type = Linux (83), Size = Remainder disk space (contains NFS files)
• Copy .ace file → partition 1 NFS files → partition 3
PORT LINUX KERNEL FINISH!!!
LOGO2.2 IMPLEMENTATION
Embedded Systems & Embedded Linux
Step 4: Applications design- Similar to programming applications in desktop
+ Assembly, Pascal, C, C++, Java…+ Block diagram+ Coding (on host PC) + …+ Cross-compile → executable files in target device
- Copy into /bin on root file system of target.SYSTEM COMPLETED!!!
LOGO2.2 IMPLEMENTATION
Embedded Systems & Embedded Linux
LINUX KERNEL PORTED TO IPHONE(iPhone-Dev.org)- Hardware: Iphone (fixed) 1st & 2nd generation + Touch Processor: ARM- Bootloader: OpeniBoot- Linux kernel: 2.6
SOME REAL EMBEDDED LINUX SYSTEMS TODAY
LOGO2.2 IMPLEMENTATION
Embedded Systems & Embedded Linux
www.mtemag.comHardware: Airbus380 25 PowerPC processorsOS: LynxOS (Linux-based real-time OS)
SOME REAL EMBEDDED LINUX SYSTEMS TODAY
LOGO2.2 IMPLEMENTATION
Embedded Systems & Embedded Linux
SOME REAL EMBEDDED LINUX SYSTEMS TODAY
ANDROID – FUTURE’S HAND HELD OS android.com- Developers: Open Handset Alliance (Google, Intel, Motorola, T-mobile… ) on November 2007 - Hardware: mobile devices- OS: Android (Linux kernel (monolithic))- Software development kit: Android SDK
T-mobile G1: 1st mobile device using Android 1.0 OS
LOGO2.3 PROSPECTS
Embedded Systems & Embedded Linux
- 3rd wave of innovation in ICT (Post-PC era)99% of global processors are placed in Embedded Systems.-Combine advantages of many industries together
(ITC, Mechanics, Biology, Chemistry… )
- With an eOS + a powerful design toolchain, Embedded Systems can approach any kind of user andare much easier to build your own system. (flexibility)
+ Xilinx ISE development suites+ Altera Stratix II Development Kit+ Embedded MATLAB:using Model-Based Design+ …
LOGO2.4 FUTURE’S EXAMPLES
Embedded Systems & Embedded Linux
- SoC evolutions → NoC (Network on Chip) Spidergon Topology + IPU (Interconnect Processing Unit)
→ Spidergon STNoC: an innovative technology
LOGO2.4 FUTURE’S EXAMPLES
Embedded Systems & Embedded Linux
NoC Using GALS(Globally Asynch. Locally Sync.)
LOGO2.4 FUTURE’S EXAMPLES
Embedded Systems & Embedded Linux
Ambient Intelligence: Many networked devices are integrated into the environment.
LOGO2.5 CHALLENGES & LIMITATIONS
Embedded Systems & Embedded Linux
- Difficulties in HW/SW co-design.- Multi-careers co-ordination- Linux:
+ Open source+ Unfamiliar with Windows users
Viet Nam’s reality:- Hardware’s un-afordable (software only)
LOGO3. SUMMARY
Embedded Systems & Embedded Linux
- No demo- Impossible to master every aspect of the seminar.
LOGO
Embedded Systems & Embedded Linux
LOGOREFERENCE
Embedded Systems & Embedded Linux
[1] Arnold S. Berger - Embedded Systems Design- An Introduction to Processes, Tools and Techniques (CMP Books - 2002)[2] Craig Hollabaugh - Embedded Linux- Hardware, Software and Interfacing (Addison Wesley) – 2002[3] Auerbach - Embedded Linux System Design and Development (2006)[4] Newnes - Embedded Software - Know it all - Sep 2007[5] Karim Yaghmour Building Embedded Linux Systems - 2nd edition - Aug.2008 (OReilly)[6] O'Reilly - Understanding The Linux Kernel (2000)[7] Prentice Hall - Embedded Linux Primer - a Practical RealWorld Approach 2006[8] Prentice Hall- The Linux Kernel Primer A Top Down Approach for x86 and PowerPC Architectures – 2005[9] PETER MARWEDEL - Embedded System Design - Peter Marwedel -2006 (Springer) [10] Embedded System WEEK08_tutorial Slides[11] J. W. Donaldson - Porting MontaVista Linux to the XUP Virtex-II Prodevelopment board - 2006