category: RaspberryPi <div id="toc_heading"></div><div id="toc"></div> h2. Introduction The Raspberry Pi does not have any battery-backed memory, so a file called "CMOS" (in the DOS partition of the boot SD) holds the CMOS RAM settings. This file is loaded into RAM when the system is booted, and any changes to CMOS RAM settings are stored in the file. h2(#Create). Creating the file If the file does not already exist, you can create it as follows: <pre> *SaveCMOS SDFS:$.!Boot.Loader.CMOS </pre> After issuing the *SaveCMOS command, shut down (Shift-Ctrl-F12) and restart.[1] fn1. <small>RISC OS will only save configuration changes to the file if it was present at boot time. If the file is created after the session has started, any further configuration changes in that session will not be saved.</small> h2(#Load). Loading The Raspberry Pi bootloader looks for the file in the same partition that "config.txt" was found. Two lines in "config.txt" control the loading of the file: @ramfsfile=CMOS@ - the name of the file to load @ramfsaddr=0x508000@ - the start location in memory to use h2(#Save). Saving RISC OS will save CMOS RAM changes to the file. To allow for the possibility that the SD card is fully DOS format (i.e. !Boot has been moved to another drive), RISC OS tries two file locations in turn: # SDFS:$.CMOS # SDFS:$.!Boot.Loader.CMOS It is important to note that RISC OS tries $.CMOS *first*. If you have placed another file called "CMOS" in SDFS:$, that file will be overwritten when you next try to make any configuration changes. Also, the attempted configuration changes will not survive a reboot as they have been saved in the wrong place. The fix is to delete (or rename) the additional "CMOS" file. h2(#USB). The "boot from USB" issue The Pi 3 and Pi 4 will boot from USB, but there's a problem. When booting from USB, the Pi boot loader will be loading the CMOS file from the USB drive, but RISC OS will be saving any CMOS RAM updates to the SD card. As these have been saved to the wrong place they won't survive a reload. You have two options: # In !Boot.Choices.Boot, create a directory called PostDesk (if it doesn't already exist) and then create an Obey file called !cmos-save inside !Boot.Choices.Boot.PostDesk. The Obey file should contain the following command:<br />@SaveCMOS <Boot$Dir>.Loader.CMOS@<br />This will save the CMOS contents to !Boot.Loader.CMOS (on USB) every time a tidy shutdown is performed. Note that CMOS changes will *not* be saved in other circumstances (system crash, Ctrl-Break etc.) # Alternatively, modify the SDCMOS module so that RISC OS writes to SCSI:$.!Boot.Loader.CMOS instead of SDFS:$.!Boot.Loader.CMOS (a possible approach is given in "this forum posting":/forum/forums/5/topics/14365#posts-91506 but it's not for the faint-hearted). Users wishing to reduce SD card wear-and-tear would be better advised to continue booting from the SD card, but to move the !Boot directory to a USB drive, as described [[Raspberry Pi: Moving !Boot to another drive|here]]. h2(#Reset). Resetting CMOS RAM To reset CMOS RAM settings to factory defaults on the Raspberry Pi, simply delete the "CMOS" file. After rebooting, you should recreate the file as described above. ---