Primary functions of an operating system

What are the primary functions of an operating system?