November
1998, Issue 100
Embedded
RT-Linux (Part 1):
General Introduction
WHY
LINUX?
Naturally,
this question is tugging at your brain. There are several
reasons to consider Linux as an embedded operating system
for many applications.
For
one thing, its freely available and includes a
TCP/IP stack. Also, it has multiarchitecture support
for Intel, 68k, PowerPC, Alpha, Sparc, SMP, and others.
So, you can obtain and begin using Linux with very little
trouble.
One
of the great benefits of using Linux is the large support
network that exists for it, and lets not forget
the fact that Linux supports many devices and bus architectures
right out of the box. Of course, Linux is somewhat modular
and there are many tools and programming languages available.
With features like this, Linux starts to make more sense,
huh?
Lets
talk about these points in more detail. I already mentioned
that Linux is freely available. Obviously, thats
nice because you wont pay royalties for embedding
Linux in your product. But, you need to make sure all
of the modules and components you plan to use for your
project are freely available. Most are.
You
can download most Linux distributions from the Internet.
But, this can be tedious over a slow link, so most of
us opt to buy a CD-ROM. Yet, being able to download
a distribution over the Net is extremely useful
if youre in the field and need to upgrade you
embedded system or get a new version of a device driver.
Linux
has a TCP/IP stack built in. The TCP/IP implementation
is very robust, since many Internet-service providers
use Linux for their high-throughput web servers. The
programming interface for the TCP/IP stack is the standard
Socket API.
Linux
runs on a multitude of architectures. Im only
going to talk about the Intel port, but its good
to know that youre not stuck with Intel. Some
of the details in each port are different, but for the
most part, Linux is Linux, at least at the application
level.
Linux
is ported to 68k, which includes VME-bus modules, Alpha,
and PowerPCs. And, theres a port in progress for
MIPS processors.
The
US Robotics Palm Pilot may be the smallest system that
Linux is ported for. Its a PDA based on Motorolas
68328 Dragonball processor. Theres also work in
progress to port Linux to smaller Intel processors,
like the 80188.
Since
Linux has such a great following, theres a large
support network. Although many people provide Linux
support by writing or porting applications and drivers
in an effort to attain fame and glory, there are also
several companies that are providing commercial support
for Linux. Often, these companies reintegrate the fixes
into the Linux kernel development effort.
There
is yet another side effect to this large support group.
Many of the fame-and-glory developers are students who
have learned OS internals by observing the Linux kernel,
and theyll eventually enter the job market.
Consequently,
the number of software engineers familiar with Linux
is growing, and theyre even proficient at the
kernel level. Thats good news, and perhaps one
compelling reason why much of Linux will stay freely
available with the GPL.
There
are a great number of device drivers available for Linux.
Because Linux has been ported to so many different architectures,
it supports various bus architectures, like ISA bus,
PCMCIA, PCI, VME bus, S-bus, and others.
Many
vendors of PC-compatible cards have Linux drivers available.
While the quality of device drivers for Linux varies,
many popular cards and chip sets are well supported.
Also, theres hope of fixing or adapting the device
driver for your purposes, since sources are available
for most device drivers.
Drivers
are available for just about all of the Ethernet chip
sets, all standard AT peripherals (COM, IDE, floppy,
etc.), and many VGA chip sets. Also, many CD-ROMs and
SCSI devices are supported. Table 1 shows a list of
devices that are supported in an older distribution
of RedHat.
| Table 1Here
is a list of some of the devices that are typically
supported with a standard Linux kernel. In addition
to these devices, many peripheral-card vendors
also offer Linux-driver modules for their cards.
Ethernet Controllers
3Com 3c501 (throw it away!)
3Com EtherLink II
3Com Etherlink Plus
3Com EtherLink16
3Com EtherLink III
3Com 3c590/3c595 Vortex
Ansel Communications Model 3200 EISA Ethernet
adapter
Apricot 82596
ARCnet for IP driver
Allied Telesis AT1700
DE425, DE434, DE435, DE450, and DE500 DEC EtherWORKS
cards
D-Link DE-600 Ethernet pocket adapter
D-Link DE-620 Ethernet pocket adapter
DEC DEPCA and EtherWORKS DE100, DE101, DE200,
DE201, DE202, DE210, DE422
Digi RightSwitch SE-4, SE-6
Cabletron E2100
EtherExpress Pro/10
EtherExpress
ICL EtherTeam 16i/32 EISA
EtherWORKS 3: DE203, DE204, DE205
Fujitsu FMV-181/182/183/184
HP PCLAN/plus
HP LAN
HP10/100VG ANY LAN: J2577, J2573, 27248B, J2577,
J2573, J2585
Shared-memory IBM Token Ring 16/4
AMD PCnet32, PCnetPCI
NE1000, NE2000, and compatible
NI5210 Ethernet
NI6510 Ethernet
Parallel Link Internet Protocol
Sangoma S502/S508 series multi-protocol PC interface
card
SMC Ultra, SMC EtherEZ ISA
SMC 9000 series Ethernet
Starmode Radio IP
DEC 21040, most 21*40 Ethernet
AT&T GIS (nee NCR) WaveLAN Ethernet-like
radio transceiver
WD8003- and WD8013-compatible ether cards
SCSI Host Adapters
SCSI driver for Symbios/NCR 53c700 series
and 53c800 series host adapters
BusLogic MultiMaster (NOT Flashpoint) SCSI host
adapter driver
NCR53c406a-based SCSI host adapter driver
AdvanSys SCSI host adapter driver
Adaptec AHA-152x host adapter driver
Adaptec AHA-154x and 631x-based host adapter
driver
Adaptec AHA-174x host adapter driver
Adaptec AHA-2740, 28xx, 29xx, 39xx, aic7xxx-based
host adapter driver
DTC 3180/3280 host adapter driver
All DMA-capable DPT SCSI host adapters
All PIO-capable DPT SCSI host adapters
Future Domain TMC-16xx SCSI host adapters
IN2000 SCSI host adapters
Symbios/NCR 53C810, 53C815, 53C820, 53C825 SCSI
host adapters
Pro Audio Spectrum/Studio 16
IOMEGA PPA3/Parallel ZIP
Qlogic FAS408 SCSI host adapter
QLogic ISP1020 SCSI host adapter
Seagate ST-01/02, Future Domain TMC-8xx SCSI
host adapter
Trantor T128/T128F/T228 SCSI host adapter
UltraStor 14F/34F (not 24F) SCSI host adapter
UltraStor 14F/24F/34F SCSI host adapter
WD7000-FASST2/WD7000-ASC/WD7000-AX/WD7000-EX
SCSI host adapter
CD-ROM Drivers
Aztech CD268 CD-ROM driver
Sony CDU-31A CD-ROM driver
Philips/LMS cm20 CD-ROM driver
GoldStar R420 CD-ROM driver
ISP16/MAD16/Mozart soundcard-based CD-ROM driver
Mitsumi CD-ROM driver
Mitsumi XA/Multisession CD-ROM driver
SoundBlaster Pro/Matsushita/Panasonic/Longshine/CreativeLabs/TEAC/ECS-AT
CD-ROM
Sanyo CD-ROM device driver
Sony CDU-535 CD-ROM driver
|
However,
a flash file-system driver isnt supported. Thats
unfortunate. It would be nice for working with embedded
systems. Hopefully, someone is working on it.
But,
all is not lostits still possible to boot
Linux from a flash file system. Flash disks, like SanDisks
CompactFlash devices, work under Linux because it acts
just like a IDE drive. Next month, Ill look at
these issues in detail when I embed Linux.
Linux
supports dynamic module loading, which means libraries
and devices drivers can be loaded by the OS after boot
time to extend the base functionality of the kernel.
Dynamic modules are nothing new, but they do make configuration
easy.
You
build a simple kernel that can be configured to deal
with different device configurations by changing a configuration
file. This construction also improves memory use, since
only the required device drivers are loaded when needed.
Of course, you can still configure a Linux kernel to
be static by compiling in all the device drivers it
needs for a particular application.
Many
applications and programming languages are available
for Linux. This feature might not be important for building
embedded systems, but its nice to have access
to all the applications on your development system.
The
normal compiler used for Linux is the GNU C compiler
(a complete C, C++, and Objective C compiler). The companion
debugger (gdb) is flexible and can even deal with remote
debugging via Ethernet or serial port. This capability
means that you can debug your embedded system remotely
from a desktop or, in my case, a laptop. Of course,
you can also run the debugger on the console of the
embedded system.
In
conjunction with the GNU C compiler and related tools,
youll find commercial compiler and development
environments. I listed one compiler vendor in my sources,
and you can find others in the Linux Journal.