Embssedded App Dev
Embssedded App Dev
Embssedded App Dev
The Linux distribution includes kernel support for all of the technologies required for modern 32bit processors, increasingly found in embedded systems designs. This includes support for
memory management, process and thread creation, interprocess communications mechanisms,
interrupt handling, execute-in-place ROM filesystems, RAM filesystems, flash management, and
TCP/IP networking. Various developer groups and commercial companies concentrate on
specific technologies, with GPL modifications being returned to the standard Linux distribution
available from http://www.kernel.org. Included in distributions is compiler support for the target
processor architectures, along with user mode libraries for application startup. The GNU C
Compiler project, at http://gcc.gnu.org, maintains up-to-date versions of compilers for each
architecture.
Embedded Linux distributions typically provide cross-development support for a target platform
from a host environment. Because the GCC compiler runs across a wide variety of platforms,
host development platforms running Linux, Solaris, and Microsoft Windows are becoming
available. Sophisticated development tools, such as the make program maintainance tool, allow
complete applications to be cross-compiled and linked using a single command. A big advantage
of using a Linux based host development platform when developing a Linux-based target
application is that in many cases, major parts of the target application can be built and tested on
the desktop while designing and building the target hardware device. Using graphical windowing
environments like the X Window System and Microwindows allow complete graphical emulation
of the target graphical hardware without having to cross-develop and download every change.
Some of these development features are unique to Linux and are further pushing its advancement
and use in leading embedded systems designs.
In the next part of this paper, I will give a short discussion of various parts of the Linux operating
system and some graphical windowing system alternatives.
A very complete implementation of the standard TCP/IP networking protocol suite, including
TCP, UDP, IP, and ARP is found in the Linux kernel. In addition, complete support for NFS,
DNS, DHCP, PPP and SLIP is included by applications programs. Linuxs networking support
and configuration customizability make Linux well suited for the mobile and Internet appliance
markets, where data communications is a key technology.
Microwindows Features
Microwindows was designed to attempt to bring applications to market quickly, with a minimum
of effort. In order to accomplish this, it was felt that designing yet another graphics applications
programming interface (API) would steepen the learning curve, thus discouraging interest and
increasing time-to-market. Microwindows implements two popular graphics programming
interfaces: the Microsoft Windows Win32/WinCE graphics display interface (GDI), used by all
Windows CE and Win32 applications, and an Xlib-like interface, known as Nano-X, used at the
lowest level by all Linux X widget sets. This allows the extremely large group of Windows
programmer talent to be used in developing the graphical side of the application, as well as being
familiar to the core group of Linux graphics programmers used to working with X.
Microwindows runs in 100-600k of memory, and including all associated libraries, is an order of
magnitude smaller than the X Window System. This is primarily the result of using a single
routine for each of the drawing functions in the engine layer. The engine layer checks for
clipping and calls a driver-level routine for drawing a pixel or line if unclipped. The X Window
System duplicates the entire drawing routine for each pixel depth and has clipped and unclipped
versions for speed. This is useful when running large desktop displays, but rarely required for
embedded systems.
Microwindows fully supports the new Linux kernel framebuffer architecture, and currently has
support for 1, 2, 4, 8, 16, 24, and 32 bits per pixel displays, with support for palettized and
truecolor display color implementations, as well as grayscale. With both APIs, all colors are
specified in the portable RGB format, and the system has routines to convert to the nearest
available color, or shade of gray for monochromatic systems. Although Microwindows fully
supports Linux, its internal, portable architecture is based on a relatively simple screen device
interface, and can run on many different RTOSs as well as bare hardware. This brings a big
benefit: graphics programming by the customer can be shared between projects, and even run on
different targets with different RTOSs, without having to rewrite the graphics side of the
application.
Microwindows supports host platform emulation of the target platform graphically. That is,
Microwindows applications for Linux can be developed and prototyped on the desktop, run and
tested without having to cross-compile and run on the target platform. This is accomplished
using Microwindows X screen driver, where the target application is run on the desktop host and
displayed within an X window. The driver can be told to emulate exactly the target platforms
display in terms of bits per pixel and color depth. Thus, even though the desktop system is 24 bit
color, it can display a 2bpp grayscale for previewing the target application. Since both the host
and target are running Linux, most all operating system services are available on the desktop host.
There are significant differences in the way that programmers familiar using Microsoft Windows
or the Linux X Window System implement graphical applications. Microsoft Windows
programmers typically use Microsofts Foundation Classes (MFC) C++ applications framework,
or the newer Active Template Library (ATL) framework. Source code is provided for both of
these interfaces, and both must use the Win32 GDI for all graphics drawing. Windows also
includes quite a few user interface controls that are useable from the Win32 GDI, including
buttons, listboxes, and the like. The X Window System, on the other hand, provides a low level
interface known as Xlib, which implements low level drawing primitives only, and packages
them up for execution on the display server. Most user interface solutions rely on widget sets
implemented on top of Xlib, for modern functionality. We are working at porting some of the
more popular widget sets to Microwindows, including GTK+/GDK, the basis of the GNOME
projects desktop, and FLTK, a small C++ toolkit which implements quite a few user controls.
Microwindows Architecture
A key component in the design of Microwindows is to keep things small. Although this can
sometimes preclude implementation of more complex applications, the Microwindows design has
distinct separation of driver level, engine level, and API level functionality so that, if desired,
complex functionality can be added on an as-needed basis without complicating the entire design.
Each of these implementation levels will be discussed in more detail below.
At the lowest level, Microwindows abstracts a data structure for a display screen, a mouse or
touchpad input device, and a keyboard device. This structure appears identical on the top side,
for use by the drawing engine, and includes code to interface with the specific device the driver is
written for. Microwindows includes drivers for quite a few different devices and operating
systems, with more being included with each release. Screen drivers for the Linux framebuffer
include support for displays running 1, 2, 4, 8, 16, 24 and 32 bits per pixel, supporting palettized,
grayscale, and truecolor display. The screen driver definition includes entry points for reading
and writing a pixel, drawing a horizontal or vertical line, and optionally, blitting memory from the
screen to memory or vice versa. By implementing only these basic entry points, all of the upper
level Microwindows functionality, including TrueType or Adobe Type 1 font support, RGB
colors, jpeg and bmp image handling, will run. If your screen device has hardware acceleration,
or a peculiar method of implementation in one of these areas, a modication to the driver is all that
is required. In the same manner, touchscreen and keyboard/button input is brought into the
system.
At the middle level of Microwindows is the drawing engine. This code is device-independent,
since all drawing is implemented by calling a screen driver. The drawing engine presents a set of
standard entry points for the API level above to call for drawing functionality. The
Microwindows engine abstracts an RGB color model for all colors, regardless of the physical
display device. Routines are provided that determine the hardware pixel value from an RGB
triple, using the same interface regardless of whether the physical display is running pallettized
grayscale or truecolor. In addition, Microwindows implements all clipping at the engine layer,
using a fast, multiple-rectangle approach that allows for arbitrarily complex regions to be
specified for drawing. All font display is handled at the engine layer, including our new support
for Unicode-based TrueType fonts using FreeType, and Adobe Type 1 fonts using T1Lib.
Compiled in proportional fonts are also supported. The engine implements anti-aliasing using
alpha blending for smoother looking fonts on higher resolution displays. Currently, support for
Ascii, Unicode-16, Unicode-32, UTF-8, Chinese GB2312 and Big5 encoding are supported.
The uppermost level of Microwindows implements one of the two supported APIs. At this level,
the window abstraction is implemented, which allow applications programmers to contain their
display data in a full screen or overlapped window. This layer is also responsible for event
handling, and passing received hardware events such as touch screen or button presses to the
application.
The Nano-X API allows applications to be built using a client/server protocol over a network
socket, or local UNIX domain sockets. This allows several applications, running on the
embedded device or a remote host to connect to the Microwindows server to for display. In
addition, the client/server protocol can use shared memory for passing data between the client and
server. A compile time option allows all applications to be linked with the server for smaller
Conclusion
The Linux operating system is well suited for use in the rapidly growing embedded computing
market. Its technologically advanced kernel, open source development model, free availability
and royalty free distribution make it an ideal choice for future designs. The large developer
environment and fast pace of contributions ensure that Linux will meet the requirements of
emerging embedded and mobile applications for some time to come.
Links
www.kernel.org
gcc.gnu.org
microwindows.org
xfree86.org
www.viewml.com
www.kde.org
www.gtk.org
www.fltk.org
embedded.centurysoftware.com
www.linux4.tv