This chapter lists commands you can use for creating
a target board application and for accessing Source-Navigator from the command line.
Embedded Target Board Commands
Source-Navigator configuration and link scripts
can be used directly from a command line, if preferred.
Run application
At the shell prompt, type:
config.pl
<arguments> For a list of the configuration arguments,
see Config.pl options.
You must run this script every time the build target type, Red Hat EDK Preferences,
kernel image, or kernel modules change.
Build the application.
At the shell prompt, type:
link.pl<arguments> to update the target filesystem and generate
the boot image. For a list of link arguments,
see Link.pl options.
Reboot the target board, which causes the target
board to execute the application.
Debug application
At the shell prompt, type:
config.pl
<arguments> For a list of the configuration arguments,
see Config.pl options.
You must run this script every time the build target type, Red Hat EDK
Preferences, kernel image, or kernel modules change.
Build the application.
At the shell prompt, type:
link.pl
<arguments> to update the target filesystem and generate the boot
image. For a list of link arguments,
see Link.pl options.
Reboot the target board, which causes
gdbserver
to launch.
gdbserver
waits for
gdb
to connect and allow the application to be debugged.
Script Arguments
This section lists the arguments for the
config.pl
and
link.pl
scripts.
Config.pl options
--arch=<architecture>
This sets the target board architecture.
The default is
x86.
ppc
is also supported. See also
--tool-prefix.
--bin-path=<path>
Directory where architecture binaries
(gdbserver
and
sh) are kept. The default is
../../lib/elix
relative to the launcher sources.
--boot-image=<file>
Specify the output boot image file name.
This is a mandatory argument.
Debug target via an ethernet or serial
connection.
gdbinit
specifies the name of the
gdb
script to use to automate the connection. The default is
.gdbinit.
When specifying ethernet,
port
is the port the debug server is listening on. The default port number is
9999. See
--net
for specifying the hostname for the target when using ethernet.
When specifying serial, both the target board and host serial devices must be specified. The default baud rate is 9600. Legal values are 9600, 19200, 38400, 57600, and 115200.
--elix-cfg=<file>
Specify the file in which the configuration is saved. This is a mandatory argument.
--elix-path=<path>
Specify the path to the launcher sources. This is a mandatory argument.
path
is the directory containing the Linux sources. This is required to find the kernel
image and modules. The kernel image name is computed based on the target board
architecture, but can be overridden using the image option.
Using
all-modules
or module options cause modules to be installed in the
<root>/lib/modules
directory. Unless the
all-modules
option is used, only explicitly mentioned modules are allowed to remain in the filesystem. All other modules are removed from the
<root>/lib/modules
directory. A list of modules and their arguments is saved to
cfg_modules.h.
--kernel-args=<arguments>
Specifies the arguments to give the kernel at boot time. This can be necessary when including drivers in the kernel instead of as modules.
--mount:[mp=specialfile,dir,type,rwflags,data]
Adds the mount points. The
specialfile,
dir, and
type
fields are like a
/etc/fstab
entry.
rwflags
are defined in
/usr/include/sys/mount.h. Use
MS_MGC_VAL
as the
rwflags
default.
data
is for optional filesystem arguments. Use
NULL
as the
data
default.
If
kernel
is specified as the network option, the Linux kernel must acquire the IP addresses. Use
kernel
with the
nfsroot
option (see
--nfsroot) where the NFS Root filesystem must be mounted before the application runs.
For static IP, you must specify the IP address, mask, and broadcast numbers. Additionally, you can add the numeric gateway IP address. The target hostname can also be set. The networking options are saved to
cfg_modules.h.
--nfsroot=<path>
This enables the NFS Root startup.
path
is the directory which the target will mount as the root of its filesystem via NFS.
This enables the
initrd
startup.
template
specifies the root of the directory to be packed into the RAM Disk. When selecting the Minix filesystem type, the default is to create a disk 10% larger than required. It is possible to specify how much bigger (in percentages) to make the disk size. The absolute size (by disk blocks and inode count) can also be specified.
--tool-prefix=<prefix>
The tool prefix is automatically set according to the target architecture and the type of the host system. This option allows the prefix to be overridden.
--verbose
Print out the shell commands executed by the script.
Link.pl options
--app=<file>
Specifies the application executable.
This is a mandatory argument.
--debug
Instead of starting the application directly,
it is started from
gdbserver. Connect with
gdb
from the host according to configuration (ethernet/serial) to start debugging.
If this argument is omitted, the application is stripped before downloaded
to the target board.
--elix-cfg=<file>
Specifies the configuration file generated by
config.pl. This is a mandatory argument.
--help
Displays possible arguments to
link.pl.
--verbose
Print out the shell commands executed by the script.
Script Overview
This section describes the functionality of the
config.pl
and
link.pl
scripts.
Configuration
This is a short description of what occurs in the
config.pl
script, allowing you to diagnose and fix unforeseen problems.
Read the
config.pl
script for the full details, located in the
/opt/redhat/edk-000221/H-i686-pc-linux-gnulibc2.1/bin
directory.
Argument Parsing and Validation
Arguments are parsed.
A few sanity checks are made on the arguments. Unspecified optional arguments are assigned computed values.
All specified and computed arguments are saved to the
config.h
file.
Kernel Module Handling
Install all modules on the target board filesystem, using the Linux
makefile.
Optionally remove all modules not listed by the user.
Go through the list of modules. Find each module's path and make
cfg_module.h
entry with absolute path and arguments, if any.
Mount Point Handling
Generate the
cfg_module.h
file from the list of mount points.
Network Handling
One of three execution branches; all output to
cfg_network.h.
Kernel is responsible for acquiring the IP address. The
config.pl
script does not need to do anything for this option.
Dynamic IP via
DHCP. Enable the
DHCP
support into the
cfg_network.h
file.
Static IP. Specify net interface configuration and enable code that will process it.
Define hostname in
cfg_network.h.
Rebuild Launchers
Run
make
to get the launchers rebuilt.
Link
This is a short description of what occurs in the
link.pl
script, allowing you to diagnose and fix unforeseen problems.
Read the
link.pl
script for the full details, located in
/bin.
Argument Parsing and Validation
Arguments are parsed.
A few sanity checks are made on the arguments.
The
config
file generated by
config.pl
is loaded.
Target /sbin/init Setup
One of two execution branches:
Debugging startup:
gdbserver
is copied to the target board filesystem (/elix_gdbserver).
launcher_debug
is copied to the target board filesystem (/sbin/init). A
gdb
command script is generated which allows
gdb
to automatically connect to the target board.
Application startup:
The application is copied to the target board filesystem
(/app).
/elix_gdbserver
is deleted from the target board filesystem.
launcher
is copied to the target board filesystem
(/sbin/init).
RAM Disk Creation
This is optional, depending upon your configuration.
One of two execution branches:
ROMfs:
The tool
genromfs
is used to create a RAM Disk image.
Minix:
The script
mkproto.pl
is used to create a
proto
file for the files in the template directory. The
proto
file specifies the file layout in the RAM Disk.
Boot Image Creation
One of two execution branches:
x86 target:
The tool
mknbi-linux
is used to create a kernel image. This may include a RAM Disk. The output is saved to the boot image, as specified by the
--boot-image
argument.
PowerPC target:
One of two execution branches:
RAM Disk:
The RAM Disk image is copied to the Linux kernel directory. The Linux
makefile
rule
zImage.initrd
is invoked. The resulting kernel image is copied to the boot image location, as specified by the
--boot-image
argument.
NFS Root:
The kernel image is copied to the boot image location, as specified by the
--boot-image
argument.
Source-Navigator Commands
Source-Navigator supports the following command line options:
--batchmode
This forces batch mode to create a new project. If this is set, Source-Navigator will not launch. Instead the following command line options will be used to create a new project.
--projectname
This command creates a project in the current directory using the directory path. For example, if the current directory is
/home/foo
and
--projectname
is run, the project name becomes
/home/foo/foo.proj.
--avail-options
Sets preferences for an option used in project creation.
--define <option>=<value>
Lists options that can be set using
--define.
--databasedir <directory>
(synonyms:
-dbdir,
-database,
-db)
Defines the directory for the symbol databases. Without this, the symbol databases are put in a directory called
.snprj
at the same level as the project file.
--import <file>
Specifies a text file with a list of all files or directories to add to the project.
--noxref
This option prevents the creation of cross-references. By default, Source-Navigator generates cross-reference information for the project.
--create
This option is used to start the Auto-Create dialog. It is not normally used with
--batchmode. Source-Navigator prompts the user for information used to create a project.
Example: Creating a new project in devo-files
The following command creates a project named
/home/smith/devo.proj
using the files listed in devo-files in batch mode. The database files are stored in
~/db_files. Source-Navigator returns when the project has been created.
Example: Creating a new project in the current directory
The following command creates a project in batch mode using the current directory. It adds all of the files in the current directory and in all of the subdirectories. The current working directory is
/home/smith/devo/snedk. The generated project name is
/home/smith/devo/snedk/snedk.proj.
~bin/snedk --batchmode
Example: Auto-Create dialog
The following command displays the
Auto-Create
dialog, initialized with the current directory, with
foo.proj
as the project name. To view the project, you must open Red Hat EDK.