Embedded Linux

Post on 07-Nov-2014

41 views 1 download

Tags:

description

Embedded Linux

Transcript of Embedded Linux

Embedded Linux

By

Er. Shishir Adhikari

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

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. 

What makes a good Embedded OS? 

Modular Scalable Configurable Small footprint CPU support Device drivers

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

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

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. 

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.

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?

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.

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

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

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. 

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)

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

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)

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

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.

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.

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/

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)

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.

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.

Who are the Embedded OS developers? 

Wind River Systems– VxWorks

– pSOS

QNX Software Systems– QNX

Green Hills Software– Integrity

Who are the Embedded OS developers?

Mentor Graphics – VRTX

Palm Computing– PalmOS

Symbian– SymbianOS

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

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

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

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

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

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

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

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

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

What’s so special about Linux? 

What CPU’s will it run on? 

Intel X86 MIPS ARM StrongARM PowerPC Hitachi SuperH

Any Development Tools Available? 

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

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...

Cyclades TS­100 

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

Sharp Zaurus 

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

Opera browser & Qtopia QT/Embedded GUI

TiVO Set Top Box 

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

Axis 2120 Network Camera 

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

Humanoid Robots

Isamu

Univ. of Tokyo/Kawanda Ind.

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

Humanoid Robots

Fujitsu RT­Linux Height: 48 cm

Weight: 6 kg

100 units/yr

HOAP

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

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/

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