Embedded Linux
Using Pee Wee Linux
Presented by
Randy Torgerson
Ascendco Scientific, Inc
for
Linux System Administrators
June 3, 2002
Ascendco Scientific, Inc. page 1
www.ascendco.com
Who is Ascendco Scientific, Inc?
We are engineering consultants that design hardware and software for
embedded systems products. Our expertise is in x86, PowerPC,
ColdFire, ARM, and microcontroller systems running Linux, VxWorks, or
custom software.
Ascendco Scientific, Inc. page 2
www.ascendco.com
Embedded Linux
What is an Embedded System?
An Embedded System is any computer system
or computing device that performs a dedicated
function or is designed for use with a specific
embedded software application
Examples: ATM, Microwave, Tivo
May or may not have an operating system
Designed to run specific tasks
Generally has just enough resources for the
tasks that are to be run
Ascendco Scientific, Inc. page 3
www.ascendco.com
Embedded Linux
Definitions
RTOS - Real Time Operating System
Deterministic - The ability to respond to an event
within a specific amount of time
Preemptible - The ability to have a process
interrupted by a higher priority process
Task Scheduler - The part of the kernel that
determines what other processes will run and
when
Ascendco Scientific, Inc. page 4
www.ascendco.com
Embedded Linux
RTOS
Hard Real Time
Deterministic
Missed events can have catastrophic results
Soft Real Time
Not deterministic
Can tolerate missed events
Real Fast
High throughput
Linux is not Real Time . . . yet
Ascendco Scientific, Inc. page 5
www.ascendco.com
Embedded Linux
Linux is not Real Time
Kernel is not preemptible
Task scheduling is not priority based
RTLinux and RTAI runs Linux as a process
under a proprietary real time kernel
Hardhat Linux uses the preemptible Kernel
Preemptible Kernel maybe integrated into Kernel
release 2.6
Ascendco Scientific, Inc. page 6
www.ascendco.com
Embedded Linux
Embedded Linux Toolkits
Pee Wee Linux
HardHat Linux from Monta Vista
BlueCat Linux from Lynux Works
The Embedded Debian Project
Embedded DevKit from Red Hat
Linux Router Project
Ascendco Scientific, Inc. page 7
www.ascendco.com
Home Automation Project
Objectives
Lighting Controller using X-10 powerline
interface
AC Energy Monitoring using custom energy
monitoring board
Security Camera
Web Interface for remote access and control
Learn Embedded Linux
Ascendco Scientific, Inc. page 8
www.ascendco.com
Home Automation Project
Why LxSA and Embedded Linux
Most problems have been with configuring the
development station and not on the client
With Embedded Linux you will get a good
understanding of the internals of Linux
Working on the small Linux system allows for in-
depth understanding of the boot process and file
system
Ascendco Scientific, Inc. page 9
www.ascendco.com
Home Automation Project
Development System
Dell 866 MHz Pentium III with 128MB
Redhat Linux 7.1 with KDE desktop
USB CompactFlash Adapter - Allows for quick
update of target file system
Ascendco Scientific, Inc. page 10
www.ascendco.com
Home Automation Project
ABIA Tech FB2310 All-In-One
PC/104 single board
computer. 386SX, 40MHz,
4MB RAM
64MB CompactFlash Disk on
a IDE to CompactFlash
adapter board
Two Serial Ports, Parallel Port
10baseT Ethernet
Sockets for 1.5MB Flash
Video is provided by an
Orchid Prodesigner IIS ISA
card and a PC/104 to ISA
Adapter
Ascendco Scientific, Inc. page 11
www.ascendco.com
Home Automation Project
Target Software
PeeWee Linux with Kernel 2.2.17
The web server is thttp
The current image is 3.9MB and will be reduced
as unneeded tools are removed
The Kernel will also be compiled to run in place
and put in the 1.5MB Flash sockets
Ascendco Scientific, Inc. page 12
www.ascendco.com
Home Automation Project
Problems
gcc 2.96 with Redhat 7.1 cannot compile the 2.2
kernel, must use kgcc
Must use the compatibility libraries:
compat-glibc, compat-egcs, compat-libs,
compat-libstdc and run script before compiling
Path on development system get corrupted
during boot and prevents proper compiles
PATH=/usr/kerberos/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bi
n:/home/randy/bin _=/usr/bin/env
Ascendco Scientific, Inc. page 13
www.ascendco.com
Pee Wee Linux
Based on Redhat 6.2
Kernel 2.2.17-13
Can run on Redhat 7.1 or other systems with
a little work.
Actively maintained and has an email group
i386, i486, Pentium I, II, and III targets only.
Uses Ncurses character interface.
Ascendco Scientific, Inc. page 14
www.ascendco.com
Pee Wee Linux
Development Process
Write down what you want to accomplish
Select the Embedded Linux Tool kit that fits your
needs
Install the tool kit on your development system
Proof the build process with a minimal project
Down load to the target and test
Add features and test
Ascendco Scientific, Inc. page 15
www.ascendco.com
Pee Wee Linux
Project Development Process
Create custom kernel package
Configure custom file system
Extract the file system for project
Configure target hardware
Load file system onto target
Test features on target
Ascendco Scientific, Inc. page 16
www.ascendco.com
Pee Wee Linux
System Menu
Ascendco Scientific, Inc. page 17
www.ascendco.com
Pee Wee Linux
Project Creation
Start with one of the examples
Use pre-compiled or custom kernel
Custom Kernel
Run Menuconfig and select the options as necessary
Get the Linux Kernel HOWTO
Compile the kernel
Create the custom kernel package
Ascendco Scientific, Inc. page 18
www.ascendco.com
Pee Wee Linux
Configure Files Menu
Ascendco Scientific, Inc. page 19
www.ascendco.com
Pee Wee Linux
Packages
Select the packages to build into the system
Kernel or custom kernel
Networking
Shells
System Administration
X Windows
System files
Ascendco Scientific, Inc. page 20
www.ascendco.com
Pee Wee Linux
Configuring Project File System
Ascendco Scientific, Inc. page 21
www.ascendco.com
Pee Wee Linux
Extract the file system for the target
Can include custom files
Custom files have preference over default files
for the same target location and file name
Ascendco Scientific, Inc. page 22
www.ascendco.com
Pee Wee Linux
Results from Extract File System for Project
Ascendco Scientific, Inc. page 23
www.ascendco.com
Pee Wee Linux
Extract the file system to target
Can be a hard disk or CompactFlash
For small systems can be floppy disk
CompactFlash is the easiest to use
Easy to experiment to find what works best
Ascendco Scientific, Inc. page 24
www.ascendco.com
Pee Wee Linux
Configure Target Hardware
Ascendco Scientific, Inc. page 25
www.ascendco.com
Embedded Linux
What have I learned
4MB RAM is barely enough memory for Linux
with networking
8 or 16 MB RAM would allow for the less
efficient, memory wise, 2.4 kernel
Network boot would speed up development but
CompactFlash is very easy to set up and use
All the tool kits have some rough edges
Ascendco Scientific, Inc. page 26
www.ascendco.com
Embedded Linux Resources
Embedded Linux by John
Lombardo
New Riders Publishing
Good introduction to
Embedded Linux, doesn't
make a lot of assumptions
Projects are too simplistic
Ascendco Scientific, Inc. page 27
www.ascendco.com
Embedded Linux Resources
Embedded Linux:
Hardware, Software, and
Interfacing by Craig
Hollabaugh
Assumes you know what
you are doing
Many gross errors that
makes all material suspect
Ascendco Scientific, Inc. page 28
www.ascendco.com
Embedded Linux Resources
Practical Linux
Programming: Device
Drivers, Embedded
systems, and the Internet
by Ashfaq A. Khan
Includes CD-ROM and
runs under Redhat 7.1 or
higher
Ascendco Scientific, Inc. page 29
www.ascendco.com
Embedded Linux Resources
Embedded Linux Journal
Interesting articles
Will no longer be published
as a standalone magazine.
Will be a section in Linux
Journal
Articles are available at
embedded.linuxjournal.com
Ascendco Scientific, Inc. page 30
www.ascendco.com
Embedded Linux Resources
Web sites
linuxdevices.com
embedded.linuxjournal.com
google.com/linux
embedded.adis.on.ca for Pee Wee Linux
Ascendco Scientific, Inc. page 31
www.ascendco.com