... 1Free Software tools for embedded systems © Copyright 20042008, Free ElectronsCreative Commons AttributionShareAlike 2.5 licensehttp://freeelectrons.comJan 24, 2008Free Software tools for embedded systems Free Software tools for embedded systems Thomas Petazzoni / Michael OpdenackerFree Electronshttp://freeelectrons.com/Created with OpenOffice.org 2.x24Free Software tools for embedded systems © Copyright 20042008, Free ElectronsCreative Commons AttributionShareAlike 2.5 licensehttp://freeelectrons.comJan 24, 2008Scratchboxhttp://scratchbox.org/ A crosscompiling toolkit projectMakes it easier to crosscompilea complete embedded Linux system.Works by allowing tools to be crosscompiled in a transparent way, making building tools believe they are doing a native compile job.Supported platforms: arm, x86Uses the qemu emulator to transparently run built arm binaries.Experimental support for ppc, mips and cris.10Free Software tools for embedded systems © Copyright 20042008, Free ElectronsCreative Commons AttributionShareAlike 2.5 licensehttp://freeelectrons.comJan 24, 2008Honey, I shrunk the programs!C program ... 65Free Software tools for embedded systems © Copyright 20042008, Free ElectronsCreative Commons AttributionShareAlike 2.5 licensehttp://freeelectrons.comJan 24, 2008Practical lab – BusyBoxTime to start Lab 2!Get familiar with BusyBox capabilities and configuration optionsConfigure BusyBox in a crosscompiling environmentCompile and test BusyBox66Free Software tools for embedded systems © Copyright 20042008, Free ElectronsCreative Commons AttributionShareAlike 2.5 licensehttp://freeelectrons.comJan 24, 2008Free Software tools for embedded systems Tools for the target devicehttp and ssh servers67Free Software tools for embedded systems © Copyright 20042008, Free ElectronsCreative Commons AttributionShareAlike 2.5 licensehttp://freeelectrons.comJan 24, 2008ssh server and client: dropbearhttp://matt.ucc.asn.au/dropbear/dropbear.htmlVery small memory footprint ssh server for embedded systems Satisfies most needs. Both client and server!Size: 110 KB, statically compiled with uClibc on i386.(OpenSSH client and server: approx 1200 KB,dynamically compiled with glibc on i386)Useful to:Get a remote console on the target deviceCopy files to and from the target device (scp or rsync e ssh).68Free Software tools for embedded systems © Copyright 20042008, Free ElectronsCreative Commons AttributionShareAlike 2.5 licensehttp://freeelectrons.comJan 24, 2008Benefits of a web server interfaceMany network enabled devices can just have a network interfaceExamples: modems / routers, IP cameras, printers ... No need to develop drivers and applications for computers connected to the device. No need to support multiple operating systems! Just need to develop static or dynamic HTML pages(possibly with powerful clientside JavaScript).Easy way of providing access to device information and parameters.Reduced hardware costs (no LCD, very little storage space needed)69Free Software tools for embedded systems © Copyright 20042008, Free ElectronsCreative Commons AttributionShareAlike 2.5 licensehttp://freeelectrons.comJan 24, 2008thttpdTiny/Turbo/Throttling HTTP serverhttp://acme.com/software/thttpd/SimpleImplements the HTTP/1.1 minimum (or just a little more)Simple to configure and run.SmallExecutable size: 88K (version 2.25b), Apache 2.0.52: 264KVery low memory consumption: does not fork and very careful about memory consumption.PortableCompiles cleanly on most Unixlike operating systems FastAbout as fast as fullfeatured servers. Much faster on very high loads (because reduces the server load for the same amount of work)SecureDesigned to protect the webserver machine from attacks.7Free Software tools for embedded systems © Copyright 20042008, Free ElectronsCreative Commons AttributionShareAlike 2.5 licensehttp://freeelectrons.comJan 24, 2008Free Software tools for embedded systems C library for the target deviceC library options70Free Software tools for embedded systems © Copyright 20042008, Free ElectronsCreative Commons AttributionShareAlike 2.5 licensehttp://freeelectrons.comJan 24, 2008Other web servers (1)BusyBox http server: http://busybox.netTiny: only adds 9 K to BusyBox 1.5 (dynamically linked with glibc on i386, with all features enabled.)! Sufficient features for many devices with a web interface, including CGI, http authentication and script support (like PHP).License: GPLKLone: http://koanlogic.com/kl/cont/gb/html/klone.htmlLightweight but full featured web server for embedded systems. Can enclose dynamic (written in C/C++ <% code %>) and compressed content all in an executable of an approximate size of 150 KB.License: Dual GPL / Commercial.See also http://linuxdevices.com/news/NS8234701895.html71Free Software tools for embedded systems © Copyright 20042008, Free ElectronsCreative Commons AttributionShareAlike 2.5 licensehttp://freeelectrons.comJan 24, 2008Other web servers (2)Boa: http://www.boa.org/Designed to be simple, fast and secure.Unlike thttpd, no particular care for memory or disk footprint though. Embedded systems: pretty popular, though not targeted by developers.lighthttpd: http://lighttpd.netLow footprint server good at managing high loads.May be useful in embedded systems too.72Free Software tools for embedded systems © Copyright 20042008, Free ElectronsCreative Commons AttributionShareAlike 2.5 licensehttp://freeelectrons.comJan 24, 2008Free Software tools for embedded systems Tools for the target deviceGraphical toolkits73Free Software tools for embedded systems © Copyright 20042008, Free ElectronsCreative Commons AttributionShareAlike 2.5 licensehttp://freeelectrons.comJan 24, 2008NanoX / Microwindowshttp://www.microwindows.org/License: Mozilla Public License. Allows proprietary applications.Very lightweight (< 100 KB) portable graphics library, running on Linux kernel framebuffer, X / Windows, SVGAlib and a few other systems. 2 APIs (C language)Win32 graphics device API: allows easy porting of Windows or WindowsCE programs.NanoX API: small X server with Xliblike APIAPI documentation, FAQs and tutorial on the project page.Limitation: lack of skin support.18Free Software tools for embedded systems © Copyright 20042008, Free ElectronsCreative Commons AttributionShareAlike 2.5 licensehttp://freeelectrons.comJan 24, 2008uClibc toolchainsFree Electrons uClibc toolchainshttp://freeelectrons.com/community/tools/uclibcRun on i386 GNU/LinuxSupported platformsarm, armeb, i386, m68k, ppc, mips, mipsel, sh17Free Software tools for embedded systems © Copyright 20042008, Free ElectronsCreative Commons AttributionShareAlike 2.5 licensehttp://freeelectrons.comJan 24, 2008Get a precompiled toolchainCan get one from several locations...