Operating Systems: Elements, Structure, and Functions

Unit 2: Operating System Elements and Structure

2.1 Introduction to the OS

OS Definition: A set of programs, services, and functions that manage and coordinate the operation of hardware and software.

User Interaction: Through an Interface

  • Interface Types:
    • Text mode (Prompt)
    • Graphic Mode (Mouse, Touchscreen, Voice)

Types of OS (Based on Hardware and Software Management):

  • Single-User OS: Only one simultaneous user (e.g., XP, Vista, MS-DOS).
  • Multi-User OS: Multiple users can use software and hardware resources of one computer.

Data Server vs. Application Server:

  • Data Server: Applications run on the client PC; data is saved on the server. Examples: DBMS (Oracle, SQL Server, Access, MySQL), Accutype.
  • Application Server: The application runs on the server; the client accesses it through a small program (browser). Examples: Web applications (PHP, ASP, ASPX), eBay, Amazon, Google.

2.2 Resource Functions of an OS

  • Coordinate basic OS hardware use by applications (the OS itself or the user).
  • Layered structure of hardware, software, and users.
  • Interface: A set of programs that run on your computer and relate levels so the end-user can access the hardware and implement its programs.
  • Service: A background application that allows:
    1. Managing access to peripherals.
    2. Managing access to files.
    3. Monitoring hardware and software errors.
    4. Storing information about events.
  • Services can be installed. Examples:
    1. Web listening services (Apache server).
    2. Provision of access to databases (Oracle).
    3. Virus Verification Service (AVG Free).

2.3 Management of Resources in an OS

2.3.1 Memory

  • Memory Manager Functions:
    1. Keep track of free and occupied memory areas.
    2. Manage the swap disk.
  • Memory Allocation Methods:
    • Fixed Partitions: Easy management but can lead to wasted space.
    • Variable Partitions: More complex management but less wasted space.

2.3.2 Process and Processor

  • Process Definition: A running program (task).
  • Features:
    1. To be executed, it must reside in memory and be adequately funded.
    2. Each process is protected from other processes.
    3. There are user processes (UP) and system processes (SP):
      • UP: Restricted Mode
      • SP: Privileged Mode (Kernel Mode)
    4. Each process has its Process Control Block (PCB).
    5. Processes can compete or collaborate.

2.4 Architecture and Components

  • OS Architecture: Layers (4+1) (Refer to 2.1, p. 46).
  • VMware virtual machines 6.X, VirtualBox.

2.5 Operating Modes of OS

  • Definition: The way in which the user utilizes the resources that make up the hardware, software, and information system.
  • Two Main Forms:
    1. Batch: Processes (P1, P2, etc.) are executed sequentially, with logs generated. Uses .bat files.
    2. Real-Time: Processes (P1, P2, P3, etc.) interact with the processor and generate results.

Classification of Real-Time Systems:

  1. By Number of Users:
    • Single-User (simultaneous) on one computer (e.g., MS-DOS, XP).
    • Multiuser (e.g., Windows 2003 Server).
  2. By Number of Processes (Simultaneous):
    • Monoprogramming (single-tasking, e.g., MS-DOS).
    • Multiprogramming (multitasking, e.g., WinXP).
  3. By Number of Processors:
    • Uniprocessor (1 single processor).
    • Multiprocessor (2 or more processors):
      • SMP (Symmetric Multiprocessing): Balances the load between processors.
      • AMP (Asymmetric Multiprocessing): Demands more processors only if necessary.
  4. By Response Time:
    • Real-Time (immediate): 1 process, 1 process/processor, priority-based.
    • Time-Sharing: Each process uses a few CPU cycles to complete.