The primary purpose of an operating system are as follow:
1. Program execution
2. Handling input/output operations.
3. Manipulation of file system
4. Error detection and handling
5. Resource allocation
6. Accounting
7. Information and resources protection