Page 1 of 1

RedBoot commands

PostPosted: Fri May 14, 2010 5:03 pm
by kakanakov
RedBoot user manual is available here {14.05.2010}

Re: RedBoot commands

PostPosted: Fri May 14, 2010 5:04 pm
by kakanakov
RedBoot uses the following line editing commands.
NOTE: In this description, ^A means the character formed by typing the letter “A” while holding down the control key.

* Delete (0x7F) or Backspace (0x08) erases the character to the left of the cursor.
* ^A or HOME moves the cursor (insertion point) to the beginning of the line.
* ^K erases all characters on the line from the cursor to the end.
* ^E or END positions the cursor to the end of the line.
* ^D or DELETE erases the character under the cursor.
* ^F or RIGHT-ARROW moves the cursor one character to the right.
* ^B or LEFT-ARROW moves the cursor one character to the left.
* ^P or UP-ARROW replaces the current line by a previous line from the history buffer. A small number of lines can be kept as history. Using ^P (and ^N), the current line can be replaced by any one of the previously typed lines.
* ^N or DOWN-ARROW replaces the current line by the next line from the history buffer.

In the case of the fconfig command, additional editing commands are possible. As data are entered for this command, the current/previous value will be displayed and the cursor placed at the end of that data. The user may use the editing keys (above) to move around in the data to modify it as appropriate. Additionally, when certain characters are entered at the end of the current value, i.e. entered separately, certain behavior is elicited.

* ^ (caret) switch to editing the previous item in the fconfig list. If fconfig edits item A, followed by item B, pressing ^ when changing item B, allows you to change item A. This is similar to the up arrow. Note: ^P and ^N do not have the same meaning while editing fconfig data and should not be used.
* . (period) stop editing any further items. This does not change the current item.
* Return leaves the value for this item unchanged. Currently it is not possible to step through the value for the start-up script; it must always be retyped.

Re: RedBoot commands

PostPosted: Fri May 14, 2010 5:05 pm
by kakanakov
RedBoot provides support for listing and repeating previously entered commands. A list of previously entered commands may be obtained by typing history at the command line:
RedBoot> history
The following history expansions may be used to execute commands in the history list:

* !! repeats last command.
* !n repeats command n.
* !string repeats most recent command starting with string.

Re: RedBoot commands

PostPosted: Fri May 14, 2010 5:17 pm
by kakanakov
RedBoot provides three basic classes of commands:
* Program loading and execution
* Flash image and configuration management
* Miscellaneous commands

The basic format for commands is:
RedBoot> COMMAND [-S]... [-s val]... operand

Commands may require additional information beyond the basic command name. In most cases this additional information is optional, with suitable default values provided if they are not present.

Format Description Example
-S: A boolean switch; the behavior of the command will differ, depending on the presence of the switch. In this example, the -f switch indicates that a complete initialization of the FIS data should be performed. There may be many such switches available for any given command and any or all of them may be present, in any order.
Example: RedBoot> fis init -f
-s val: A qualified value; the letter "s" introduces the value, qualifying it's meaning. In the example, -b 0x100000 specifies where the memory dump should begin. There may be many such switches available for any given command and any or all of them may be present, in any order.
Example: RedBoot> dump -b 0x100000 -l 0x20
operand: A simple value; some commands require a single parameter for which an additional -X switch would be redundant. In the example, JFFS2 is the name of a flash image. The image name is always required, thus is no need to qualify it with a switch. Note that any un-qualified operand must always appear at the end of the command.
Example: RedBoot> fis delete JFFS2

The list of available commands, and their syntax, can be obtained by typing help at the command line.

NOTE: Multiple commands may be entered on a single line, separated by the semi-colon “;” character.

Commands can be abbreviated to their shortest unique string. Thus in the list above, d,du,dum and dump are all valid for the dump command. The fconfig command can be abbreviated fc, but f would be ambiguous with fis.

