Embedded Technology: Embedded Software
This section covers the low-level software, the boot loader and the operating system, that run on an embedded device.
The boot loader is the first piece of code which is run when a processor comes out of reset. It is responsible for the low-level initialisation of the hardware, after which it will load and transfer control to the operating system. Boot loaders can be very simple, doing very little initialisation before passing control to the operating system, or highly complex: providing functionality such as LCD display or booting from USB devices.
Choosing a Boot Loader
Some common embedded system boot loaders are:
- E-Boot (http://msdn2.microsoft.com/en-us/library/aa917791.aspx) - The Windows CE boot loader. E-Boot is a good choice as a boot loader for an embedded device designed only to run Windows CE. E-Boot has the following advantages:
- Normally supplied with the Windows CE Board Support Package.
- Network support for communication with development tools.
- Quick to develop with Microsoft's helper libraries.
The disadvantages of E-Boot are:
- No direct support for booting Linux.
- Closed source.
- U-Boot (http://www.denx.de/wiki/UBoot) - Universal Bootloader. U-Boot has been specifically designed as a boot loader for embedded systems, and closely follows the development of Linux, with some code shared between both projects. U-Boot has the following advantages:
- Well established architecture.
- Initialisation for many CPU's already provided.
- Support for display, file system, network, and external.
- Can be used to boot any operating system.
- Benefit from the huge Open Source community.
- Fully customisable, including boot scripts.
- Open source/GPL
Custom Boot Loaders
In some situations a custom boot loader may be the best option. Custom boot loaders provide the following advantages over other common boot loaders:
- Smaller and faster than more flexible boot loaders.
- Not constrained by multi-platform compatibility.
- Source model and license can be customised to suit the project.
However they also have the following disadvantages:
- Requirements must be set in stone before development starts.
- All components must be created from scratch adding to the development time.
Bluewater Systems recommends using U-Boot as the bootloader for most embedded devices because it is cross platform, open source, fully featured and easily extendable. Even if a custom bootloader is required for performance reasons, we recommend using U-Boot during development.
The operating system on a device is responsible for managing all of the hardware and software resources in a system. The operating system is responsible for tasks such as:
- Allocating system memory to programs.
- Controlling input and output devices.
- Managing the filesystems.
- Scheduling user programs.
- Providing an abstract interface to the system resources.
Operating systems on embedded devices can either be "open" or "closed" platforms. An open platform allows the user of the device to customise the application software. An example of an open platform is a PDA running a graphical desktop. A closed platform is an device which cannot be modified by the user. An example of a closed platform is a portable music player.
Operating systems are also divided into real-time and non-real-time systems. Real-time operating systems (RTOS) are able to guarantee that deadlines for for processes can be met accurately. This is called hard real-time and is necessary for systems used in industrial control, medical monitoring and vehicle navigation. A guide to selecting an RTOS can be found at: http://www.netrino.com/Articles/RTOSes/index.php. Non-real-time systems cannot provide this guarantee, but often employ soft real-time which allows deadlines to be met as long as the processor is not busy. An example of soft real-time is a music player, if the processor becomes busy the music may stutter. Both Linux and Windows CE are soft real-time systems. Extensions for Linux are available for providing hard real-time (see: http://www.realtimelinuxfoundation.org/), however Bluewater Systems does not directly support these.
Chosing an Operating System
The choice of operating system for an embedded device depends on many factors. The major embedded operating systems supported by Bluewater Systems are:
- Linux (http://www.kernel.org/) - From the Linux kernel website: "Linux is a clone of the operating system Unix, written from scratch by Linus Torvalds with assistance from a loosely-knit team of hackers across the Net. It aims towards POSIX and Single UNIX Specification compliance." The advantages of Linux are:
- The operating system and development tools are free.
- Large choice of high level software features and applications.
- Highly customisable.
- Benefit from huge open source community.
- Open source/GPL.
The disadvantages of Linux are:
- Loose integration of components and development tools.
- Developing graphical applications can be time consuming.
- Windows CE (http://msdn2.microsoft.com/en-us/embedded/aa731407.aspx) - Microsoft's embedded operating system. Windows CE provides a familiar user interface to users of the desktop variants of Windows, although the underlying architecture is quite different. Windows CE has the following advantages:
- Designed as an open system.
- Fast time to market.
- One stop shop for tool-chain and operating system components.
- GUI based kernel and feature development tools.
- Comprehensive application development tool support.
- Familiar win23 API to desktop windows.
- Large amount of third party application support.
The disadvantages of Windows CE are:
- Closed source.
- Runtime license cost.
Bluewater Systems recommends the choice of embedded operating systems on a case by case basis. Windows CE has a quick time to market at the expense of runtime royalties. Linux has free development tools and no runtime cost, but has a higher learning curve. For open platforms, we generally recommend Windows CE due to the large amount of third party application support. For closed platforms, we recommend using Linux due to is high level of customisability.