Here are the main functions of an operating system:
1) Manage the resources of the device
The operating system controls how much of each resource is distributed, and it controls things like the processing unit and memory.
2) Establish a interface for the user of the device
The operating system must classify what the classes of the script/code have to do and what they implement.
3) Service application software
The operating system must service each application that is downloaded onto the device. It must balance it's use of storage between apps.