Embedded Linux Ori
Embedded Linux Ori
1. INTRODUCTION
Linus Torvalds has been insisting for some time that a prominent part of
Linux's future lies in embedded systems, a rather unglamorous child of the
computer world.
Either way, whether you decide to use pure open source, or to mix open
and proprietary software components, using Linux in embedded applications is
unlikely to be totally "free" of costs. You'll need to either invest time and
resources to create your own implementation, or spend money on tools and/or
licensed components, or pay for outside services and support.
hat said, there are certainly a wide variety of excellent open source tools and
utilities which you can download free of charge; and, there are also excellent
proprietary tools and utilities which, if you choose to use them, you must license
or purchase from their suppliers. Then too, bear in mind that the companies who
offer "commercial" Embedded Linux distributions generally possess a high level
of expertise and have well trained staff ready and waiting to assist you with your
project -- for a price.
Taken as a whole, there are a great many options -- both open source and
proprietary -- which fall into the following categories . . .
• Linux kernel implementations -- a wide range of shapes and sizes of
Linux, including reduced footprint implementations, versions that do not
require the presence of a memory management unit (MMU), and
enhancements and add-ons to support the "hard", "firm", or "soft" real-
time responsiveness of performance-sensitive applications such as
streaming media, IP telephony, and robotics.
capabilities.
You don't have to go too many years back to recall a time when designing
and building embedded systems was a relatively uncomplicated matter. Not that
the process was easy -- there simply weren't many choices to make. Combine a
few inputs and outputs with some time critical components and, voila, you had an
embedded system.
were not extremely interesting -- or powerful for that matter. These were the days
of the 'deeply' embedded devices: relatively simple devices that did not require
much human interaction or control. Turn them on and they went to work,
sometimes for years at a time.
Strictly speaking, most devices that interact directly with humans are
classified as "soft" real-time. There are, of course, exceptions to every rule. For
example, a pilot's interaction with the controls of a jumbo jet are certainly "hard"
real-time. But if a web page sometimes takes a few more seconds to load, the
world will not come crashing to a halt and people will not be hurt. This is the
realm of human-interactive embedded devices, and an example of an
environment where Linux can be very effective.
Once a project team has decided on Linux, the fun begins. Because many
ports are available for Linux, it is easier to start with than operating systems that
require building upon or modification for the specific application at-hand.
Also, because Linux is open source, the developer has far-reaching debug
capabilities -- a feature that is often far more valuable then many tech support
plans. Many times, issues that arise can be debugged because the developers have
all of the source code. Support questions that come up often involve simply
pointing developers in the right direction to find the right code to see which
control is where in the source tree.
Having source code also gives the development team protection from
software problems over which they have no control. Linux provides explicit
control over all of the software elements in the project. Any developers who have
waited for a vendor to fix an annoying bug in a library understand the real value
in having the source code.
Many of the required drivers have already been written and are available
in the open source realm. Some vendors even supply entire development kits
which not only contain all of the drivers, but already have the complete
development environment integrated so that developers may start immediately
with their software implementations.
The network stack is another big portion of the Linux equation. Linux is
known for its strong networking performance and robustness. The Linux stack
contains essentially the same interface found in Unix. The same socket calls can
be made, and useful return and error codes are present. Running a Linux stack
pretty much guarantees a compliant stack, and if bugs are found that cannot be
resolved in the source by the developer, the community is usually quick to
address them. Source availability can be added by the development team if a
special networking function needs to be because they have the source code. This
means a device can respond in an application-specific manner when prompted by
the special initialization packet of the design.
There are three tools in common use for configuring the kernel: make config,
make xconfig, and make menuconfig. Each of these tools essentially do the same
thing: configure the Linux kernel. Although many applications may be able to
forego the process of configuring the kernel, every Linux development effort
should, at a minimum, scan the contents of the kernel and classify each element
as necessary or not.
The first step in configuring the Linux kernel for your specific target is in
understanding the directory system used on the Linux development platform. The
following subdirectories will be present on most Linux development
environments under the top-level directory . . .
/arch -- This directory contains the code that is specific to the architecture.
Each supported platform will have its own subdirectory like arch/i386, or
arch/armnommu.
/drivers -- this area is further broken out into specific types of drivers, like
block, char, cdrom, or scsi. There is a sub-directory for each major type. This
is where you would add your own code needed for your specific target.
/fs -- this directory contains all of the support code for file systems like ext2,
minix, or even msdos.
/include -- this directory contains all of the needed header files. It is further
broken down into architecture specific sub directories, much like the arch
directory.
/init -- this optional directory can contain the bootstrap code, which runs
when the target is first powered on.
/kernel -- this contains the main kernel code including the scheduler.
/mmnommu -- this is the version of the mm directory used for processors that
do not contain an mmu, like 68K, or some arm processors.
The kernel build process is not a straightforward process and can get
complicated quickly. Since there are so many make files and subdirectories and
code trees, it is probably easiest to keep the build process automated. Using a
script to make sure the build process is done exactly the same way every time is
recommended. A script can also make and check the dependencies so the
developer can focus on other more interesting parts of the code. In the NetSilicon
NET+Works 32-bit RISC product, ported to uCLinux, the kernel build process is
automated in this way. The entire build for the kernel is contained in a single
build.sh script file. This ensures that every time the build is done, it is done
correctly and exactly the same way as before.
3.4.1 Drivers
Usually, it is easiest to find drivers that have already been written and then
port them to your target. If the development team has purchased an integrated
Linux development environment, such as the NET+Works uCLinux development
kit from NetSilicon Inc., the development kit should contain full BSP and drivers
for most all components in the hardware. This is the best place to start when
doing the development. At a minimum, a provided package should include an
Ethernet driver, a couple of different serial drivers, and drivers for whatever other
hardware exists on the system.
The sources for these drivers is contained in the arch/drivers directory and
are placed according to major grouping, whether they be char drivers, block
drivers, or SCSI drivers. Driver code added to a project would most likely go into
this directory structure and be added to the driver makefile that would then be
built into the kernel using the build.sh script file which builds the entire kernel
directory structure.
Some designs may be able to run with as little as 256KB of ROM and
512KB of RAM. Much tweaking and snipping will need to be done to develop
such a system, and there would likely be little room left for the application or any
graphics for web pages. This system would truly be somewhat limited and might
not be a good fit for a Linux device. A more typical memory space is on the
order of 2-4 MB of ROM, and 4-8MB of RAM. This system allows for a fully
functional kernel with various drivers built in, and a shell program to allow
remote users to log into the system. Such a system also becomes a more versatile
development platform that can reduce the costs for follow on projects using the
same platform.
You might think the simple answer would be "Because it doesn't cost anything!"
Not so!
These results are intriguing in several respects. First, the popular notion of
programmers hacking away at source code to create custom versions of Linux
was not borne out by the survey. Instead, developers place a high value on having
source code as a way to avoid being held hostage to proprietary OS providers.
Also, having source code makes it much easier to find out what's going on inside
the system. Choices like "so I can modify the software" and "so I can fix bugs"
did receive a fair number of votes, but in the overall scheme of things these ended
up at the bottom of the list.
Interestingly, the reason that topped the list was "the collaborative open
source development process produces superior software." What's especially
significant about this finding is that it's not something that proprietary software
The survey also asked developers to identify their main reasons for
wanting to use Linux in embedded applications. Here, the respondents were
asked to select all of the reasons they felt were important from among the
following choices . . .
To delve a bit deeper into the cost issue, we asked a pair of questions related to
costs . . .
The results appear in the following two graphs.(Note: the second question
was added more recently, so the results shown here are based on a relatively
small sample of data.)
What we learn from this is that while embedded developers are indeed
prepared to invest money in outside services and support for embedded Linux
(68% said yes, and only 13% said no), the numbers are nearly flip-flopped when
the question is about willingness to pay per-unit royalties (51% said no, and only
21% said yes).
In short, two years ago (1999)the "Embedded Linux Market" simply didn't
exist. Much has changed since then. Numerous companies have jumped on --
and off -- the fast-moving Embedded Linux bandwagon, which seemed more like
a rocketship much of the time. The technology and Linux stock "market bubbles"
offered plentiful investment capital and fueled unnaturally rapid growth of Linux
companies (including a handful of Embedded Linux companies) beyond their
ability to sustain themselves from actual revenues. For some, the bursting of the
bubble left them either out of business or in search of different businesses. For
others, it meant tightening the belt and settling down to a more traditional
business model. Throughout all of this, though, the benefits of using Linux in
smart devices and embedded systems have not only persisted, but grown
exponentially. The newly established Embedded Linux vendors have provided
new tools, OS extensions, middleware, and support to enhance the value of using
Linux in embedded applications. In parallel, "ordinary" Linux itself has evolved
at a rapid pace. And the result has not been missed by those who make the
design decisions. The following recent market studies and overviews testify to
the growing prominence of Embedded Linux as the embedded OS of choice . . .
The study also found keen interest in tools and products that can help
developers get their projects completed correctly and on time, suggesting that
inefficiencies endemic to this industry are gradually being overcome. Two-thirds
of the developers reported a high incidence of embedded projects that are started
and never completed, as well as a high proportion of projects delivered late.
• More than 45% expect to release a Linux application in the coming year;
14% have already released a Linux application
• More than 80% said Linux is important to the embedded system
development community
• Open source code, royalty-free licensing and a large community of
knowledgeable developers were cited as Linux's key benefits
• Factors slowing Linux adoption include lack of specific board support
packages, availability of device drivers and fragmentation of the code base
• Some 15% of developers report that between 26% and 50% of their
projects are never finished. Forty-one percent report that up to 25% of
projects are abandoned
This is especially significant in light of the fact that more than 80% of the
microprocessors manufactured each year end up in embedded, rather than
desktop computing applications. Typical embedded applications include
industrial control, telecommunications, military systems, avionics, medical
equipment, point-of-purchase systems, and consumer electronic devices.
8.2 Which embedded OSes have you used in the past 12 months?
The results of the survey also indicate that developers aren't just thinking
about using Embedded Linux in their projects -- they're using it, too. In answer to
the question "Which 16 or 32-bit RTOS or kernel vendors have you used in the
last 12 months for your embedded designs?", Embedded Linux jumped from
essentially unmentioned in 1998 and 1999, up to 4th place (12%) in 2000. The
following chart shows the top six OS choices in response to this question, again
sorted by their 2000 ranking.
The Linux operating system has been available for years for servers and
desktops, and has continued to gain market share in both of these computing
segments. Helping to drive this growth and lend creditability to Linux are well
established companies such as IBM, Dell, Hewlett-Packard, Compaq, Oracle, and
others. Linux, originally developed for the desktop and adapted for servers, is
now making in-roads into the highly fragmented embedded market.
figure, below). By 2005, VDC estimates that shipments will reach $306.6
million, a compound annual growth rate (CAGR) of 61.2%.
In 2000, the annual developer fee was the largest category, followed by
professional services, unbundled software development tools, and run-time
royalties:
Annual Developer Fee
Professional Services
Unbundled Software Development Tools
Run-time royalties
Other
In 2000, the global market for Linux OSs was relatively small with no
dominant market player. VDC estimates that Lineo, MontaVista, and Red Hat (in
alphabetical order) are ranked in the top tier, with many companies trying to gain
a foothold in this burgeoning market, focusing on specific vertical segment(s).
Findings include . . .
• Linux, originally developed for the desktop and adapted for servers, has
done well in these markets, and is making in-roads into the highly
fragmented embedded market.
• There are several different business models for embedded Linux vendors
who are focused on branding builds of their distribution and adding value.
levels.
In short, embedded Linux arrived on a scene that was already in the midst
of great upheaval, with developers working hard and fast to apply newly
available technologies to newly defined challenges. Because it provided low cost,
open source, yet state-of-the-art functionality, Linux was well positioned to be
swept along by the tide of change in the embedded sea. The open availability of
source, coupled with today's unheralded ease and speed of collaboration and
communication, turned out to be compelling factors that enabled developers to
quickly and efficiently adapt to the challenges of a rapidly changing landscape.
So Linux began to spread like wildfire in the embedded market.
10. CONCLUSION
11. REFERENCES
1. www.LinuxDevices.com
2. www.LinuxPlanets.com
ABSTRACT
CONTENTS
1. Introduction
7. Study finds 300% growth in embedded Linux development Jul. 30, 2001
10. Conclusion
11. References
ACKNOWLEDGEMENTS
Reethi M