• Aucun résultat trouvé

Free Software for Embedded Systems

N/A
N/A
Protected

Academic year: 2022

Partager "Free Software for Embedded Systems"

Copied!
42
0
0

Texte intégral

(1)

Free Software for Embedded Systems

Mail: [email protected] Web: http://stephane.lavirotte.com/

University of Nice - Sophia Antipolis

(2)

We must start with something…

Introduction

(3)

9 Linux for embedded systems

– Is used more and more – In use in many devices

ƒ Mobile Phones

ƒ PDA (Personal Digital Equipment)

ƒ Network Equipments

ƒ

ƒ Have a look to:

http://www.linuxfordevices.com/c/a/Linux-For-Devices-Articles/The-Linux-Devices-Showcase/

– Used in limited resources systems

ƒ uClinux, uClibc, dietlib, …

9 Easy to include free software inside that products

– sqlite, samba, thttpd, …

Linux for Embedded Systems

(4)

Development Phases

9 Configuration

– First, choose which features to include in the system

ƒ Kernel configuration

ƒ Choose the tools and applications to include

9 Build

– Need to recompile the entire system for the target:

ƒ Kernel

ƒ Libraries

ƒ Applications

9 Deployment

– Installation of files in a filesystem

– Transfer on the target and start the new system

(5)

System Components

9 Component

– Boot Loader – Kernel

– Kernel Modules – File Systems

– Libraries

– Applications

Boot Loader

Kernel

File System Kernel Modules

Libraries

Applications

(6)

About Free Software

9 Linux is and Open Source Free Software

9 Free Software provides 4 freedom to the user:

– The freedom to use the program as it sees fit

– The freedom to study how the program works and adapt it to its own needs (Get the source code is a precondition).

– The freedom to redistribute copies to help others

– The freedom to improve the program, and distribute the

improvements to the public so that the community can benefit from advanced (Get the source code is a precondition).

9 See

– http://www.gnu.org/philosophy/

(7)

The GNU General Public License (GPL)

9 Copyleft licenses rely on copyright law to require that any modified version remains free software.

– For more details

ƒ Copyleft: http://www.gnu.org/copyleft/copyleft.html

9 The GNU GPL requires that modifications and derivative works are also under GPL:

– Applies only to software distributed

– Any program using GPL code (statically or dynamically linked) is regarded as an extension of this code and therefore under the GPL

– For more details

ƒ FAQ GPL: http://www.gnu.org/licenses/gpl-faq.html

(8)

A collection of Software Tools

Free Applications and

Embedded Systems

(9)

glibc

9 C Library made by GNU project

– http://www.gnu.org/software/libc/

– LGPL License

9 Designed for

– Performances

– Respect standards – Portability

9 Necessary for all GNU/Linux systems 9 But too big for embedded systems

– About 1,5 - 2MB are necessary

ƒ Sur IPaQ: 1,2MB pour la libc et 500KB pour la libm

ƒ Sur i386: 1,3MB pour la libc et 150KB pour la libm

(10)

uClibc

9 C Library made by CodePoet Consulting

– http://www.uclibc.org/

– LGPL License

– Now supported by MontaVista, TimeSys, Wind River

9 Designed

– For small and tiny embedded systems – With a maximum of functionalities

9 Provides most needs

– Debian Woody completely ported using uClibc

9 Small: about 4 times smaller than glibc arm

– glibc: 1700 KB (libc: 1.2 MB, libm: 500 KB)

– uClibc:. 400 KB (libuClibc: 300 KB, libm: 55KB)

(11)

Comparison

9 glibc (GNU C Library)

– Done for its performance and the respect of standards – The best for workstation machines and servers

9 uClibc

– Highly compatible

– Made for embedded systems with a small storage capacity and memory

9 The others: diet libc, newlib, klibc

– Most suitable for all small systems, or initramfs and init ramdisk

(12)

THE Toolbox

A Toolbox for the Target

(13)

BusyBox

9 http://www.busybox.net/

9 BusyBox

– Consolidates most Unix utilities into a single executable – A web server if also included !

– Small size

ƒ Statically compiled with uClibC: less the 500KB

ƒ Statically compiled with glibc: less than 1MB

9 An excellent choice for:

– Initramfs or initrd with complexes scripts

– Embedded systems with small and medium-sized storage

9 Easy to configure the wanted functionalities

(14)

BusyBox Commands