There is one additional, special command. When RedBoot detects '$' or '+' (unless escaped via '\') in a command, it switches to GDB protocol mode. At this point, the eCos GDB stubs take over, allowing connections from a GDB host. The only way to get back to RedBoot from GDB mode is to restart the platform.

Re: RedBoot commands

PostPosted: Fri May 14, 2010 5:43 pm
by kakanakov
Common Commands

help -- Display help on available commands
help [ command] default: all commands

reset -- Reset the device
version -- Display RedBoot version information
alias -- Manipulate command line aliases
disks -- List available disk partitions.
baudrate -- Set the baud rate for the system serial console
baudrate [-b rate]

channel -- Select the system console channel
channel [-1 | channel_number]
-1 Reset the console channel
channel_number Select a channel (0,1,...)

ip_address -- Set IP addresses
ip_address [-b] [-l local_IP_address [/netmask_length] ] [-h server_IP_address] [-d DNS_server_IP_address]
-b Boolean: Obtain an IP address using BOOTP or DHCP. default: don't use BOOTP/DHCP

ping -- Verify network connectivity
ping [-v ] [-i local_IP_address] [-l length] [-n count] [-t timeout] [-r rate] {-h server_IP_address}
-v Boolean: Be verbose, displaying information about each packet sent. default:quiet

load -- Download programs or data to the RedBoot platform
load [-v ] [-d ] [-r ] [-m trasfer_type ] [-h server_IP_address] [-f location] [-b location] [-c channel] [file_name]
-m tftp Transfer data via the network using TFTP protocol.
-m http Transfer data via the network using HTTP protocol.
-m xmodem Transfer data using X-modem protocol.
-m ymodem Transfer data using Y-modem protocol.
-m disk Transfer data from a local disk.
-m file Transfer data from a local filesystem such as JFFS2 or FAT.

cache -- Control hardware caches
cache [on | off]

cksum -- Compute POSIX checksums
cksum {-b location} {-l length}

dump -- Display memory.
dump {-b location} [-l length] [-s] [-1 | -2 | -4]
-b location Location in memory for start of data.
-l length Length of data default: 32
-s Format data using Motorola S-records.
-1 | -2 | -4 Access one byte (8 bits), two bytes (16 bits), or one word (32 bits) at a time. Only the least significant 8 bits of the pattern will be used. default: -1 (one byte)

iopeek -- Read I/O location
iopeek [-b location] [-1 | -2 | -4]
see dump for parameter explaination

iopoke -- Write I/O location
iopoke [-b location] [-1 | -2 | -4] [-v value]
see dump for parameter explaination

mcmp -- Compare two segments of memory
mcmp {-s location1} {-d location1} {-l length} [-1 | -2 | -4]

mcopy -- Copy memory
mcopy {-s source} {-d destination} {-l length} [-1 | -2 | -4]

mfill -- Fill RAM with a specified pattern
mfill {-b location} {-l length} {-p value} [-1 | -2 | -4]

gunzip -- Uncompress GZIP compressed data
gunzip {-s source} {-d destination}
-s location1 Memory address: Location of GZIP compressed data to uncompress. default:Value set by last load or fis load command.
-d location2 Memory address: Destination to write uncompressed data to.

Re: RedBoot commands

PostPosted: Fri May 14, 2010 5:56 pm
by kakanakov
Executing Programs from RedBoot

Once an image has been loaded into memory, either via the load command or the fis load command, execution may be transfered to that image.
NOTE: The image is assumed to be a stand-alone entity, as RedBoot gives the entire platform over to it. Typical examples would be an eCos application or a Linux kernel.

go -- Execute a program. The go command causes RedBoot to give control of the target platform to another program. This program must execute stand alone, e.g. an eCos application or a Linux kernel.
go [-w timeout] [-c] [-n] [ start_address]
-w timeout Number: How long to wait before starting execution. default: 0
-c Boolean: Go with caches enabled. default: caches off
-n Boolean: Go with network interface stopped. default: network enabled
start_address Number: Address in memory to begin execution. default: Value set by last load or fis load command.

exec -- Execute a Linux kernel. The exec command is used to execute a non-eCos application, typically a Linux kernel. Additional information may be passed to the kernel at startup time.
exec [-w timeout] [-r ramdisk_address] [-s ramdisk_length] [-b load_address {-l load_length} ] [-c kernel_command_line] [ entry_point]
-w timeout Number: Time to wait before starting execution. default: 0
-r ramdisk_address Number: Address in memory of "initrd"-style ramdisk - passed to Linux kernel.
-s ramdisk_length Number: Length of ramdisk image - passed to Linux kernel.
-b load_address Number: Address in memory of the Linux kernel image. default:Value set by load or fis load
-l load_length Number: Length of Linux kernel image.
-c kernel_command_line String: Command line to pass to the Linux kernel.
-x Boot kernel with endianess opposite of RedBoot endianess. default: Boot kernel with same endianess as RedBoot
entry_address Number: Starting address for Linux kernel execution default: Implied by architecture

Re: RedBoot commands

PostPosted: Fri May 14, 2010 6:01 pm
by kakanakov
Flash Image System (FIS)

If the platform has flash memory, RedBoot can use this for image storage. Executable images, as well as data, can be stored in flash in a simple file store. The fis command (fis is short for Flash Image System) is used to manipulate and maintain flash images.

fis load -- Load flash image. This command is used to transfer an image from flash memory to RAM. Once the image has been loaded, it may be executed using the go command.
fis load [-b load address] [-c ] [-d ] [name]
-b Number: Address the image should be loaded to. Executable images normally load at the location to which the file was linked. This option allows the image to be loaded to a specific memory location, possibly overriding any assumed location. If not specified, the address associated with the image in the FIS directory will be used.
-c Compute and print the checksum of the image data after it has been loaded into memory.
-d Decompress gzipped image while copying it from flash to RAM.
name String: The name of the file, as shown in the FIS directory.

fis init -- Initialize Flash Image System (FIS)
fis list -- List Flash Image System directory
fis free -- Free flash image
fis create -- Create flash image
fis delete -- Delete flash image
fis lock -- Lock flash area
fis unlock -- Unlock flash area
fis erase -- Erase flash area
fis write -- Write flash area