Monday, April 28, 2014

Computer (C 3.1): The functions of operating systems

The functions of operating systems

  • The main aims and features of an operating system are to manage the resources of the computer system:

    • processor management – for multiprogramming, the low-level scheduler must decide which job will get the next use of the processor
    • decide on appropriate scheduling algorithms
    • file management – maintaining a list of files, directories and which file allocation units belong to which files
    • input/output management – control of all input and output devices attached to the computer
    • memory management – using strategies such as segmentation and paging and the high-level scheduler to decide which jobs will be loaded next.

  • Peripherals and processes that want to use the processor send an interrupt:

    • a program interrupt signals an error in a program.
    • an I/O interrupt signals that a data transfer is complete or an error has occurred.
    • a timer interrupt signals that a time-critical activity needs attention.
    • a hardware error signals that some device has failed.

  • After the processor finishes executing an instruction, it checks the priority queue of interrupts.
  • High-priority interrupts are serviced before the processor continues with the next instruction.
  • Every interrupt signal has its own interrupt service routine (ISR) that services the interrupt.
  • The state of registers and memory is stored before an ISR runs in order that the interrupted process can resume from the same point.
  • Scheduling tries to ensure that the processor is working to its full potential:

    • that the processor is not idle, waiting for I/O
    • that I/O-bound processes do not wait for the processor when they only need to use it a little
    • that processor-bound processes do not block other processes.

  • The scheduler has a choice of strategy for deciding which job gets the use of the processor next:

    • shortest job first
    • round robin
    • shortest remaining time.

  • Jobs must be loaded into the computer’s main memory to use the processor.
  • Each job must be protected from the actions of other jobs.
  • Linker and loader software load and keep track of processes and their data.
  • A process and its data can be allocated to fixed-size pages or it can be logically segmented.
  • Virtual memory is a small amount of fast access storage between the disk and the memory.
  • Virtual memory stores code and data relating to the current process that cannot be stored in main memory.
  • Spooling is a way to ensure that the input and output for different jobs do not become mixed up, and allows several uses (say on a network) to produce output/printout at the same time.
  • When a file is sent to a busy printer, a reference to the file is added to the printer’s spool queue and it is processed when it reaches the top of the queue.
  • A typical desktop PC operating system includes:

    • file management to allow users to create a hierarchical structure for storing files and to copy, delete and move files
    • multi-tasking to allow the user to run several programs
    • a boot process to check the computer every time it is switched on and load the OS
    • a file allocation table (FAT) to point to the blocks on disk that are used by files.

No comments:

Post a Comment

Preeti to Unicode Converter