RedBoot Commands and Examples Introduction RedBootcommands and examples commands and examples RedBoot provides three basic classes of commands: Program loading and execution Flash image and configuration management Miscellaneous commands Given the extensible and configurable nature of eCos and RedBoot, there may be extended or enhanced sets of commands available. 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. 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. 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. RedBoot> fis delete JFFS2 The list of available commands, and their syntax, can be obtained by typing help at the command line: RedBoot> help Manage aliases kept in FLASH memory alias name [value] Set/Query the system console baud rate baudrate [-b <rate>] Manage machine caches cache [ON | OFF] Display/switch console channel channel [-1|<channel number>] Display disk partitions disks Display (hex dump) a range of memory dump -b <location> [-l <length>] [-s] Manage flash images fis {cmds} Manage configuration kept in FLASH memory fconfig [-i] [-l] [-n] [-f] [-d] | [-d] nickname [value] Execute code at a location go [-w <timeout>] [-c] [-n] [entry] Help about help? help [<topic>] Set/change IP addresses ip_address [-l <local_ip_address>[/<mask_length>]] [-h <server_address>] Load a file load [-r] [-v] [-d] [-c <channel>] [-h <host>] [-m {TFTP | HTTP | {x|y}MODEM | disk}] [-b <base_address>] <file_name> Network connectivity test ping [-v] [-n <count>] [-t <timeout>] [-i <IP_addr] -h <host> Reset the system reset Display RedBoot version information version Display (hex dump) a range of memory x -b <location> [-l <length>] [-s] 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. NOTE Multiple commands may be entered on a single line, separated by the semi-colon “;” character. The standard RedBoot command set is structured around the bootstrap environment. These commands are designed to be simple to use and remember, while still providing sufficient power and flexibility to be useful. No attempt has been made to render RedBoot as the end-all product. As such, things such as the debug environment are left to other modules, such as GDB stubs, which are typically included in RedBoot. The command set may be also be extended on a platform basis. Common Commands commandscommon alias Manipulate command line aliases alias name value Arguments Name Type Description Default name Name The name for this alias. none value String Replacement value for the alias. none Description The alias command is used to maintain simple command line aliases. These aliases are shorthand for longer expressions. When the pattern %{name} appears in a command line, including in a script, the corresponding value will be substituted. Aliases may be nested. If no value is provided, then the current value of the alias is displayed. If the system supports non-volatile configuration data via the fconfig command (see ), then the value will be saved and used when the system is reset. Examples Set an alias. RedBoot> alias joe "This is Joe" Update RedBoot non-volatile configuration - continue (y/n)? n Display an alias. RedBoot> alias joe 'joe' = 'This is Joe' Use an alias. Note: the "=" command simply echoes the command to to console. RedBoot> = %{joe} This is Joe Aliases can be nested. RedBoot> alias frank "Who are you? %{joe}" Update RedBoot non-volatile configuration - continue (y/n)? n RedBoot> = %{frank} Who are you? This is Joe Notice how the value of %{frank} changes when %{joe} is changed since the value of %{joe} is not evaluated until %{frank} is evaluated. RedBoot> alias joe "This is now Josephine" Update RedBoot non-volatile configuration - continue (y/n)? n RedBoot> = %{frank} Who are you? This is now Josephine baudrate Set the baud rate for the system serial console baudrate -b rate Arguments Name Type Description Default -b rate Number The baud rate to use for the serial console. none Description The baudrate command sets the baud rate for the system serial console. If no value is provided, then the current value of the console baud rate is displayed. If the system supports non-volatile configuration data via the fconfig command (see ), then the value will be saved and used when the system is reset. Examples Show the current baud rate. RedBoot> baudrate Baud rate = 38400 Change the console baud rate. In order to make this operation safer, there will be a slight pause after the first message to give you time to change to the new baud rate. If it doesn't work, or a less than affirmative answer is given to the "continue" prompt, then the baud rate will revert to the current value. Only after the baud rate has been firmly established will RedBoot give you an opportunity to save the value in persistent storage. RedBoot> baudrate -b 57600 Baud rate will be changed to 57600 - update your settings Device baud rate changed at this point Baud rate changed to 57600 - continue (y/n)? y Update RedBoot non-volatile configuration - continue (y/n)? n cache Control hardware caches cache on off Arguments Name Type Description Default on Turn the caches on none off Turn the caches off none Description The cache command is used to manipulate the caches on the processor. With no options, this command specifies the state of the system caches. When an option is given, the caches are turned off or on appropriately. Examples Show the current cache state. RedBoot> cache Data cache: On, Instruction cache: On Disable the caches. RedBoot> cache off RedBoot> cache Data cache: Off, Instruction cache: Off Enable the caches. RedBoot> cache on RedBoot> cache Data cache: On, Instruction cache: On channel Select the system console channel channel -1 channel_number Arguments Name Type Description Default -1 Reset the console channel none channel_number Number Select a channel none Description With no arguments, the channel command displays the current console channel number. When passed an argument of 0 upward, this command switches the console channel to that channel number. The mapping between channel numbers and physical channels is platform specific but will typically be something like channel 0 is the first serial port, channel 1 is the second, etc. When passed an argument of -1, this command reverts RedBoot to responding to whatever channel receives input first, as happens when RedBoot initially starts execution. Examples Show the current channel. RedBoot> channel Current console channel id: 0 Change to an invalid channel. RedBoot> channel 99 **Error: bad channel number '99' Revert to the default channel setting (any console mode). RedBoot> channel -1 cksum Compute POSIX checksums cksum -b location -l length Arguments Name Type Description Default -b location Memory address Location in memory for stat of data. none -l length Number Length of data none Description Computes the POSIX checksum on a range of memory (either RAM or FLASH). The values printed (decimal cksum, decimal length, hexadecimal cksum, hexadecimal length) can be compared with the output from the Linux program 'cksum'. Examples Checksum a buffer. RedBoot> cksum -b 0x100000 -l 0x100 POSIX cksum = 3286483632 256 (0xc3e3c2b0 0x00000100) Checksum an area of memory after loading a file. Note that the base address and length parameters are provided by the preceding load command. RedBoot> load -r -b %{FREEMEMLO} redboot.bin Raw file loaded 0x06012800-0x0602f0a8 RedBoot> cksum Computing cksum for area 0x06012800-0x0602f0a8 POSIX cksum = 2092197813 116904 (0x7cb467b5 0x0001c8a8) disks List available disk partitions. disks Arguments None. Description The disks command is used to list disk partitions recognized by RedBoot. Examples Show what disk partitions are available. RedBoot> disks hda1 Linux Swap hda2 Linux 00100000: 00 3E 00 06 00 06 00 06 00 00 00 00 00 00 00 00 |.>..............| 00100010: 00 00 00 78 00 70 00 60 00 60 00 60 00 60 00 60 |...x.p.`.`.`.`.`| dump Display memory. dump -b location -l length -s -1 -2 -4 Arguments Name Type Description Default -b location Memory address Location in memory for start of data. none -l length Number Length of data 32 -s Boolean Format data using Motorola S-records. -1 Access one byte (8 bits) at a time. Only the least significant 8 bits of the pattern will be used. -1 -2 Access two bytes (16 bits) at a time. Only the least significant 16 bits of the pattern will be used. -1 -4 Access one word (32 bits) at a time. -1 Description Display a range of memory on the system console. The x is a synonym for dump. Note that this command could be detrimental if used on memory mapped hardware registers. The memory is displayed at most sixteen bytes per line, first as the raw hex value, followed by an ASCII interpretation of the data. Examples Display a buffer, one byte at a time. RedBoot> mfill -b 0x100000 -l 0x20 -p 0xDEADFACE RedBoot> x -b 0x100000 00100000: CE FA AD DE CE FA AD DE CE FA AD DE CE FA AD DE |................| 00100010: CE FA AD DE CE FA AD DE CE FA AD DE CE FA AD DE |................| Display a buffer, one short (16 bit) word at a time. Note in this case that the ASCII interpretation is suppressed. RedBoot> dump -b 0x100000 -2 00100000: FACE DEAD FACE DEAD FACE DEAD FACE DEAD 00100010: FACE DEAD FACE DEAD FACE DEAD FACE DEAD Display a buffer, one word (32 bit) word at a time. Note in this case that the ASCII interpretation is suppressed. RedBoot> dump -b 0x100000 -4 00100000: DEADFACE DEADFACE DEADFACE DEADFACE 00100010: DEADFACE DEADFACE DEADFACE DEADFACE Display the same buffer, using Motorola S-record format. RedBoot> dump -b 0x100000 -s S31500100000CEFAADDECEFAADDECEFAADDECEFAADDE8E S31500100010CEFAADDECEFAADDECEFAADDECEFAADDE7E Display a buffer, with visible ASCII strings. RedBoot> d -b 0xfe00b000 -l 0x80 0xFE00B000: 20 25 70 0A 00 00 00 00 41 74 74 65 6D 70 74 20 | %p.....Attempt | 0xFE00B010: 74 6F 20 6C 6F 61 64 20 53 2D 72 65 63 6F 72 64 |to load S-record| 0xFE00B020: 20 64 61 74 61 20 74 6F 20 61 64 64 72 65 73 73 | data to address| 0xFE00B030: 3A 20 25 70 20 5B 6E 6F 74 20 69 6E 20 52 41 4D |: %p [not in RAM| 0xFE00B040: 5D 0A 00 00 2A 2A 2A 20 57 61 72 6E 69 6E 67 21 |]...*** Warning!| 0xFE00B050: 20 43 68 65 63 6B 73 75 6D 20 66 61 69 6C 75 72 | Checksum failur| 0xFE00B060: 65 20 2D 20 41 64 64 72 3A 20 25 6C 78 2C 20 25 |e - Addr: %lx, %| 0xFE00B070: 30 32 6C 58 20 3C 3E 20 25 30 32 6C 58 0A 00 00 |02lX <> %02lX...| 0xFE00B080: 45 6E 74 72 79 20 70 6F 69 6E 74 3A 20 25 70 2C |Entry point: %p,| help Display help on available commands help topic Arguments Name Type Description Default topic String Which command to provide help for. All commands Description The help command displays information about the available RedBoot commands. If a topic is given, then the display is restricted to information about that specific command. If the command has sub-commands, e.g. fis, then the topic specific display will print additional information about the available sub-commands. special (ICMP) packets to a specific host. These packets should be automatically returned by that host. The command will indicate how many of these round-trips were successfully completed. Examples Show generic help. Note that the contents of this display will depend on the various configuration options for RedBoot when it was built. RedBoot> help Manage aliases kept in FLASH memory alias name [value] Manage machine caches cache [ON | OFF] Display/switch console channel channel [-1|<channel number>] Compute a 32bit checksum [POSIX algorithm] for a range of memory cksum -b <location> -l <length> Display (hex dump) a range of memory dump -b <location> [-l <length>] [-s] [-1|-2|-4] Manage FLASH images fis {cmds} Manage configuration kept in FLASH memory fconfig [-i] [-l] [-n] [-f] [-d] | [-d] nickname [value] Execute code at a location go [-w <timeout>] [entry] Uncompress GZIP compressed data gunzip -s <location> -d <location> Help about help? help [<topic>] Read I/O location iopeek [-b <location>] [-1|2|4] Write I/O location iopoke [-b <location>] [-1|2|4] -v <value> Set/change IP addresses ip_address [-l <local_ip_address>[/<mask_length>]] [-h <server_address>] Load a file load [-r] [-v] [-d] [-h <host>] [-m {TFTP | HTTP | {x|y}MODEM -c <channel_number>}] [-b <base_address>] <file_name> Compare two blocks of memory mcmp -s <location> -d <location> -l <length> [-1|-2|-4] Fill a block of memory with a pattern mfill -b <location> -l <length> -p <pattern> [-1|-2|-4] Network connectivity test ping [-v] [-n <count>] [-l <length>] [-t <timeout>] [-r <rate>] [-i <IP_addr>] -h <IP_addr> Reset the system reset Display RedBoot version information version Display (hex dump) a range of memory x -b <location> [-l <length>] [-s] [-1|-2|-4] Help about a command with sub-commands. RedBoot> help fis Manage FLASH images fis {cmds} Create an image fis create -b <mem_base> -l <image_length> [-s <data_length>] [-f <flash_addr>] [-e <entry_point>] [-r <ram_addr>] [-n] <name> Display an image from FLASH Image System [FIS] fis delete name Erase FLASH contents fis erase -f <flash_addr> -l <length> Display free [available] locations within FLASH Image System [FIS] fis free Initialize FLASH Image System [FIS] fis init [-f] Display contents of FLASH Image System [FIS] fis list [-c] [-d] Load image from FLASH Image System [FIS] into RAM fis load [-d] [-b <memory_load_address>] [-c] name Write raw data directly to FLASH fis write -f <flash_addr> -b <mem_base> -l <image_length> iopeek Read I/O location iopeek -b location -1 -2 -4 Arguments Name Type Description Default -b location I/O address I/O Location. none -1 Access a one byte (8 bit) I/O location. -1 -2 Access a two byte (16 bit) I/O location. -1 -4 Access a one word (32 bit) I/O location. -1 Description Reads a value from the I/O address space. Examples Examine 8 bit value at I/O location 0x3F8. RedBoot> iopeek -b 0x3f8 0x03f8 = 0x30 Examine 32 bit value at I/O location 0x3f8. RedBoot> iopeek -b 0x3f8 -4 0x03f8 = 0x03c10065 iopoke Write I/O location iopoke -b location -1 -2 -4 -v value Arguments Name Type Description Default -b location I/O address I/O Location. none -1 Access a one byte (8 bit) I/O location. Only the 8 least significant bits of value will be used -1 -2 Access a two byte (16 bit) I/O location. Only the 16 least significant bits of value will be used -1 -4 Access a one word (32 bit) I/O location. -1 Description Writes a value to the I/O address space. Examples Write 0x0123 to 16 bit I/O location 0x200. RedBoot> iopoke -b 0x200 -v 0x123 -2 gunzip Uncompress GZIP compressed data gunzip -s source -d destination Arguments Name Type Description Default -s location1 Memory address Location of GZIP compressed data to uncompress. Value set by last load or fis load command. -d location2 Memory address Destination to write uncompressed data to. none Description Uncompress GZIP compressed data. Examples Uncompress data at location 0x100000 to 0x200000. RedBoot> gunzip -s 0x100000 -d 0x200000 Decompressed 38804 bytes ip_address Set IP addresses ip_address -b -l local_IP_address /netmask_length -h server_IP_address -d DNS_server_IP_address Arguments Name Type Description Default -b Boolean Obtain an IP address using BOOTP or DHCP. don't use BOOTP/DHCP -l local_IP_address Numeric IP or DNS name The IP address RedBoot should use, optionally with the network mask length. none -h server_IP_address Numeric IP or DNS name The IP address of the default server. Use of this address is implied by other commands, such as load. none -d DNS_server_IP_address Numeric IP or DNS name The IP address of the DNS server. none Description The ip_address command is used to show and/or change the basic IP addresses used by RedBoot. IP addresses may be given as numeric values, e.g. 192.168.1.67, or as symbolic names such as www.redhat.com if DNS support is enabled. The option is used to cause the target to perform a bootp or dhcp negotiation to get an IP address. The option is used to set the IP address used by the target device. The network mask length can also be specified The option is used to set the default server address, such as is used by the load command. The option is used to set the default DNS server address which is used for resolving symbolic network addresses. Note that an address of 0.0.0.0 will disable DNS lookups. Examples Display the current network settings. RedBoot> ip_address IP: 192.168.1.31, Default server: 192.168.1.101, DNS server IP: 0.0.0.0 Change the DNS server address. RedBoot> ip_address -d 192.168.1.101 IP: 192.168.1.31, Default server: 192.168.1.101, DNS server IP: 192.168.1.101 Change the default server address. RedBoot> ip_address -h 192.168.1.104 IP: 192.168.1.31, Default server: 192.168.1.104, DNS server IP: 192.168.1.101 Set the IP address to something new, with a 255.255.255.0 netmask RedBoot> ip_address -l 192.168.1.32/24 IP: 192.168.1.32, Default server: 192.168.1.104, DNS server IP: 192.168.1.101 load Download programs or data to the RedBoot platform load -v -d -r -m xmodem ymodem tftp disk -h server_IP_address -b location -c channel file_name Arguments Name Type Description Default -v Boolean Display a small spinner (indicator) while the download is in progress. This is just for feedback, especially during long loads. Note that the option has no effect when using a serial download method since it would interfere with the protocol. quiet -d Boolean Decompress data stream (gzip data) non-compressed data -r Boolean Raw (or binary) data formatted (S-records, ELF image, etc) -m tftp Transfer data via the network using TFTP protocol. TFTP -m http Transfer data via the network using HTTP protocol. TFTP -m xmodem Transfer data using X-modem protocol. TFTP -m ymodem Transfer data using Y-modem protocol. TFTP -m disk Transfer data from a local disk. TFTP -h server_IP_address Numeric IP or DNS name The IP address of the TFTP or HTTP server. Value set by ip_address -b location Number Address in memory to load the data. Formatted data streams will have an implied load address which this option may override. Depends on data format -c channel Number Specify which I/O channel to use for download. This option is only supported when using either xmodem or ymodem protocol. Depends on data format file_name String The name of the file on the TFTP or HTTP server or the local disk. Details of how this is specified for TFTP are host-specific. For local disk files, the name must be in disk: filename format. The disk portion must match one of the disk names listed by the disks command. None Description The load command is used to download data into the target system. Data can be loaded via a network connection, using either the TFTP or HTTP protocols, or the console serial connection using the X/Y modem protocol. Files may also be loaded directly from local filesystems on disk. Files to be downloaded may either be executable images in ELF executable program format, Motorola S-record (SREC) format or raw data. Examples Download a Motorola S-record (or ELF) image, using TFTP, specifying the base memory address. RedBoot> load redboot.ROM -b 0x8c400000 Address offset = 0x0c400000 Entry point: 0x80000000, address range: 0x80000000-0x8000fe80 Download a Motorola S-record (or ELF) image, using HTTP, specifying the host [server] address. RedBoot> load /redboot.ROM -m HTTP -h 192.168.1.104 Address offset = 0x0c400000 Entry point: 0x80000000, address range: 0x80000000-0x8000fe80 Load an ELF file from /dev/hda1 which should be an EXT2 partition: RedBoot> load -mode disk hda1:hello.elf Entry point: 0x00020000, address range: 0x00020000-0x0002fd70 mcmp Compare two segments of memory mcmp -s location1 -d location1 -l length -1 -2 -4 Arguments Name Type Description Default -s location1 Memory address Location for start of data. none -d location2 Memory address Location for start of data. none -l length Number Length of data none -1 Access one byte (8 bits) at a time. Only the least significant 8 bits of the pattern will be used. -4 -2 Access two bytes (16 bits) at a time. Only the least significant 16 bits of the pattern will be used. -4 -4 Access one word (32 bits) at a time. -4 Description Compares the contents of two ranges of memory (RAM, ROM, FLASH, etc). Examples Compare two buffers which match (result is quiet). RedBoot> mfill -b 0x100000 -l 0x20 -p 0xDEADFACE RedBoot> mfill -b 0x200000 -l 0x20 -p 0xDEADFACE RedBoot> mcmp -s 0x100000 -d 0x200000 -l 0x20 Compare two buffers which don't match. Only the first non-matching element is displayed. RedBoot> mcmp -s 0x100000 -d 0x200000 -l 0x30 -2 Buffers don't match - 0x00100020=0x6000, 0x00200020=0x0000 mcopy Copy memory mcopy -s source -d destination -l length -1 -2 -4 Arguments Name Type Description Default -s location1 Memory address Location of data to copy. none -d location2 Memory address Destination for copied data. none -l length Number Length of data none -1 Copy one byte (8 bits) at a time. -4 -2 Copy two bytes (16 bits) at a time. -4 -4 Copy one word (32 bits) at a time. -4 Description Copies memory (RAM, ROM, FLASH, etc) from one area to another. Examples Copy 16 bits at a time. RedBoot> mfill -b 0x100000 -l 0x20 -2 -p 0xDEAD RedBoot> mfill -b 0x200000 -l 0x20 -2 -p 0x0 RedBoot> dump -b 0x200000 -l 0x20 -2 00200000: 0000 0000 0000 0000 0000 0000 0000 0000 00200010: 0000 0000 0000 0000 0000 0000 0000 0000 RedBoot> mcopy -s 0x100000 -d 0x200000 -2 -l 0x20 RedBoot> dump -b 0x200000 -l 0x20 -2 00200000: DEAD DEAD DEAD DEAD DEAD DEAD DEAD DEAD 00200010: DEAD DEAD DEAD DEAD DEAD DEAD DEAD DEAD mfill Fill RAM with a specified pattern mfill -b location -l length -p value -1 -2 -4 Arguments Name Type Description Default -b location Memory address Location in memory for start of data. none -l length Number Length of data none -p pattern Number Data value to fill with 0 -1 Access one byte (8 bits) at a time. Only the least significant 8 bits of the pattern will be used. -4 -2 Access two bytes (16 bits) at a time. Only the least significant 16 bits of the pattern will be used. -4 -4 Access one word (32 bits) at a time. -4 Description Fills a range of memory with the given pattern. Examples Fill a buffer with zeros. RedBoot> x -b 0x100000 -l 0x20 00100000: 00 3E 00 06 00 06 00 06 00 00 00 00 00 00 00 00 |.>..............| 00100010: 00 00 00 78 00 70 00 60 00 60 00 60 00 60 00 60 |...x.p.`.`.`.`.`| RedBoot> mfill -b 0x100000 -l 0x20 RedBoot> x -b 0x100000 -l 0x20 00100000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00100010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| Fill a buffer with a pattern. RedBoot> mfill -b 0x100000 -l 0x20 -p 0xDEADFACE RedBoot> x -b 0x100000 -l 0x20 00100000: CE FA AD DE CE FA AD DE CE FA AD DE CE FA AD DE |................| 00100010: CE FA AD DE CE FA AD DE CE FA AD DE CE FA AD DE |................| ping Verify network connectivity ping -v -i local_IP_address -l length -n count -t timeout -r rate -h server_IP_address Arguments Name Type Description Default -v Boolean Be verbose, displaying information about each packet sent. quiet -n local_IP_address Number Controls the number of packets to be sent. 10 -i local_IP_address Numeric IP or DNS name The IP address RedBoot should use. Value set by ip_address -h server_IP_address Numeric IP or DNS name The IP address of the host to contact. none -l length Number The length of the ICMP data payload. 64 -r length Number How fast to deliver packets, i.e. time between successive sends. A value of 0 sends packets as quickly as possible. 1000ms (1 second) -t length Number How long to wait for the round-trip to complete, specified in milliseconds. 1000ms (1 second) Description The ping command checks the connectivity of the local network by sending special (ICMP) packets to a specific host. These packets should be automatically returned by that host. The command will indicate how many of these round-trips were successfully completed. Examples Test connectivity to host 192.168.1.101. RedBoot> ping -h 192.168.1.101 Network PING - from 192.168.1.31 to 192.168.1.101 PING - received 10 of 10 expected Test connectivity to host 192.168.1.101, with verbose reporting. RedBoot> ping -h 192.168.1.101 -v -n 4 Network PING - from 192.168.1.31 to 192.168.1.101 seq: 1, time: 1 (ticks) seq: 2, time: 1 (ticks) seq: 3, time: 1 (ticks) seq: 4, time: 1 (ticks) PING - received 10 of 10 expected Test connectivity to a non-existent host (192.168.1.109). RedBoot> ping -h 192.168.1.109 -v -n 4 PING: Cannot reach server '192.168.1.109' (192.168.1.109) reset Reset the device reset Arguments None Description The reset command causes the target platform to be reset. Where possible (hardware support permitting), this will be equivalent to a power-on reset condition. Examples Reset the platform. RedBoot> reset ... Resetting.+... Waiting for network card: . Socket Communications, Inc: Low Power Ethernet CF Revision C 5V/3.3V 08/27/98 Ethernet eth0: MAC address 00:c0:1b:00:ba:28 IP: 192.168.1.29, Default server: 192.168.1.101 RedBoot(tm) bootstrap and debug environment [ROM] Non-certified release, version UNKNOWN - built 10:41:41, May 14 2002 Platform: Compaq iPAQ Pocket PC (StrongARM 1110) Copyright (C) 2000, 2001, 2002, Red Hat, Inc. RAM: 0x00000000-0x01fc0000, 0x00014748-0x01f71000 available FLASH: 0x50000000 - 0x51000000, 64 blocks of 0x00040000 bytes each. RedBoot> version Display RedBoot version information version Arguments None Description The version command simply displays version information about RedBoot. Examples Display RedBoot's version. RedBoot> version RedBoot(tm) debug environment - built 09:12:03, Feb 12 2001 Platform: XYZ (PowerPC 860) Copyright (C) 2000, 2001, Red Hat, Inc. RAM: 0x00000000-0x00400000 Flash Image System (FIS) commandsflash image system flash image system commands commandsfis fis commandsIf 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 init Initialize Flash Image System (FIS) fis init -f Arguments Name Type Description Default -f All blocks of flash memory (except for the boot blocks) will be erased as part of the initialization procedure. Description This command is used to initialize the Flash Image System (FIS). It should normally only be executed once, when RedBoot is first installed on the hardware. If the reserved images or their sizes in the FIS change, due to a different configuration of RedBoot being used, it may be necessary to issue the command again though. Subsequent executions will cause loss of previously stored information in the FIS. Examples Initialize the FIS directory. RedBoot> fis init About to initialize [format] flash image system - continue (y/n)? y *** Initialize FLASH Image System Warning: device contents not erased, some blocks may not be usable ... Erase from 0x00070000-0x00080000: . ... Program from 0x0606f000-0x0607f000 at 0x00070000: . Initialize the FIS directory and all of flash memory, except for first blocks of the flash where the boot monitor resides. RedBoot> fis init -f About to initialize [format] flash image system - continue (y/n)? y *** Initialize FLASH Image System ... Erase from 0x00020000-0x00070000: ..... ... Erase from 0x00080000-0x00080000: ... Erase from 0x00070000-0x00080000: . ... Program from 0x0606f000-0x0607f000 at 0x00070000: . fis list List Flash Image System directory fis list -f Arguments Name Type Description Default -c Show image checksum instead of memory address (column Mem addr is replaced by Checksum). -d Show image data length instead of amount of flash occupied by image (column Length is replaced by Datalen). Description This command lists the images currently available in the FIS. Certain images used by RedBoot have fixed names and have reserved slots in the FIS (these can be seen after using the fis init command). Other images can be manipulated by the user. The images are listed in the order they appear in the FIS directory, not by name or creation time. Examples List the FIS directory. RedBoot> fis list Name FLASH addr Mem addr Length Entry point RedBoot 0x00000000 0x00000000 0x00020000 0x00000000 RedBoot config 0x0007F000 0x0007F000 0x00001000 0x00000000 FIS directory 0x00070000 0x00070000 0x0000F000 0x00000000 List the FIS directory, with image checksums substituted for memory addresses. RedBoot> fis list -c Name FLASH addr Checksum Length Entry point RedBoot 0x00000000 0x00000000 0x00020000 0x00000000 RedBoot config 0x0007F000 0x00000000 0x00001000 0x00000000 FIS directory 0x00070000 0x00000000 0x0000F000 0x00000000 List the FIS directory with image data lengths substituted for flash block reservation lengths. RedBoot> fis list -d Name FLASH addr Mem addr Datalen Entry point RedBoot 0x00000000 0x00000000 0x00000000 0x00000000 RedBoot config 0x0007F000 0x0007F000 0x00000000 0x00000000 FIS directory 0x00070000 0x00070000 0x00000000 0x00000000 fis free Free flash image fis free Description This command shows which areas of the flash memory are currently not in use. When a block contains non-erased contents it is considered in use. Since it is possible to force an image to be loaded at a particular flash location, this command can be used to check whether that location is in use by any other image. There is currently no cross-checking between actual flash contents and the FIS directory, which mans that there could be a segment of flash which is not erased that does not correspond to a named image, or vice-versa. Examples Show free flash areas. RedBoot> fis free 0xA0040000 .. 0xA07C0000 0xA0840000 .. 0xA0FC0000 fis create Create flash image fis create -b data address -l length -f flash address -e entry -r relocation address -s data length -n name Arguments Name Type Description Default -b Number Address of data to be written to the flash. Address of last loaded file. If not set in a load operation, it must be specified. -l Number Length of flash area to occopy. If specified, and the named image already exists, the length must match the value in the FIS directory. Length of area reserved in FIS directory if the image already exists, or the length of the last loaded file. If neither are set, it must be specified. -f Number Address of flash area to occopy. The address of an area reserved in the FIS directory for extant images. Otherwise the first free block which is large enough will be used. -e Number Entry address for an executable image, used by the fis load command. The entry address of last loaded file. -r Number Address where the image should be relocated to by the fis load command. This is only relevant for images that will be loaded with the fis load command. The load address of the last loaded file. -s Number Actual length of data written to image. This is used to control the range over which the checksum is made. It defaults to the length of the last loaded file. -n When set, no image data will be written to the flash. Only the FIS directory will be updated. name String Name of flash image. Description This command creates an image in the FIS directory. The data for the image must exist in RAM memory before the copy. Typically, you would use the RedBoot load command to load file into RAM and then the fis create command to write it to a flash image. Examples Trying to create an extant image, will require the action to be verified. RedBoot> fis create RedBoot -f 0xa0000000 -b 0x8c400000 -l 0x20000 An image named ‘RedBoot’ exists - continue (y/n)? n Create a new test image, let the command find a suitable place. RedBoot> fis create junk -b 0x8c400000 -l 0x20000 ... Erase from 0xa0040000-0xa0060000: . ... Program from 0x8c400000-0x8c420000 at 0xa0040000: . ... Erase from 0xa0fe0000-0xa1000000: . ... Program from 0x8c7d0000-0x8c7f0000 at 0xa0fe0000: . Update the RedBoot[RAM] image. RedBoot> load redboot_RAM.img Entry point: 0x060213c0, address range: 0x06020000-0x06036cc0 RedBoot> fis create RedBoot[RAM] No memory address set. An image named 'RedBoot[RAM]' exists - continue (y/n)? y * CAUTION * about to program 'RedBoot[RAM]' at 0x00020000..0x00036cbf from 0x06020000 - continue (y/n)? y ... Erase from 0x00020000-0x00040000: .. ... Program from 0x06020000-0x06036cc0 at 0x00020000: .. ... Erase from 0x00070000-0x00080000: . ... Program from 0x0606f000-0x0607f000 at 0x00070000: . fis load Load flash image fis load -b load address -c -d name Arguments Name Type Description Default -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. Description 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. Examples Load and run RedBoot[RAM] image. RedBoot> fis load RedBoot[RAM] RedBoot> go fis delete Delete flash image fis delete name Arguments Name Type Description Default name Number Name of image that should be deleted. Description This command removes an image from the FIS. The flash memory will be erased as part of the execution of this command, as well as removal of the name from the FIS directory. Certain images are reserved by RedBoot and cannot be deleted. RedBoot will issue a warning if this is attempted. Examples RedBoot> fis list Name flash addr Mem addr Length Entry point RedBoot 0xA0000000 0xA0000000 0x020000 0x80000000 RedBoot config 0xA0FC0000 0xA0FC0000 0x020000 0x00000000 FIS directory 0xA0FE0000 0xA0FE0000 0x020000 0x00000000 junk 0xA0040000 0x8C400000 0x020000 0x80000000 RedBoot> fis delete junk Delete image ‘junk’ - continue (y/n)? y ... Erase from 0xa0040000-0xa0060000: . ... Erase from 0xa0fe0000-0xa1000000: . ... Program from 0x8c7d0000-0x8c7f0000 at 0xa0fe0000: . fis lock Lock flash area fis lock -f flash_address -l length Arguments Name Type Description Default flash_address Number Address of area to be locked. length Number Length of area to be locked. Description This command is used to write-protect (lock) a portion of flash memory, to prevent accidental overwriting of images. In order to make make any modifications to the flash, a matching fis unlock command must be issued. This command is optional and will only be provided on hardware which can support write-protection of the flash space. Depending on the system, attempting to write to write-protected flash may generate errors or warnings, or be benignly quiet. Examples Lock an area of the flash RedBoot> fis lock -f 0xa0040000 -l 0x20000 ... Lock from 0xa0040000-0xa0060000: . fis unlock Unlock flash area fis unlock -f flash_address -l length Arguments Name Type Description Default flash_address Number Address of area to be unlocked. length Number Length of area to be unlocked. Description This command is used to unlock a portion of flash memory forcibly, allowing it to be updated. It must be issued for regions which have been locked before the FIS can reuse those portions of flash. Some flash devices power up in locked state and always need to be manually unlocked before they can be written to. Examples Unlock an area of the flash RedBoot> fis unlock -f 0xa0040000 -l 0x20000 ... Unlock from 0xa0040000-0xa0060000: . fis erase Erase flash area fis erase -f flash_address -l length Arguments Name Type Description Default flash_address Number Address of area to be erased. length Number Length of area to be erased. Description This command is used to erase a portion of flash memory forcibly. There is no cross-checking to ensure that the area being erased does not correspond to an existing image. Examples Erase an area of the flash RedBoot> fis erase -f 0xa0040000 -l 0x20000 ... Erase from 0xa0040000-0xa0060000: . fis write Write flash area fis write -b mem_address -l length -f flash_address Arguments Name Type Description Default mem_address Number Address of data to be written to flash. length Number Length of data to be writtem. flash_address Number Address of flash to write to. Description This command is used to write data from memory to flash. There is no cross-checking to ensure that the area being written to does not correspond to an existing image. Examples Write an area of data to the flash RedBoot> fis write -b 0x0606f000 -l 0x1000 -f 0x00020000 * CAUTION * about to program FLASH at 0x00020000..0x0002ffff from 0x0606f000 - continue (y/n)? y ... Erase from 0x00020000-0x00030000: . ... Program from 0x0606f000-0x0607f000 at 0x00020000: . Persistent State Flash-based Configuration and Control persistent state flash-based configuration and control flash-based configuration and control configuration and control flash-based RedBoot provides flash management support for storage in the flash memory of multiple executable images and of non-volatile information such as IP addresses and other network information. RedBoot on platforms that support flash based configuration information will report the following message the first time that RedBoot is booted on the target: flash configuration checksum error or invalid key This error can be ignored if no flash based configuration is desired, or can be silenced by running the fconfig command as described below. At this point you may also wish to run the fis init command. See other fis commands in . Certain control and configuration information used by RedBoot can be stored in flash. The details of what information is maintained in flash differ, based on the platform and the configuration. However, the basic operation used to maintain this information is the same. Using the fconfig -l command, the information may be displayed and/or changed. If the optional flag -i is specified, then the configuration database will be reset to its default state. This is also needed the first time RedBoot is installed on the target, or when updating to a newer RedBoot with different configuration keys. If the optional flag -l is specified, the configuration data is simply listed. Otherwise, each configuration parameter will be displayed and you are given a chance to change it. The entire value must be typed - typing just carriage return will leave a value unchanged. Boolean values may be entered using the first letter (t for true, f for false). At any time the editing process may be stopped simply by entering a period (.) on the line. Entering the caret (^) moves the editing back to the previous item. See “RedBoot Editing Commands”, . If any changes are made in the configuration, then the updated data will be written back to flash after getting acknowledgment from the user. If the optional flag -n is specified (with or without -l) then “nicknames” of the entries are used. These are shorter and less descriptive than “full” names. The full name may also be displayed by adding the -f flag. The reason for telling you nicknames is that a quick way to set a single entry is provided, using the format RedBoot> fconfig nickname value If no value is supplied, the command will list and prompt for only that entry. If a value is supplied, then the entry will be set to that value. You will be prompted whether to write the new information into flash if any change was made. For example RedBoot> fconfig -l -n boot_script: false bootp: false bootp_my_ip: 10.16.19.176 bootp_server_ip: 10.16.19.66 dns_ip: 10.16.19.1 gdb_port: 9000 net_debug: false RedBoot> fconfig bootp_my_ip 10.16.19.177 bootp_my_ip: 10.16.19.176 Setting to 10.16.19.177 Update RedBoot non-volatile configuration - continue (y/n)? y ... Unlock from 0x507c0000-0x507e0000: . ... Erase from 0x507c0000-0x507e0000: . ... Program from 0x0000a8d0-0x0000acd0 at 0x507c0000: . ... Lock from 0x507c0000-0x507e0000: . RedBoot> Additionally, nicknames can be used like aliases via the format %{nickname}. This allows the values stored by fconfig to be used directly by scripts and commands. Depending on how your terminal program is connected and its capabilities, you might find that you are unable to use line-editing to delete the ‘old’ value when using the default behaviour of fconfig nickname or just plain fconfig, as shown in this example: RedBoot> fco bootp bootp: false_ The user deletes the word “false;&rdquo and enters “true” so the display looks like this: RedBoot> fco bootp bootp: true Update RedBoot non-volatile configuration - continue (y/n)? y ... Unlock from ... RedBoot> _ To edit when you cannot backspace, use the optional flag -d (for “dumb terminal”) to provide a simpler interface thus: RedBoot> fco -d bootp bootp: false ? _ and you enter the value in the obvious manner thus: RedBoot> fco -d bootp bootp: false ? true Update RedBoot non-volatile configuration - continue (y/n)? y ... Unlock from ... RedBoot> _ One item which is always present in the configuration data is the ability to execute a script at boot time. A sequence of RedBoot commands can be entered which will be executed when the system starts up. Optionally, a time-out period can be provided which allows the user to abort the startup script and proceed with normal command processing from the console. RedBoot> fconfig -l Run script at boot: false Use BOOTP for network configuration: false Local IP address: 192.168.1.29 Default server IP address: 192.168.1.101 DNS server IP address: 192.168.1.1 GDB connection port: 9000 Network debug at boot time: false The following example sets a boot script and then shows it running. RedBoot> fconfig Run script at boot: false t Boot script: Enter script, terminate with empty line >> fi li Boot script timeout: 0 10 Use BOOTP for network configuration: false . Update RedBoot non-volatile configuration - continue (y/n)? y ... Erase from 0xa0fc0000-0xa0fe0000: . ... Program from 0x8c021f60-0x8c022360 at 0xa0fc0000: . RedBoot> RedBoot(tm) debug environment - built 08:22:24, Aug 23 2000 Copyright (C) 2000, Red Hat, Inc. RAM: 0x8c000000-0x8c800000 flash: 0xa0000000 - 0xa1000000, 128 blocks of 0x00020000 bytes ea. Socket Communications, Inc: Low Power Ethernet CF Revision C \ 5V/3.3V 08/27/98 IP: 192.168.1.29, Default server: 192.168.1.101 \ == Executing boot script in 10 seconds - enter ^C to abort RedBoot> fi li Name flash addr Mem addr Length Entry point RedBoot 0xA0000000 0xA0000000 0x020000 0x80000000 RedBoot config 0xA0FC0000 0xA0FC0000 0x020000 0x00000000 FIS directory 0xA0FE0000 0xA0FE0000 0x020000 0x00000000 RedBoot> NOTE The bold characters above indicate where something was entered on the console. As you can see, the fi li command at the end came from the script, not the console. Once the script is executed, command processing reverts to the console. NOTE RedBoot supports the notion of a boot script timeout, i.e. a period of time that RedBoot waits before executing the boot time script. This period is primarily to allow the possibility of canceling the script. Since a timeout value of zero (0) seconds would never allow the script to be aborted or canceled, this value is not allowed. If the timeout value is zero, then RedBoot will abort the script execution immediately. On many targets, RedBoot may be configured to run from ROM or it may be configured to run from RAM. Other configurations are also possible. All RedBoot configurations will execute the boot script, but in certain cases it may be desirable to limit the execution of certain script commands to one RedBoot configuration or the other. This can be accomplished by prepending {<startup type>} to the commands which should be executed only by the RedBoot configured for the specified startup type. The following boot script illustrates this concept by having the ROM based RedBoot load and run the RAM based RedBoot. The RAM based RedBoot will then list flash images. RedBoot> fco Run script at boot: false t Boot script: Enter script, terminate with empty line >> {ROM}fis load RedBoot[RAM] >> {ROM}go >> {RAM}fis li >> Boot script timeout (1000ms resolution): 2 Use BOOTP for network configuration: false ... Update RedBoot non-volatile configuration - continue (y/n)? y ... Unlock from 0x007c0000-0x007e0000: . ... Erase from 0x007c0000-0x007e0000: . ... Program from 0xa0015030-0xa0016030 at 0x007df000: . ... Lock from 0x007c0000-0x007e0000: . RedBoot> reset ... Resetting. +Ethernet eth0: MAC address 00:80:4d:46:01:05 IP: 192.168.1.153, Default server: 192.168.1.10 RedBoot(tm) bootstrap and debug environment [ROM] Red Hat certified release, version R1.xx - built 17:37:36, Aug 14 2001 Platform: IQ80310 (XScale) Copyright (C) 2000, 2001, Red Hat, Inc. RAM: 0xa0000000-0xa2000000, 0xa001b088-0xa1fdf000 available FLASH: 0x00000000 - 0x00800000, 64 blocks of 0x00020000 bytes each. == Executing boot script in 2.000 seconds - enter ^C to abort RedBoot> fis load RedBoot[RAM] RedBoot> go +Ethernet eth0: MAC address 00:80:4d:46:01:05 IP: 192.168.1.153, Default server: 192.168.1.10 RedBoot(tm) bootstrap and debug environment [RAM] Red Hat certified release, version R1.xx - built 13:03:47, Aug 14 2001 Platform: IQ80310 (XScale) Copyright (C) 2000, 2001, Red Hat, Inc. RAM: 0xa0000000-0xa2000000, 0xa0057fe8-0xa1fdf000 available FLASH: 0x00000000 - 0x00800000, 64 blocks of 0x00020000 bytes each. == Executing boot script in 2.000 seconds - enter ^C to abort RedBoot> fis li Name FLASH addr Mem addr Length Entry point RedBoot 0x00000000 0x00000000 0x00040000 0x00002000 RedBoot config 0x007DF000 0x007DF000 0x00001000 0x00000000 FIS directory 0x007E0000 0x007E0000 0x00020000 0x00000000 RedBoot> Executing Programs from RedBoot executing programs RedBootexecuting programsOnce 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 go -w timeout -c -n start_address Arguments Name Type Description Default -w timeout Number How long to wait before starting execution. 0 -c Boolean Go with caches enabled. caches off -n Boolean Go with network interface stopped. network enabled start_address Number Address in memory to begin execution. Value set by last load or fis load command. Description 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. If the -w option is used, RedBoot will print a message and then wait for a period of time before starting the execution. This is most useful in a script, giving the user a chance to abort executing a program and move on in the script. Examples Execute a program - no explicit output from RedBoot. RedBoot> go 0x40040 Execute a program with a timeout. RedBoot> go -w 10 About to start execution at 0x00000000 - abort with ^C within 10 seconds ^C RedBoot> Note that the starting address was implied (0x00000000 in this example). The user is prompted that execution will commence in 10 seconds. At anytime within that 10 seconds the user may type Ctrl+C on the console and RedBoot will abort execution and return for the next command, either from a script or the console. exec Execute a Linux kernel exec -w timeout -r ramdisk_address -s ramdisk_length -b load_address -l load_length -c kernel_command_line entry_point Arguments Name Type Description Default -w timeout Number Time to wait before starting execution. 0 -r ramdisk_address Number Address in memory of "initrd"-style ramdisk - passed to Linux kernel. None -s ramdisk_length Number Length of ramdisk image - passed to Linux kernel. None -b load_address Number Address in memory of the Linux kernel image. Value set by load or fis load -l load_length Number Length of Linux kernel image. none -c kernel_command_line String Command line to pass to the Linux kernel. None -x Boot kernel with endianess opposite of RedBoot endianess. Boot kernel with same endianess as RedBoot entry_address Number Starting address for Linux kernel execution Implied by architecture Description 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. This command is quite special (and unique from the go command) in that the program being executed may expect certain environmental setups, for example that the MMU is turned off, etc. The Linux kernel expects to have been loaded to a particular memory location which is architecture dependent(0xC0008000 in the case of the SA1110). Since this memory is used by RedBoot internally, it is not possible to load the kernel to that location directly. Thus the requirement for the "-b" option which tells the command where the kernel has been loaded. When the exec command runs, the image will be relocated to the appropriate location before being started. The "-r" and "-s" options are used to pass information to the kernel about where a statically loaded ramdisk (initrd) is located. The "-c" option can be used to pass textual "command line" information to the kernel. If the command line data contains any punctuation (spaces, etc), then it must be quoted using the double-quote character '"'. If the quote character is required, it should be written as '\"'. The "-x" option is optionally available on some bi-endian platforms. It is used to boot a kernel built with an endianess opposite of RedBoot. Examples Execute a Linux kernel, passing a command line, which needs relocation. The result from RedBoot is normally quiet, with the target platform being passed over to Linux immediately. RedBoot> exec -b 0x100000 -l 0x80000 -c "noinitrd root=/dev/mtdblock3 console=ttySA0" Execute a Linux kernel, default entry address and no relocation required, with a timeout. The emphasized lines are output from the loaded kernel. RedBoot> exec -c "console=ttyS0,38400 ip=dhcp nfsroot=/export/elfs-sh" -w 5 Now booting linux kernel: Base address 0x8c001000 Entry 0x8c210000 Cmdline : console=ttyS0,38400 ip=dhcp nfsroot=/export/elfs-sh About to start execution at 0x8x210000 - abort with ^C within 5 seconds Linux version 2.4.10-pre6 (...) (gcc version 3.1-stdsh-010931) #3 Thu Sep 27 11:04:23 BST 2001