Table Of Contents
Using the ROM Monitor
Entering ROM Monitor Mode
ROM Monitor Commands
ROM Monitor Command Syntax Conventions
ROM Monitor Command Descriptions
Router Management Commands
Boot Commands in the ROM Monitor
Informational Commands in the ROM Monitor
Other Useful ROM Monitor Commands
Debugging Commands
Configuration Register Commands
Recovering Cisco IOS Software Images
Copying an Image from the Console Using the xmodem Command
Description and Options of the xmodem Command
Console Requirements
Procedure for the xmodem Command
Copying an Image from a TFTP Server Using the tftpdnld Command
Restrictions on the tftpdnld Command
Procedure for the tftpdnld Command
Using the ROM Monitor
This appendix describes the use of the ROM monitor (also called the bootstrap program), which is the firmware that runs when you power up or restart a Cisco router. During normal operation, the ROM monitor helps to initialize the processor hardware and boot the operating system software. You can also use the ROM monitor to:
•
Help isolate hardware problems encountered when installing your router.
•
Download a new Cisco IOS image if the operating image is corrupted.
This appendix contains the following sections:
•
Entering ROM Monitor Mode
•
ROM Monitor Commands
•
ROM Monitor Command Syntax Conventions
•
ROM Monitor Command Descriptions
•
Recovering Cisco IOS Software Images
Entering ROM Monitor Mode
To use the ROM monitor, you must have access to the console port. Refer to the "Connecting to a Console Terminal or Modem" section on page 3-20 for information on connecting the console cable.
There are two ways of entering the ROM monitor mode:
•
Use the reload command and the Break key to enter the ROM monitor mode for one-time use.
Break (system interrupt) is always enabled for 60 seconds after the router reboots, regardless of whether Break is configured on or off in the configuration register (see Appendix C, "Configuration Register."). During this 60-second period, you can break to the ROM monitor prompt by pressing the Break key.
Note
If your console terminal does not have a Break key, refer to the terminal emulator documentation for instructions on generating a break (system interrupt).
•
Set the configuration register so that the router enters the ROM monitor mode whenever it boots.
The new configuration register value, 0x0, is effective after the router is rebooted with the reload command. The router remains in the ROM monitor and does not boot the operating system.
As long as the configuration register value remains 0x0, you must manually boot the operating system from the console. Refer to the boot command in the "ROM Monitor Command Descriptions" section.
The two methods of entering the ROM monitor mode are as follows:
Enter ROM Monitor Mode by Using the reload Command
Connect to the router from a console, and follow these steps:
Step 1
Restart the router with the reload command.
Step 2
Press the Break key during the first 60 seconds of the system booting.
This forces the router into ROM monitor mode, and the ROM monitor prompt is displayed:
rommon 1>
Enter ROM Monitor Mode by Resetting the Configuration Register
Connect to the router from a console, and follow these steps:
Step 1
Set the bits 3, 2, 1, and 0 of the configuration register to zero:
Router# configuration-register 0x0
Step 2
Restart the router with the reload command:
The router boots into the ROM monitor mode, and the ROM monitor prompt is displayed:
rommon 1>
Note
The number that appears in the ROM monitor prompt (1>, 2>, and so forth) is the line number. It increments each time you enter a ROM monitor command.
ROM Monitor Commands
Showing ROM Monitor Commands
Enter ? or help at the ROM monitor prompt to see a list of available commands. For example:
alias set and display aliases command
boot boot up an external process
break set/show/clear the breakpoint
confreg configuration register utility
cont continue executing a downloaded image
context display the context of a loaded image
cookie display contents of cookie PROM in hex
dev list the device table
dir list files in the file system
dis display instruction stream
dnld serial download a program module
frame print out a selected stack frame
help monitor builtin command help
history monitor command history
iomemdef set IO mem to a default 25%
meminfo main memory information
repeat repeat a monitor command
rommon-pref select ROMMON
set display the monitor variables
stack produce a stack trace
sync write monitor environment to NVRAM
sysret print out info from last system return
tftpdnld tftp image download
unset unset a monitor variable
xmodem x/ymodem image download
Note
Not all ROM monitor commands are available on all platforms.
Displaying Information About ROM Monitor Command Syntax
To display information about command syntax, enter the command name followed by -?.
Entering ROM Monitor Commands
ROM monitor commands are case-sensitive. Enter commands exactly as shown.
Interrupting ROM Monitor Commands
You can end any command by generating a Break (system interrupt) at the console.
ROM Monitor Command Syntax Conventions
The ROM monitor syntax in this appendix uses the following conventions:
•
Square brackets [ ] denote an optional element. In the following example, the element abc is not required, but you can specify it if you choose:
command [abc]
•
If a minus option is followed by a colon (for example, [-s:]) you must provide an argument for the option.
•
A term in italics means that you must fill in the appropriate information. In the following example, you replace the term in italics with the interface type you are using:
command interface-type
ROM Monitor Command Descriptions
Router Management Commands
This section lists some useful ROM monitor commands. Refer to the Cisco IOS configuration guides and command references for more information on ROM monitor commands.
Boot Commands in the ROM Monitor
Functions of Boot Commands
The router always boots first from a Cisco IOS image in flash memory, because there is no separate, dedicated boothelper image ([rx]boot). The first image in flash memory functions as the boothelper image, but you can override this by setting the BOOTLDR Monitor environment variable to point to another image. If the ROM monitor does not recognize a device ID specified in the boot command (device does not exist, or command entered incorrectly), the router boots from the first image in flash memory.
To boot a router from a Cisco IOS image on a TFTP server (netboot), the installed DRAM must be adequate to hold two uncompressed Cisco IOS images: the image from flash memory and the image downloaded from the TFTP server.
If the router is configured to boot from a TFTP server (boot bits in the configuration register are set from 2 to 15), the router first boots from the image in flash memory. It decompresses that image in DRAM, parses the boot system commands, downloads the Cisco IOS image from the TFTP server, and decompresses it in DRAM. After the Cisco IOS image from the TFTP server is in DRAM, the DRAM memory occupied by the boothelper image is released.
Note
Booting from a TFTP server is useful if the router does not have enough flash memory to hold large images. With a small image in flash memory (just large enough to support the necessary interfaces), the router boots from flash memory, and then the larger image is downloaded from the TFTP server.
Entering Boot Commands
The boot command syntax is as follows, where:
•
partition is a partition number in the flash memory.
•
filename is the Cisco IOS image filename.
•
tftpserver is the IP address of the TFTP server.
•
-x directs the router to load the image but not execute the boot process.
•
-v (verbose) specifies that progress print setting messages and error information be displayed.
boot [flash: [partition: [filename]] | slot0: [partition: [filename]] | slot1: [partition: [filename]] | filename tftpserver] [-x] [-v]
Some examples of boot commands are as follows:
Note
In all boot commands, boot can be entered as b.
•
boot—Boots from the first Cisco IOS image in internal flash memory.
•
boot flash:—Boots from the first Cisco IOS image in the internal Flash memory.
•
boot flash: partition:—Boots from the first Cisco IOS image in the specified partition in internal flash memory.
•
boot flash: filename—Boots from the Cisco specified IOS image in internal flash memory.
•
boot flash: partition: filename—Boots from the specified Cisco IOS image in the specified partition in internal flash memory.
•
boot slot0:—(Cisco 2691 only) Boots from the first Cisco IOS image in the first partition in flash memory in slot 0.
•
boot slot0:2:—(Cisco 2691 only) Boots from the first Cisco IOS image in the second partition in compact flash memory in slot 0.
•
boot slot0: filename—(Cisco 2691 only) Boots from the specified Cisco IOS image in compact flash memory in slot 0.
•
boot slot1:3: filename—(Cisco 2691 only) Boots from the specified Cisco IOS image in the third partition in compact flash memory in slot 1.
•
boot filename tftpserver— Boots from the specified Cisco IOS image on the specified TFTP server (after first booting from flash). For example:
boot c2600-i-mz 172.15.19.11
Note
Use the CLI commands show version and show hardware to see the source of the currently running Cisco IOS image.
Informational Commands in the ROM Monitor
dev—(Cisco 2691 only) Lists boot device identifications on the router, for example:
flash: internal compact flash
slot0: external compact flash
dir device:[partition:]—Lists the files on the named device. For example:
File size Checksum File name
2229799 bytes (0x220627) 0x469e C2600-j-m2.113-4T
help—Shows a summary of ROM monitor commands (equivalent to ?).
meminfo—Displays main memory size, starting address, and available range; size of packet memory; and size of NVRAM. The following example shows the meminfo command:
Available main memory starts at 0xa000e000, size 32704KB
IO (packet) memory size: 25 percent of main memory.
meminfo [-l]—The meminfo command with the -l option shows supported DRAM configurations. The following example shows an example of the meminfo -l command:
Supported memory configurations:
Other Useful ROM Monitor Commands
reset or i—Resets and initializes the router, similar to power on.
tftpdnld—(Except Cisco 2691) Downloads an image using TFTP from a remote server. See the "Copying an Image from a TFTP Server Using the tftpdnld Command" procedure.
Debugging Commands
Most debugging commands are functional only when Cisco IOS software has crashed or failed to initialize (boot). Debugging commands should normally be entered only under the direction of a Cisco engineer. If you enter a debugging command and Cisco IOS crash information is not available, the following error message appears:
"xxx: kernel context state is invalid, cannot proceed."
The following ROM monitor debugging commands provide information about software failures:
•
stack or k—Produces a stack trace.
•
context—Views processor context.
•
frame—Views an individual stack frame.
•
sysret—Views return information from the last booted system image. This information includes the reason for terminating the image, a stack dump of up to eight frames, and, if an exception is involved, the address where the exception occurred. For example:
count: 19, reason: a SegV exception
pc:0x802b1040, error address: 0x802b1040
FP: 0x80908398, PC: 0x802b102c
FP: 0x809083b0, PC: 0x802b0b88
FP: 0x809083d8, PC: 0x8017039c
FP: 0x809083e8, PC: 0x8016f764
Configuration Register Commands
The configuration register resides in NVRAM. You can view or modify the configuration register from either the ROM monitor or the operating system software.
For procedures used to change the configuration register from the operating system, and for information about configuration register settings, see Appendix C, "Configuration Register."
To modify the configuration register from the ROM monitor, you can:
•
Enter the confreg command by itself for menu mode. See the "Modifying the Configuration Register in Menu Mode" section below.
•
Enter the confreg command plus the new hexidecimal value of the configuration register. See the "Modifying the Configuration Register by Hexidecimal Entry" section.
In either case, the new configuration register value is written into NVRAM, but is not effective until you reboot (using the ROM monitor reset command) or power cycle the router.
Modifying the Configuration Register in Menu Mode
Entering the confreg command without an argument displays the contents of the configuration register, and prompts you to alter the contents by describing the meaning of each bit.
The following display shows an example of the confreg command:
do you wish to change the configuration? y/n [n]: y
enable "diagnostic mode"? y/n [n]: y
enable "use net in IP bcast address"? y/n [n]:
enable "load rom after netboot fails"? y/n [n]:
enable "use all zero broadcast"? y/n [n]:
disable "break/abort has effect"? y/n [n]:
enable "ignore system config info"? y/n [n]:
change console baud rate? y/n [n]: y
enter rate: 0 = 9600, 1 = 4800, 2 = 1200, 3 = 2400
4 = 19200, 5 = 38400, 6 = 57600, 7 = 115200 [0]: 0
change the boot characteristics? y/n [n]: y
1 = the boot helper image
do you wish to change the configuration? y/n [n]:
You must reset or power cycle for new config to take effect
Modifying the Configuration Register by Hexidecimal Entry
Entering the confreg command plus a hexidecimal value changes the contents of the configuration register. The syntax is confreg [hexnum]; values entered are always interpreted as hexadecimal. The following example changes the value of the configuration register to the factory default:
You must reset or power cycle the router for new configuration to take effect.
Recovering Cisco IOS Software Images
If your Cisco router experiences difficulties and no longer contains a valid Cisco IOS software image in flash memory, you can download a new Cisco IOS image using one of the following ROM monitor commands:
•
xmodem—(All Cisco 2600 series routers) Use this command to copy a Cisco IOS image from the console, if the computer attached to your console has a terminal emulator with Xmodem capability. See the "Copying an Image from the Console Using the xmodem Command" procedure.
Note
Downloading a Cisco IOS image from a console is very slow. This procedure should be used only in an emergency and is not recommended for normal Cisco IOS image upgrades.
For the fastest possible download from a console, set the console speed to 115200 bps by using the confreg ROM monitor command. See the "Configuration Register Commands" procedure.
•
tftpdnld—(Except Cisco 2691) Use this command to copy a Cisco IOS image from a TFTP server that is accessible through the FastEthernet 0/0, Ethernet 0/0, or Token Ring 0/0 port. See the "Copying an Image from a TFTP Server Using the tftpdnld Command" procedure.
Note
The tftpdnld command is not available on the Cisco 2691 router. The recommended method for installing a Cisco IOS image on a Cisco 2691 router is from a CompactFlash memory card loaded in the external CompactFlash memory card slot. See the "Entering Boot Commands" procedure.
Copying an Image from the Console Using the xmodem Command
Description and Options of the xmodem Command
The xmodem command establishes a connection between a console and the router console port for disaster recovery, if both the boot and system images are erased from flash memory.
xmodem [filename]—Establishes an Xmodem connection between the console and the router. The optional argument filename specifies the source file containing the Cisco IOS image.
Other options include the following:
•
c—Use cyclic redundancy check (CRC-16).
•
y—Use Ymodem transfer protocol.
•
r—Copy the image to dynamic random-access memory (DRAM) for launch.
•
x—Do not launch image on completion of download.
Console Requirements
The console computer (PC) must have the following files to use this procedure:
•
Terminal emulation application program supporting one of the following file transfer protocols:
–
Xmodem
–
Xmodem-CRC
–
Xmodem-1K
–
Ymodem
•
Cisco IOS image file
Procedure for the xmodem Command
To copy a Cisco IOS image from a console to flash memory, perform the following procedure.
Note
File transfer from a console is slow and will take many minutes.
Step 1
Connect a console to the router's console port using the instructions in the "Connecting to a Console Terminal or Modem" section on page 3-20.
Step 2
Power up the router. The power-on self-test diagnostics run and the boot ROM searches for a valid boot image and Cisco IOS image in flash memory. If the boot image and Cisco IOS image are not found, the ROM monitor prompt is displayed:
Step 3
Enter the xmodem command and the name of the source file containing the Cisco IOS image:
rommon 1> xmodem filename
When the source file is found, messages similar to the following appear:
Do not start upload program yet...
File size Checksum File name
2537948 bytes (0x26b9dc) c2600-i-mz.122-10.bin
WARN: This operation will ERASE bootflash. If the xmodem
download to bootflash fails, you will lose any good image
you may already have in bootflash.
Invoke this application only for disaster recovery.
Do you wish to continue? [yes/no]:
Step 4
Enter yes to copy the Cisco IOS image into flash memory. Messages similar to the following appear:
Ready to receive file prog ...
Erasing flash at 0x3000000
program flash location 0x3000000
The router is now ready to boot from the Cisco IOS image. Enter the reset ROM monitor command to reboot the router.
Note
If you have set the console speed to 115200, you may want to reset it to the previous speed or to the factory default speed (typically 9600 bps). See the "Configuration Register Commands" procedure.
Copying an Image from a TFTP Server Using the tftpdnld Command
The tftpdnld command downloads a Cisco IOS software image from a remote server accessible from a FastEthernet, Ethernet, or Token Ring network interface on a Cisco 2600 series router (except Cisco 2691). The tftpdnld command downloads the Cisco IOS software image into flash memory using TFTP.
Restrictions on the tftpdnld Command
The following software restrictions apply when using the tftpdnld command:
•
Ethernet and FastEthernet—Accepts and sends only Ethernet V2.0 data packets.
•
Token Ring—Accepts and sends only Token Ring frames with IEEE802.3 SNAP frames. Does not support any frames with routing information fields (RIFs), limiting all use of the tftpdnld command to a TFTP server on the local ring. If the TFTP server resides off the local ring, you must establish a path to the server through a router or transparent bridge from the local ring.
Procedure for the tftpdnld Command
Step 1
Specify the required variables, for example:
rommon 1> IP_ADDRESS=172.15.19.11
rommon 2> IP_SUBNET_MASK=255.255.255.0
rommon 3> DEFAULT_GATEWAY=172.16.19.1
rommon 4> TFTP_SERVER=172.15.20.10
rommon 5> TFTP_FILE=/tftpboot/c2600-i-mz
The syntax for specifying the variables is:
The variables that you must specify include the following:
•
IP_ADDRESS—IP address for the router you are using.
•
IP_SUBNET_MASK—Subnet mask for the router you are using.
•
DEFAULT_GATEWAY—Default gateway for the router you are using (not required if the TFTP server is in the same subnet as the router).
•
TFTP_SERVER—IP address of the server from which you want to download the image file.
•
TFTP_FILE—Name of the file that you want to download.
The following tftpdnld command variables are optional:
•
TFTP_VERBOSE—Print setting. The default is 1.
–
0=quiet—After you enter the tftpdnld command, the prompt
Do you wish to continue? y/n:
is the only information that appears until the command completes successfully or fails.
–
1=progress—Displays the state of the required tftpdnld command variables. Also displays progress characters to indicate successful and lost packet transmissions.
–
2=verbose—Displays all progress print setting messages, along with error information. The information provided by this print setting may be useful when debugging interface link and configuration problems that may prevent connecting to the TFTP server.
•
TFTP_RETRY_COUNT—Number of times from 1 to 65535 that the ROM monitor will retry address resolution protocol (ARP) and acknowledge (ACK). The default is 7 retries.
•
TFTP_TIMEOUT—Overall timeout of the download operation in seconds. The range is from 1 to 65535 seconds. The default is 7200 seconds.
•
TFTP_CHECKSUM—Performs a checksum test on the image. 0=checksum off, 1=checksum on. The default is 1.
•
FE_SPEED_MODE—Sets the Fast Ethernet speed and duplex mode. 0=10 Mbps half-duplex mode, 1=10 Mbps full-duplex mode, 2=100 Mbps half-duplex mode, 3=100 Mbps full-duplex mode, and 4=auto-negotiation. The default is 4.
Note
Specify the FE_SPEED_MODE variable only for routers with a Fast Ethernet network interface.
•
TR_SPEED_MODE—Sets the Token Ring speed and duplex mode. 0=4 Mbps half-duplex mode, 1=4 Mbps full-duplex mode, 2=16 Mbps half-duplex mode, and 3=16 Mbps full-duplex mode. The default is 2.
Note
Specify the TR_SPEED_MODE variable only for routers with a Token Ring network interface; or for routers with both an Ethernet and a Token Ring port, those routers that are set to use the Token Ring port with the tftpdnld command.
•
TR_1E1R_PORT—Sets the port to be used with the tftpdnld command. 0=Use Ethernet port; 1=Use Token Ring port. The default is 0.
Note
Specify the TR_1E1R_PORT variable only for those routers with both an Ethernet and a Token Ring port.
Step 2
Enter the tftpdnld [-h] [-r] command:
Options include the following:
•
h—Displays the tftpdnld command help screen.
•
r—Loads the Cisco IOS software image only to DRAM and launches the image without writing the image into flash memory.
IP_SUBNET_MASK=255.255.255.0
DEFAULT_GATEWAY=172.16.19.1
TFTP_FILE=/tftpboot/2600-i-mz
Invoke this command for disaster recovery only.
WARNING: all existing data in all partitions on flash will be lost!
Do you wish to continue? y/n: [n]:
Step 3
Enter y to download the Cisco IOS software image. When the process is complete, the ROM monitor mode prompt appears on your screen.
The router is now ready to boot from the Cisco IOS image. Enter the boot ROM monitor command to reboot the router.