Appendix A. Hosting Applications
A.1. Analysis
An operating system by itself is not much fun. What makes an OS great is the applications that can be run on
top of it. Unfortunately, Pocket Linux currently does not have much room for anything other than system
programs. Still, it would be nice to expand the system just enough to host some cool applications. Obviously a
full−blown X−Windows GUI is out of the question, but running a small console based program should be
within our reach.
Rather than doing a typical "hello world" program as an example, application hosting will be demonstrated
using a console based audio player called mp3blaster. Building mp3blaster offers more technical challenge
than "hello world" and the finished product should be a lot more fun. However, it should not be construed that
a console−based jukebox is the only application for Pocket Linux. On the contrary, after completing this
phase the reader should have the knowledge and tools to build almost any console−based program he or she
desires.
So what will it take to turn a pocket−sized GNU/Linux system into a pocket−sized mp3 player? A few things
are listed below.
Add support for audio hardware.
•
Create space for the mp3blaster program.
•
Provide a convenient way to access audio files.
•
A.2. Design
A.2.1. Support for audio hardware
There is a vast proliferation of audio hardware on the market and each sound card has its own particular
configuration. For details on how to set up a particular sound card we can turn to the Sound−HOWTO
available from The Linux Documentation Project. In a broader sense, however, we can treat a sound card like
any other piece of new hardware. To add new hardware to a GNU/Linux system we will need configure the
kernel to recognize it and configure
/dev
files on the root disk to access it.
A.2.1.1. Kernel support for audio
In order to support sound cards, a new kernel will have to be built. It is very important that audio hardware
support be configured as built−in, because Pocket Linux is not set up to handle kernel modules.
A.2.1.2. Root disk support for audio
Searching
devices.txt
for the keyword "sound" will list quite a few possible audio devices, but usually
only
/dev/dsp
and
/dev/mixer
are required to get sound from a PC. These two files control the digital
audio output and mixer controls, respectively.
Appendix A. Hosting Applications
48