help with boot register values plz

in CCNA & CCENT
hey guys,
I'm not really understanding the way to derive boot register values. I know 2102 is default (I assume that means IOS is loaded from Flash?) but I don't understand the logic in determining that. I havn't played with the config-register command on a router, maybe that would help me to understand this better, and I havn't got a look at a table explaining what options are associated with which numbers. ANY help is appreciated, thanks in advance
I'm not really understanding the way to derive boot register values. I know 2102 is default (I assume that means IOS is loaded from Flash?) but I don't understand the logic in determining that. I havn't played with the config-register command on a router, maybe that would help me to understand this better, and I havn't got a look at a table explaining what options are associated with which numbers. ANY help is appreciated, thanks in advance

Comments
-
BubbaJ Member Posts: 323
The www.cisco.com site has a search facility that can be used to research these things.
Usage Guidelines
Not all versions in the ROM monitor support this command. Refer to your platform documentation for more information on ROM monitor mode.
If you use this command without specifying the configuration register value, the router prompts for each bit of the configuration register.
The lowest four bits of the configuration register (bits 3, 2, 1, and 0) form the boot field. The boot field determines if the router boots manually, from ROM, or from Flash or the network.
To change the boot field value and leave all other bits set to their default values, follow these guidelines:
•If you set the configuration register boot field value to 0x0, you must boot the operating system manually with the boot command.
•If you set the configuration register boot field value to 0x1, the router boots using the default ROM software.
•If you set the configuration register boot field to any value from 0x2 to 0xF, the router uses the boot field value to form a default boot filename for booting from a network server.
For more information about the configuration register bit settings and default filenames, refer to the appropriate router hardware installation guide.
Examples
In the following example, the configuration register is set to boot the system image from Flash memory:
confreg 0x210F
In the following example, no configuration value is entered, so the system prompts for each bit in the register:
rommon 7 > confreg
Configuration Summary
enabled are:
console baud: 9600
boot: the ROM Monitor
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]:
enable "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 [0]: 0
change the boot characteristics? y/n [n]: y
enter to boot:
0 = ROM Monitor
1 = the boot helper image
2-15 = boot system
[0]: 0
Configuration Summary
enabled are:
diagnostic mode
console baud: 9600
boot: the ROM Monitor
do you wish to change the configuration? y/n [n]:
You must reset or power cycle for new config to take effect.
rommon 8> -
Cauthon Member Posts: 9 ■□□□□□□□□□
The config register is a series of flags or values that are interpretted by the router when it's booting. Cisco lists common register values and the meaning of the fields in the register here: http://www.cisco.com/en/US/products/hw/routers/ps133/products_tech_note09186a008022493f.shtml#config-reg-meaning
You have to convert the register value to binary to really extract its meaning. 0x2102 is 0010 0001 0000 0010 in binary.
The right-most 3 bits (010) are a field that tells the IOS whether and how to load an IOS system image. The rest of the bits are flags which are either turned on or off. Each individual bit is a flag which represents a single boot option (with the exception of the console line speed bits).
The 8th bit (9th digit) flag is set to on and that tells the router to ignore breaks.
The 13th bit (14th digit) is set to on and that tells the router to boot to ROM if loading IOS fails.
You can work with these flags by memorizing their HEX equivelants and then combining them using a calculator's OR function.
0010 0000 0000 0000 = 0x2000 (boot to ROM on failure)
0000 0001 0000 0000 = 0x0100 (ignore break)
0000 0000 0000 0010 = 0x0002 (load IOS from Flash)
0x2000 | 0x0100 | 0x0002 = 0x2102
The vertical bar I've used above is the mathematical binary-OR operator in the C programming language, and it is equivelant to the OR key on the Win32 calc.exe scientific view. It works like addition when the two values are mutually exclusive at a binary level.
If you want to take the standard config register and tell the router to ignore the configuration in NVRAM you can OR the "Ignore NVRAM Flag" of 0x0040 (0100 0000).
0x2102 | 0x0040 = 0x2142
If you want to see if a flag is set in an existing configuration register you can use the AND operator. Compare the result of
0x2102 AND 0x0040 with the result of 0x2142 AND 0x0040. A result of 0 indicates that the flag is not set.
Mike