addgroup, adduser, adjtimex, ar, arping, ash, awk, basename, bunzip2, bzcat, cal, cat, chgrp, chmod, chown, chroot, chvt, clear, cmp, cp, cpio, crond, crontab, cut, date, dc, dd, deallocvt, delgroup, deluser, devfsd, df, dirname, dmesg, dos2unix, dpkg, dpkgdeb, du, dumpkmap, dumpleases, echo, egrep, env, expr, false, fbset, fdflush, fdformat, fdisk, fgrep, find, fold, free, freeramdisk, fsck.minix, ftpget, ftpput, getopt, getty, grep, gunzip, gzip, halt, hdparm, head, hexdump, hostid, hostname, httpd, hush, hwclock, id, ifconfig, ifdown, ifup, inetd, init, insmod, install, ip, ipaddr, ipcalc, iplink, iproute, iptunnel, kill, killall, klogd, lash, last, length, linuxrc, ln, loadfont, loadkmap, logger, login, logname, logread, losetup, ls, lsmod, makedevs, md5sum, mesg, mkdir, mkfifo, mkfs.minix, mknod, mkswap, mktemp, modprobe, more, mount, msh, mt, mv, nameif, nc, netstat, nslookup, od, openvt, passwd, patch, pidof, ping, ping6,

pipe_progress, pivot_root, poweroff, printf, ps, pwd, rdate, readlink, realpath, reboot, renice, reset, rm, rmdir, rmmod, route, rpm, rpm2cpio, runparts, rx, sed, seq, setkeycodes, sha1sum, sleep, sort,

startstopdaemon, strings, stty, su, sulogin, swapoff, swapon, sync, sysctl, yslogd, tail, tar, tee, telnet, telnetd, test, tftp, time, top, touch, tr,

traceroute, true, tty, udhcpc, udhcpd, umount, uname, uncompress,

uniq, unix2dos, unzip, uptime, usleep, uudecode, uuencode, vconfig, vi, vlock, watch, watchdog, wc, wget, which, who, whoami, xargs, yes, zcat

(15)

Configuring BusyBox

9 Get the latest stable version

– http://busybox.net/

9 Configuring BusyBox (create a .config file):

make defconfig

ƒ To begin with BusyBox

ƒ Configure Busybox with all the options (produce a huge system) make allnoconfig

ƒ Unselect all the options

ƒ Allow to include only wanted features (produce a small system)

9 Same interface as the kernel configuration tool

make menuconfig (texte) make xconfig (graphique)

9 Possibility to configure the wanted commands and all the options and functionalities wanted for these

commands

(16)

Compiling BusyBox

9 When Cross-Compiling

– Choose the microprocessor architecture and the right cross- compiler in the Makefile (as for kernel)

ƒ ARCH ?= arm

ƒ CROSS_COMPILE ?= arm-linux-gnueabi- – Add path to the cross-compiler in our PATH

ƒ export PATH=/usr/local/arm/3.3.2/bin:$PATH

9 BusyBox Compiling

– Make

9 BusyBox Installing

– make install

9 Just need to copy all files to the target filesystem

