Embedded Linux

47
Embedded Linux By Er. Shishir Adhikari

description

Embedded Linux

Transcript of Embedded Linux

Page 1: Embedded Linux

Embedded Linux

By

Er. Shishir Adhikari

Page 2: Embedded Linux

Discussion Topics

What is an embedded Operating System Linux as an embedded OS Building kernel Tools and development Who are the Embedded OS developers Applications and products The embedded OS market Embedded OS Resources

Page 3: Embedded Linux

What is an Embedded OS?

“computer system” that performs a dedicated function or is designed for use with a specific embedded software application.

Embedded systems may use a ROM­based operating system or they may use a disk­based system, like a PC. 

Page 4: Embedded Linux

What makes a good Embedded OS? 

Modular Scalable Configurable Small footprint CPU support Device drivers

Page 5: Embedded Linux

Why Linux as Embedded OS?

Royalty free licensing

Reliable IP stack and TCP/IP Applications

Source code for the OS Kernel is Open

Source code for the Toolchains is Open

Page 6: Embedded Linux

Why Linux as Embedded OS?....

Multiple choices vs. sole source Robust and reliable Modular, configurable, scalable Superb support for networking and Internet

Large pool of skilled developers

Page 7: Embedded Linux

Why Linux as Embedded OS?....

It is very modular in nature, since all features of the system that are not needed for a specific embedded system can be removed from the kernel.

In addition, Linux has been ported successfully to a large number of processor architectures, which allows it to run on many different types of CPUs. 

Page 8: Embedded Linux

Why Linux as Embedded OS?

Processors supported by Linux: Intel 386 processors, ARM, CRIS (i.e. ETRAX 100LX from Axis Communications), Motorola 68000 series, Sparc (Sun Workstations), PowerPC, MIPS, s390 (mainframe) and several others.

Page 9: Embedded Linux

Things to consider while using linux as Embedded OS

Which processors are supported by linux?

What features are needed in the kernel for the embedded system?

For example, Linux can be boot from a ROM chip rather than SCSI hard disk, CDROMs. 

Device drivers to be included?

Page 10: Embedded Linux

Things to consider while using linux as Embedded OS

Require real­time features? A real­time operating system is one that has a guaranteed response time to interrupts. 

It is possible to convert Linux into a real­time system however.

Page 11: Embedded Linux

What is Real Time? 

“A real time system is one in which the correctness of the 

computations not only depends upon the logical correctness of the computation but also upon the 

time at which the result is produced. If the timing 

constraints of the system are not met, system failure is said to 

have occurred.”

­ Donald Gillies

Page 12: Embedded Linux

What is Real Time? 

“Real time in operating systems:

The ability of the operating system to provide a required level of service in a bounded 

response time.”­ POSIX Standard 1003.1

Page 13: Embedded Linux

Hard vs. Soft Real Time 

Hard• where the operation must be completed within the deadline, and is valueless beyond this deadline. 

Soft • Tasks completed after their respective deadlines are less important than those whose deadlines have not yet expired. 

Page 14: Embedded Linux

Linux Real­Time Extensions

In order to make Linux into a real­time operating system, the kernel itself is modified slightly so it can run as a task under a real­time scheduling process.

In this case, a developer has a choice when creating software that handles interrupt. 

Standard Linux device driver(interrupt response time is not guaranteed)

RTLinux device driver(response time can be accurately predicted in microseconds)

Page 15: Embedded Linux

Building a Linux Kernel

First download the kernel source code http://www.kernel.org/, or ftp://ftp.kernel.org/

 extract it (uncompress) so you can build it  /usr/src/linux folder

  cd  /usr/src   tar  xzvf  <path>/linux­2.2.4.tar.gz

  ln  ­s linux­2.4.4 linux

Page 16: Embedded Linux

Building a Linux Kernel…..

Next select the options you would like included into the kernel. 

Run the 'make' command, followed by either 'config' (text­mode only), 'menuconfig' (text mode with menus), or xconfig (X­Windows configuration mode). 

