In a mobile device, an operating system reside in: Firmware
Firmware is a permanent software that programmed into read-only memory. Firmware usually come as a built-in for a product that you buy and you couldn't configure the setting in the firmware without using third-party programs.