Operating System

OS

A program that controls the execution of application programs and acts as an standardized interface between applications and hardware.

  • OS provides a convenient, feature rich, secure, and consistent interface for applications to use.
  • OS provides a uniform, abstract representation of resources that can be requested and accessed by application.
    • a virtual machine

Define the operating system by its functionalities. The one program running at all times on computer is Kernel. The operating system will give you a level of abstraction for the hardware, provide protection across resources, provides security and authentication.

  • Handling input/output
  • Managing memory and storage
  • Scheduling tasks & sharing resources

There are three key ideas to Operating System: Virtualization, Concurrency and Persistence.

The Operating System is in charge of making sure the system operates correctly and efficiently in an easy-to-use manner.

We often refer the OS as a Virtual Machine and provides some interfaces (APIs) that you can call. Also known as a Resource Manager.

Objectives

Convenience

  • Need no knowledge of the underlying hardware
  • Provides an abstraction of standard services

Efficiency

  • Move burden of optimization from developers to tools

Ability to evolve ( interfaces & components)

  • Can replace internals as long as the interface stays the same

As a Resource Manager

  •  The OS functions in the same way as ordinary computer software; that is, it is a program or suite of programs executed by the processor.
  •  The OS frequently relinquishes control and must depend on the processor to allow it to regain control.

Like other computer programs, the OS provides instructions for the processor.

The key difference is in the intent of the program.

The OS directs the processor in the use of the other system resources and in the timing of its execution of other programs. But in order for the processor to do any of these things, it must cease executing the OS program and execute other programs. Thus, the OS relinquishes control for the processor to do some “useful” work and then resumes control long enough to prepare the processor to do the next piece of work.

A portion of the OS is in main memory. This includes the kernel, or nucleus, which contains the most frequently used functions in the OS and, at a given time, other portions of the OS currently in use.

The memory management hardware in the processor and the OS jointly control the allocation of main memory

The OS decides when an I/O device can be used by a program in execution and controls access to and use of files.

The processor itself is a resource, and the OS must determine how much processor time is to be devoted to the execution of a particular user program.

OS Structure

  1. Store data about the process (Process Control Block)
  2. Processes must wait in some sort of queue until it’s their turn

OS Control Structure

The OS constructs and maintains tables of information about each entity that it is managing: Memory tables are used to keep track of both main (real) and secondary (virtual) memory. It also maintains file tables. These tables provide existence of files, their location on secondary memory, current status and other attributes.

Operating System Concerns

  • Keep track of various processes
  • Allocate and deallocate resources
    • Processor time
    • Memory
    • Files
    • I/O devices
  • Protect data and resources from processes to processes
  • Functions of process must be independent of the speed of execution of other concurrent processes