#make menuconfig #make xconfig #apt­get install build­essential (development tool for Nepalinux)

Page 17: Embedded Linux

Go through all the menu choices and enable or disable options and device drivers as needed

 /usr/src/linux/Documentation folder and sub­folders ­ many options and settings described there.

 Exit and save your settings. These values are saved in a file named '.config' in the /usr/src/linux folder

Page 18: Embedded Linux

Kernel Types

Kernel – monolithic or modular Monolithic kernel – Linux device drivers built into the kernel itself. Automatically loaded with kernel.

Modular kernel – Device drivers can be built as modules. The device driver will have to be installed using scripts before attempting to use the device.

Page 19: Embedded Linux

For embedded systems, monolithic kernel is preferred. 

You should only include those specific devices that you must support to get the smallest kernel available. 

For example, if your embedded device does not have network cards, no need to include any networking support at all in the kernel.

Page 20: Embedded Linux

Cross­compiler for different Embedded Processor

Cross­compiler  Generates the opcodes for the target processor, instead for the processor running on your computer.

Cross­compilers for almost all processors supported by Linux are available from the GNU organization at http://www.gnu.org/

Page 21: Embedded Linux

Building kernel for the same processor architecture

#make dep  This will scan all the source code and header files, reads .config file and updates various interdependencies between kernel source code files and options. 

Then build the kernel itself  #make zImage (using gzip compression algorithm)

#make bzImage (using bzip2)

Page 22: Embedded Linux

The kernel will uncompress itself on the fly when attempting to boot. 

This is done by adding a small bit of 'uncompression' code to the beginning of the kernel itself. 

During boot time, the kernel will then extract the 'real' kernel from the file to memory and continue to boot.

Page 23: Embedded Linux

The kernel image file – /usr/src/linux/arch/<arch­type>/boot directory. 

zImage or bzImage, depending on which type of compression option you selected.

Put on floppy, CD­ROM or Flash ROM or other bootable device to start running Linux.

Page 24: Embedded Linux

Who are the Embedded OS developers? 

Wind River Systems– VxWorks

– pSOS

QNX Software Systems– QNX

Green Hills Software– Integrity

Page 25: Embedded Linux

Who are the Embedded OS developers?

Mentor Graphics – VRTX

Palm Computing– PalmOS

Symbian– SymbianOS

Page 26: Embedded Linux

Microsoft 

Embedded NT/XP– “Real­time” control

Windows CE– variation of Microsoft's Windows operating system for minimalistic computers and embedded systems. 

– supported on Intel x86, MIPS, ARM, and Hitachi SuperH processors. 

Pocket PC 2002– Handheld PC’s and PDA’s

Page 27: Embedded Linux

Commercial Embedded Linux 

AMIRIX Embedded Linux– derived from Debian

Coollogic Coollinux– combines Linux and Java for Internet apps

Coventive Xlinux– kernel can be as small as 143KB

Esfia RedBlue Linux– 400K, designed for wireless apps

Page 28: Embedded Linux

Commercial Embedded Linux 

KYZO Pizza Box Linux– SAMBA based file, print, CD server

Lineo Embedix– supports real time and high availability apps

LynuxWorks BlueCat– general purpose embedded solution

MontaVista Linux– general purpose embedded solution

Page 29: Embedded Linux

Commercial Embedded Linux 

Neoware  NeoLinux– Red Hat derived for information appliances

PalmPalm Tynux– Internet appliuance and multimedia

Red Hat Embedded Linux– general purpose embedded solution

RedSonic Red­Ice Linux– runs from DiskonChip or CompactFlash

Page 30: Embedded Linux

Commercial Embedded Linux 

RidgeRun DSP Linux– for multimedia, wireless, RT on DSP

TimeSys Linux GPL– low latency enhanced kernel

Tuxia TASTE– distro targets Internet appliances

Vital Systems vLinux– for ARM based embedded apps

Page 31: Embedded Linux

