We've put copies of the code discussed in this book in an archive
that you can get from the Download area of
http://www.qnx.com/.
This archive includes all of the samples from the book.
The top-level directories in the archive include:
- web/
- The web counter source code, in three phases (one directory for each version).
- adios/
- The ADIOS (Analog/Digital I/O Server) utility, including showsamp, tag,
and the required libraries.
- fsys/
- The RAM Disk filesystem, the .tar filesystem, and a library used by both.
- procfs/
- The procfs utility from the /proc filesystem appendix.
Most directories include the following:
- version.c, a string that states the version number
of the program
- main.use, the usage message
- Makefile
The Web Counter is presented in three design phases.
The web directory includes a Makefile for
the entire project, as well as a directory for each phase.
- phase-1/
- Phase I consists of the following files:
- 7seg.h—manifest constants and declarations for
the 7-segment render module
- 7seg.c—a 7-segment LED simulator that draws
images into a memory buffer
- gif.h—manifest constants and declarations for
the GIF encoder
- main.c—main module
You'll also need a GIF encoder.
- phase-2/
- Phase 2 adds the following:
- 8x8.h—manifest constants and declarations for
the 8 by 8 dot render module
- 8x8.c—an 8 by 8 “dot” font generator
- phase-3/
- Phase 3 includes updated versions of the files from phases 1 and 2.
The ADIOS project consists of the ADIOS server, drivers for the various
hardware cards, a library, API headers, and some utilities.
- adios.cfg
- A test configuration file.
- adios/
- The server consists of the following:
- adios.h—manifest constants and declarations for
the Analog / Digital I/O Server (ADIOS)
- daq.h—manifest constants and declarations for
the data acquisition component
- iofuncs.h—manifest constants and declarations for
the I/O and connect functions for the resource manager
- adios.c—the Analog / Digital I/O Server (ADIOS)
module
- daq.c—shared memory region handler and the
data acquisition thread
- iofuncs.c—I/O and connect functions for the
resource manager
- main.c—main module for the ADIOS data acquisition
server
- api/
- API header files:
- api.h—manifest constants and declarations for
clients of ADIOS
- driver.h—manifest constants and declarations for
ADIOS drivers
- lib/
- The ADIOS library consists of the following files:
- client.h—manifest constants and declarations for
the client data acquisition library
- parser.h—manifest constants and declarations for
the parser module used for ADIOS and its drivers
- client.c—library functions for the client
- parser.c—module used to parse the configuration
file for ADIOS and its drivers
- Drivers
- The source code for the drivers is in the following directories:
- dio144/
- iso813/
- pcl711/
- sim000/
- utils/
- The utilities include:
Each utility has a usage message in a separate file.
These managers are in the same directory (fsys) in the archive
because they rely on a common library.
- fsys/lib/
- The library includes the following:
- block.h—manifest constants and declarations for
the block functions
- cfs.h—constants and declarations for
the captive filesystem library
- mpool.h—manifest constants and declarations for
the memory pool module
- block.c—block functions that deal with the data storage
blocks
- cfs_attr_init.c, cfs_func_init.c—the
captive filesystem utility library's initialization functions
- io_close.c, io_devctl.c,
io_space.c—handler functions for the
captive filesystem utility library
- mpool.c—memory pool library
 |
The captive filesystem utility library isn't thread-safe, but the
memory pool library is.
|
- fsys/ramdisk/
- The RAM-disk filesystem includes the following:
- cfs.h, ramdisk.h—manifest constants
and declarations for the RAMDISK filesystem
- attr.c—attribute-handling module
- c_link.c, c_mknod.c,
c_mount.c, c_open.c,
c_readlink.c, c_rename.c,
c_unlink.c—handlers for the connect functions
- debug.c—functions to help with debugging
- dirent.c—functions that handle directory entries
- io_read.c, io_write.c—handlers
for the captive filesystem I/O functions
- main.c—main module
- pathname.c—functions that handle pathnames
- ramdisk_io_read.c,
ramdisk_io_write.c—handlers for the RAM-disk
I/O functions
- utils.c—utility functions
- fsys/tarfs/
- The TAR filesystem and its mount_tarfs helper program consist
of the following:
- cfs.h, tarfs.h—manifest constants
and declarations for the TAR filesystem
- attr.c—attribute-handling module
- c_link.c, c_mknod.c,
c_mount.c, c_open.c,
c_readlink.c, c_rename.c,
c_unlink.c—handlers for the connect functions
- debug.c—functions to help with debugging
- dirent.c—functions that handle directory entries
- io_read.c, io_write.c— handlers
for the I/O functions
- m_main.c—main module for the
mount_tarfs utility
- main.c—main module for the TAR filesystem
- pathname.c—functions that handle pathnames
- tarfs.c—support routines
- tarfs_io_read.c—the io_read handler
- utils.c—utility functions
The /proc filesystem utility module is in
procfs/procfs.c.
This program dumps just about everything it can get its hands on from
this filesystem.