– cp -a _install/* /mnt/rootfs/

(17)

ssh, http, …

Servers for the Target

(18)

Advantages of an Embedded Web Server

9 Several devices need something to be able to configure it (for example, the network address)

– Gateway/ Modems, IP Camera, Printer, …

9 Advantages of an embedded Web Server

– No need to develop some specific drivers

– No need to develop a specific configuration application – No need to support different OS

– Just need to develop some HTML pages (static or dynamic

ones) to allow the configuration (with the power of java-script on client side)

– Reduce the hardware costs (no LCD screen, no need to have a lot of storage capabilities on device, …)

(19)

thttpd

9 Tiny/Turbo/Throttling HTTP server:

– http://acme.com/software/thttpd/

9 Simple

– Only implement the minimum of HTTP 1.1 protocol

9 Small at all points of view

– 88KB for 2.25b version against 264KB for Apache – Very low memory consumption (no fork)

9 Portable Code

– Can compile on almost all Unix systems

9 Very quick to answer

– Almost as fast as the complete servers

9 Security

– Designed to protect Web servers from attacks

(20)

Other Embedded Web Servers

9 BusyBox (

http://busybox.net/

)

– 9KB (BusyBox 1.5): includes CGI, authentication, and support for scripts (like php)

9 Klone (

http://koanlogic.com/kl/cont/gb/html/klone.htm

l)

– Can include dynamic page

(in C/C++ <% code %> ) and compressed – Only one executable (about 150KB)

9 Boa (

http://www.boa.org

/)

– Designed to be simple, fast and secured

9 Lighthttpd (

http://lighttpd.net/)

– Designed to manage high number of requests

(21)

Graphical Toolboxes

Graphic Libraries

for the Target

(22)

NanoX / Microwindows

9 NanoX / Microwindows

– http://www.microwindows.org/

– Graphical library running under Linux

ƒ Framebuffer, X / Windows, SVGAlib, and some other graphical systems

9 Advantages:

– Lisence: Mozilla Public License, allowing proprietary applications

– Very light (< 100KB) – 2 APIs (C language)

ƒ API Win32: allows Windows et Windows CE

ƒ Naon-X API: small X server with an API of Xlib type – Documentation of API, FAQs and Tutorials available

9 Limitations

– Lack some support for themes

(23)

NanoX / Microwindows

(24)

MiniGUI

9 MiniGUI

– http://www.minigui.org/

– Mature graphical toolbox

9 Advantages

– Supported architectures: x86, arm, ppc, m68k, mips

– Support Linux / uClinux, eCos, some proprietary RT OS and Win32

– Seams popular and used in many Asian devices – Programming language: C

– About 700KB

9 Limitations

– Needs a commercial license to create a product with

(25)

MiniGUI

Terminals

Set‐Top  Box

Industrial Tools

(26)

FLTK

9 Fast Light ToolKit (pronounce « fulltick »)

– http://fltk.org/

– Pronunciation: « fulltick »

9 Advantages

– LGPL License

– Cross-platform: Unix X11, Windows et Max OS X

– Can create new applications in few minutes with the help of FLUID builder

– C++ Libraries

– Support for 3D graphical (OpenGL)

(27)

FLTK

(28)

9 Simple Direct media Layer

– http://libsdl.org/

– Cross-platform multimedia library

– At the origin, created for video games programming

9 Advantages

– Allow a very low level access: keyboard, mouse, joystick, sound, 3D display (via OpenGL) and 2D (via framebuffer) – Now used for embedded systems

– Native C interface

– Several wrappers for many languages – Many applications and demos available

(29)

SDL

(30)

9 DirectFB

– http://www.directfb.org/

9 Advantages

– C library in user mode

– Designed for embedded systems

– Compact, powerful, flexible et easy to use

– Support for hardware acceleration (with fallback software for actions non hardware supported)

– Abstraction layer to entry possibilities

– Windowing system with transparency management – Many applications and demos available

(31)

DirectFB

(32)

Qt

9 Qt Embedded

http://trolltech.com/products/qt/features/platforms/embedded/

9 Advantages

– Same API as the desktop (easy to develop applications)

– Based on framebuffer (rather than X) with its own windowing system

– Can easily change Look and Feel

– Completely modular: so that, you can limit the size:

ƒ Entre 1.7 et 4.1 MB compressed (3.6 et 9.0MB non compressed) – Support for: arm, x86, mips, powerpc, windows ce

– Integrated with several Java VM

9 Limitations

– Need a commercial license to create new products

(33)

Qt

(34)

GTK

9 Projet GTK+

– http://www.gtk.org/

9 Advantages

– Exactly the same version as the desktop one

– C Library that we can include in several language – Usable with X and DirectFB

– Based on Cairo for vector graphics

ƒ Solutions for system without any FPU

9 Limitations

– Important size with all libraries

ƒ 4.4MB with DirectFB

ƒ 13.4MB with X

9 To see an application example:

– http://www.directfb.org/docs/GTK_Embedded/

(35)

GTK

(36)

A suite of standard applications

Environments for Target

(37)

Opie .

9 Open Palmtop Integrated Environment

– http://opie.handhelds.org/

– Based on Qt Embedded

9 Advantages

– Based on framebuffer (rather than on X) – Include an application suite for PDA

ƒ Contacts, Calendar, … (Personal Information Management)

ƒ Multimedia applications for video and music playing

ƒ Device configuration

ƒ Misc: games, email, …

– Include beautiful icons and interfaces (themes)

9 Limitations

(38)

Opie

(39)

Gnome Mobile .

9 Gnome Mobile

– http://www.gnome.org/mobile/

9 Advantages

– Huge community

(40)

Gnome Mobile

(41)

GPE .

9 GPE Palmtop Environment

– http://gpe.linuxtogo.org/

– Based on the GTK+ toolkit

9 Advantages

– Based on X framebuffer X

– Easy to remotely display the screen of a PC – Set of applications for PDA with LinPhone

– Standard GTK+ application can run with no or not much modifications

– Recognize handwriting on screen display

(42)

GPE

Références

Documents relatifs

In conclusion, the present study is the first to demonstrate the occurrence of lung lactate production after CPB, as indicated by a positive arterio-venous lactate difference,

935 Accessing Shares on Windows Systems ...937 Locating Windows Shares ...938 Mounting Windows Shares at Boot Time ...939 Connecting to Windows Shares from the GNOME Desktop

If you think about that last statement, you begin to realize why NTP must be con- trolled on the network in some way: Any device that can contact your router could form an

The share of each of these incomes in total income and the way they evolve can explain variations in profitability, because the profitability of banks oriented towards retail

provides a go/no go verification of RAM, calendar clock and LTC, the EPROM software monitor has bootstrap routines for RL01 /02, RK05, RX01/02, RM02, TU58 and TM11 storage

Also the education system in schools (including schools for deaf children) has given very little attention to minority religions, languages and cultures, something pointed out by

The implementa- tion strategy followed a complex process including scientific research, information for employees, employers and trade unions, training, and participatory ergo-

On the contrary, at the SIFP meeting I met a group of family physician leaders deeply committed to ensuring that Canadian patients have access to family