Comprehensive Notes on Operating Systems and Algorithms

Definition and Core Functions of Operating Systems

  • Operating System (OS) Definition: An Operating System is defined as the software that controls the overall operation of a computer system. It acts as an intermediary between the user and the hardware.

  • Key Functions of an OS:

    • File Management: Provides the necessary mechanisms for users to store, organize, and retrieve files from storage media.
    • Program Execution Interface: Offers an interface that allows users to request and control the execution of various application programs.
    • Execution Environment: Creates and maintains the environment required to execute programs as requested by the user or the system.
  • Examples of Notable Operating Systems:

    • Windows: Developed by Microsoft, it is available in numerous versions and maintains a dominant position in the personal computer (PC) market.
    • UNIX: A well-established choice for larger computer systems and specific PC environments. It serves as the core for other systems, including:
      • Mac OS: Developed by Apple for their Mac machines.
      • Solaris: Developed by Sun Microsystems, which has since been acquired by Oracle.
    • Linux: Originally developed as a non-commercial project by computer enthusiasts, it is now available through various commercial sources, such as IBM. It is versatile enough to be used on both large-scale machines and small devices.

The Evolution and History of Operating Systems

  • Early Computing Environments (1940s and 1950s):

    • Early computers were characterized by being massive in size, inflexible in function, and inefficient in resource use. Modern OS software has evolved significantly from these primitive beginnings.
  • Characteristics of Early Computers:

    • Physical Size: These machines typically occupied entire rooms.
    • Program Execution: Preparing a machine for a single run was an extensive, manual process involving:
      • Mounting magnetic tapes.
      • Loading punched cards into card readers.
      • Manually setting physical switches and hardware configurations.
      • After execution, all materials (tapes, cards) had to be retrieved before the next job setup could begin.
    • User Interaction (Machine Sharing):
      • Users shared machine time using physical sign-up sheets to reserve specific blocks of time.
      • During their allocated Father-Time, a user held complete and exclusive control over the machine.
      • Sessions often consisted of long setup periods followed by short, rushed execution periods to accommodate the next user on the list.
  • The Development of Modern OS Features:

    • Initial Purpose: The first operating systems were designed to simplify setup procedures and streamline the transitions between different jobs.
    • Separation of Users and Equipment: To improve efficiency, a "Computer Operator" was hired to run the machine, removing users from the computer room. Users submitted programs, data, and specialized instructions (regarding hardware requirements) to the operator and returned later for results.
    • The Advent of Batch Processing: This began when operators loaded submitted materials into mass storage, where a resident program (the OS) could read and execute them sequentially without further human intervention.

Processing Models: Batch vs. Interactive

  • Batch Processing:

    • Definition: The execution of a collection of jobs in a single batch without ongoing user interaction.
    • Job Queue: Jobs are held in mass storage in a "queue." While theoretically operating on a first-in, first-out (FIFO) basis, most systems allow higher-priority jobs to preempt others in the queue.
    • Job Control Language (JCL): A set of encoded instructions stored with the job that details specific machine preparation steps. The OS prints these for the operator or handles them internally.
    • Advantages: Highly suitable for predetermined data processing, such as payroll.
    • Drawbacks: Completely lacks real-time user interaction. It is unsuitable for:
      • Reservation Systems: Which require immediate updates for cancellations or bookings.
      • Word Processing: Which requires dynamic editing.
      • Computer Games: Which require continuous, fast interaction.
  • Interactive Processing:

    • Developed to allow