Open Source Embedded Linux

Embedded Debian Project– convert Debian to an embedded OS

ETLinux– for PC104 SBC’s

uCLinux– for microprocessors that don’t have MM

uLinux (muLinux)– distro fits on a single floppy

Page 32: Embedded Linux

Open Source Linux RTOS

ART Linux ­ real time extension based on RTLinux

KURT ­ event schedules with 10us resolution 

Linux­SRT ­ for soft real time apps like multimedia

Qlinux ­ provides Quality of Service guarantees

RTAI ­ “hard” Real Time Application Interface

Page 33: Embedded Linux

Commercial Linux RTOS

ThinLinux ­­ a minimized Linux distribution for dedicated camera servers, X­10 controllers, MP3 players

FSMLabs ­ Open RT Linux Lineo ­ Embedix Realtime LynuxWorks ­ BlueCat RT REDSonic ­ REDICE Linux

Page 34: Embedded Linux

RTLinux

A “hard real­time” mini operating system

runs Linux as it’s lowest priority execution thread

Linux thread completely preemptible Real time threads and interrupt handlers never delayed by non­realtime operations

Supports user level programming MiniRTL implementation fits on a floppy

Page 35: Embedded Linux

What’s so special about Linux? 

Page 36: Embedded Linux

What CPU’s will it run on? 

Intel X86 MIPS ARM StrongARM PowerPC Hitachi SuperH

Page 37: Embedded Linux

Any Development Tools Available? 

QT/Embedded Other GUI/Windowing toolkits Arcom Control Systems GNUPro Tools Vendor specific Standard Linux toolset

Page 38: Embedded Linux

What’s It Being Used For? 

Control and Monitoring Applications

Industrial Controllers TV Set Top Boxes (TiVO) Handheld PDA’s Automobile Computers Telecomm and Networking Hardware Myriad and sundry other uses...

Page 39: Embedded Linux

Cyclades TS­100 

Netlinos OS Dual 50MHz PowerPC 16MB SDRAM 4MB Flash Ethernet/Serial/RS485 Size of a deck of cards

Page 40: Embedded Linux

Sharp Zaurus 

Lineo Embedix 206 MHz StrongARM 64 MB DRAM 16MB Flash 3.5” display (320x240) 64K colors

Opera browser & Qtopia QT/Embedded GUI

Page 41: Embedded Linux

TiVO Set Top Box 

Home grown port of Embedded Linux 54MHz PowerPC Multi GB hard disk

Page 42: Embedded Linux

Axis 2120 Network Camera 

uCLinux Built­in Ethernet port 100 MHz ETRAX CPU 16 MB RAM

Page 43: Embedded Linux

Humanoid Robots

Isamu

Univ. of Tokyo/Kawanda Ind.

Dual Pentium CPU RT­Linux Height: 53 inches Weight: 121 lbs.

Page 44: Embedded Linux

Humanoid Robots

Fujitsu RT­Linux Height: 48 cm

Weight: 6 kg

100 units/yr

HOAP

Page 45: Embedded Linux

For Further Info Web Sites

Blue Cat Linux at http://www.lynuxworks.com/

Hard Hat Linux at http://www.mvista.com/

RT­Linux at http://www.rtlinux.com/

ThinLinux at http://www.thinlinux.com/

White Dwarf Linux at http://www.emjembedded.com/linux/dimmpc.html

Page 46: Embedded Linux

For Further Info Web Sites

Linux Embedded at http://linux­embedded.com/

LinuxDevices.com http://www.linuxdevices.com/

Embedded Linux Consortium http://www.embedded­linux.org/index.php3

All Linux Devices http://alllinuxdevices.com/

Page 47: Embedded Linux

For Further Info Web Sites/Magazines

Dr. Dobbs Embedded Systemshttp://www.ddjembedded.com/about/

Embedded Linux Journal http://embedded.linuxjournal.com/

Embedded Systems Programming http://www.embedded.com/mag.htm