To find a suitable Cisco IOS image, the switch goes through the following steps:
Step 1. It attempts to automatically boot by using information in the BOOT environment variable.
Step 2. If this variable is not set, the switch performs a top-to-bottom search through the flash file system. It loads and executes the first executable file, if it can.
Step 3. The IOS software then initializes the interfaces using the Cisco IOS commands found in the configuration file and startup configuration, which is stored in NVRAM.
Note: The boot system command can be used to set the BOOT environment variable.