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.
If the file does not already exist, you can create it as follows:
*SaveCMOS SDFS:$.!Boot.Loader.CMOS
After issuing the *SaveCMOS command, shut down (Shift-Ctrl-F12) and restart.1
1 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.
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
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:
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.
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:
SaveCMOS <Boot$Dir>.Loader.CMOS
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 here.
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.