Cisco IOS is stored in Flash memory, which is non-volatile EEPROM. During bootup, IOS is copied from Flash to RAM where it actually runs. ROM contains bootstrap code, NVRAM stores startup-config, and RAM runs the operating system but doesn't store it persistently.