Operating system

From StudyWiki

(Redirected from OS)
Jump to: navigation, search


Contents

Overview

  • a program that runs the computer
  • Operating systems (OSs) bridge between hardware and software
    • a layer of services with 2 main functions
      • Managing Resources: manages resources shared between users and maximises utilisation
      • Extending the machine: presents a virtual machine that is much easier to use than the actual hardware
  • 4 major subsystems
    • Process Management
    • Memory Management
    • I/O Management
    • File Management
  • most OSs are part software and part hardware
    • for efficiency, some operations are realised by hardware


History of Operating Systems

Originally programs entered by switches

Early advances made:

  • cards/paper tape used instead of switches, read in by a loader program

In 1950s

  • standard subroutines produced and loaded at start-up
  • magnetic tapes, then disks, used for storage
  • assemblers appeared (FORTRAN and AGOL)

In 1960s

  • batch systems appeared
  • Atlas, computer designed at Manchester University, introduced interrupts and virtual memory
  • loader program was elaborated to allow batch processing
  • control cards lead to job control languages

In 1970s

  • multiprogramming emerged
    • CPU could switch between jobs, allowing simultaneous I/O and processing
    • desire to maximise processor use lead to time-sharing
      • allowing multiple users access to one computer, each working with their own programs
      • when one user did not need processor cycles, another user could be using them, thus not wasting processor time


Simple Fetch-Execute Cycle

  • CPU works in a Fetch-Execute cycle
    • fetch an instruction from memory
    • execute instruction
  • if I/O required, CPU will wait for this to complete before continuing


Interrupt System

  • enables CPU to oversee programs and I/O events simultaneously
  • interrupts alert the OS when an event occurs
  • For example
    • a program is run and it requires I/O
    • whilst it waits for input, the program is not using processor time, so the CPU executes another program
    • when it has received input, the program sends an interrupt so the processor knows the program is ready to proceed, and the processor continues execution of the original program

Types of Interrupt

I/O Interrupt
by I/O devices to signal completion or error
Timer Interrupt
by a clock within the CPU; used to alert the OS at pre-set intervals on time critical activities
Hardware Error Interrupt
by hardware faults
Program Interrupt
by error conditions within user programs, e.g. division by zero


Kernel Mode

  • kernel mode prevents users from accessing privileged operations to increase security
    • such as direct memory access or the file system
  • only the OS can perform operations in kernel mode
  • other programs must use the OS interface to request these operations
  • the OS can then decide whether or not to perform the operation
  • normal programs run in user mode