Table Of Contents
Using the ROM Monitor
Entering ROM Monitor Mode
ROM Monitor Commands
ROM Monitor 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
Description and Options of the xmodem Command
Console Requirements
Procedure for the xmodem 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.
•
Copy a new Cisco IOS image from a console PC if the operating image is corrupted.
This appendix contains the following sections:
•
Entering ROM Monitor Mode
•
ROM Monitor Commands
•
ROM Monitor 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 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 "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.
Step 3
Router# reload
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 Syntax Conventions
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 the 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. The first image in Flash memory is invoked if the ROM monitor does not recognize a device ID specified in the boot command. The router cannot boot if there is no Cisco IOS 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, 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 file name
•
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 the 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 the internal Flash memory.
•
boot flash: filename—Boots from the specified IOS image in the internal Flash memory.
•
boot flash: partition: filename—Boots from the specified Cisco IOS image in the specified partition in the internal Flash memory.
•
boot slot0:—Boots from the first Cisco IOS image in the first partition in the PCMCIA Flash memory in slot 0.
•
boot slot0:2:—Boots from the first Cisco IOS image in the second partition in the PCMCIA Flash memory in slot 0.
•
boot slot0: filename— Boots from the specified Cisco IOS image in the PCMCIA Flash memory in slot 0.
•
boot slot1:3: filename—Boots from the specified Cisco IOS image in the third partition in the PCMCIA 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 c3660-is-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—List boot device identifications on the router, for example:
dir device:[partition:]—Lists the files on the named device. For example:
File size Checksum File name
2229799 bytes (0x220627) 0x469e C3660-is-mz.122-13T
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:
Main memory size: 16 MB in 32-bit mode.
Available main memory starts at 0xa000e000, size 16328KB
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:
The following 64 bit memory configs are supported:
-------------------------------------------------
DIMM SOCKET 0 DIMM SOCKET 1 TOTAL MEMORY
------------- ------------- ------------
Other Useful ROM Monitor Commands
reset or i—Resets and initializes the router, similar to power on.
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—Produce a stack trace.
•
context—View processor context.
•
frame—View an individual stack frame.
•
sysret—View 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 "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 menu mode:
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 both the boot and system images have been erased and only the ROM monitor is available, you can use the ROM monitor xmodem command to copy a Cisco IOS image to Flash memory from the console. The console can be connected directly to the router through the console port, or remotely through a modem connected to the auxiliary port.
Note
Copying a Cisco IOS image from the 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.
Note
Using a PCMCIA card to update the Cisco IOS image is much faster than using the console port and, when available, is the recommended method of recovering a software image.
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 the console using the instructions in the "Connecting to a Console Terminal or Modem" section.
Step 2
Power on 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
Step 4
The source file is searched for and found. Messages similar to the following appear:
Do not start upload program yet...
File size Checksum File name
2537948 bytes (0x26b9dc) 3640-boot-l
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 5
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 wish to reset it to the previous speed or to the factory default speed (typically 9600 bps). See the "Configuration Register Commands" procedure.