Components of an Operating System:

An operating system is a program that acts as an intermediary between a user of a computer and the computer hardware. It provides an environment in which a user can execute programs. It also manages all the programs. In the rest of the article, we are going to present the basic concept of an operating system & components of an operating system.

Operating system definition:

  • OS is a resource allocator – manages all resources.
  • OS is a control program – Controls the execution of programs to prevent errors and improper use of the computer.
  • “The one program running at all times on the computer” is the
  • Everything else is easier – A system program or an application program.

Operating system goals:

  • Execute user programs and make solving user problems easier.
  • Make the computer system convenient to use.
  • Use computer hardware in an efficient manner.

Components of Computer System:

The computer system can be divided into four components:

  • Hardware- Provides basic computing resources. Ex- CPU, memory, I/O devices.
  • Operating system- controls and coordinates the use of the hardware among various applications and users.
  • Application Programs- define the ways in which the system resources are used to solve the computing problems of the users. Ex- Word processors, web browsers, database systems, video games.
  • User- Ex- People, machines, other computers.

Computer Startup:

  • Bootstrap program is loaded at power-up or reboot.
  • Typically stored in ROM or EPROM.
  • Initializes all aspects of the system.
  • Loads operating System kernel and starts execution.

Computer System Organization:

  • One or more CPUs, device controllers connect through a common bus providing access to shared memory.
  • Concurrent execution of CPUs and Devices competing for more cycles.

Computer-System Operation:

  • I/O devices and the CPU can execute concurrently.
  • Each device controller is in charge of a particular device type.
  • Each device controller has a local buffer.
  • CPU moves data from/to main memory to/from local buffers.
  • I/O is from the device to the local buffer of the controller.
  • The device controller informs the CPU that it has finished its operation by causing an interrupt.

Storage structure:

The CPU can load instructions only from memory, so any programs to run must be stored there. General-purpose computers run most of their programs rewriteable memory.

  • Main Memory – Only large storage media that the CPU can access directly.
    • Random Access
    • Typically volatile
    • Secondary storage – execution of main memory that provides large nonvolatile storage capacity.
  • Hard disks – rigid metal or glass platters covered with magnetic recording material.
  • Solid-state disks – faster than hard disks, nonvolatile.

Storage Hierarchy:

The wide variety of storage systems can be organized in a hierarchy (Figure: Storage-device hierarchy) according to speed and cost. The higher levels are expensive, but they are fast. As we move down the hierarchy, the cost per bit generally decreases, whereas the access time generally increases. In addition to differing in speed and cost, the various storage systems as easier volatile and nonvolatile.

Storage systems organized in the hierarchy –

  • Speed
  • Cost
  • Volatility

Caching – copying information into a faster storage system. ex- main memory can be viewed as a cache for secondary storage.

Migration of data A from Disk to Register:

  • Multitasking environments must be careful to use the most recent value, no matter it is stored in the storage hierarchy.
  • Multiprocessor environment must provide cache coherency in hardware such that all CPUs have the most recent value in their cache.
  • Distributed environment situation even more complex;
    • Several copies of a datum can exist.

Device Driver – for each driver controller to manage I/O – Provides the uniform interface between controller and kernel.

Dual-Core Design:

  • Multi-chip and multicore.
  • The system containing all chips.
  • Chassis containing multiple separate systems.

Operating System Structure:

a. Multiprogramming (Batch System):

  • A single user cannot keep CPU and I/O devices busy at all times.
  • Multiprogramming organizes jobs so CPU always has one job to execute.
  • A subset of total jobs in the system is kept in memory.
  • One job selected and run via job scheduling.
  • When it has to wait for I/O, OS switches to another job.

b. Time-sharing (Multitasking):

  • Response time should be < 1 second.
  • Each user has at least one program executing in memory.
  • If the processor don’t fit in memory, swapping moves them in and out to run.
  • Virtual memory allows the execution of processes not completely in memory.

History of Operating System:

i. The 1940’s – First Generations:

  • The earlier electronic digital computers had no operating systems.
  • Programs were often entered one bit at a time on rows of mechanical switches (plugboards).
  • Programming languages were unknown (not even assembly languages).
  • Operating systems were unheard of.

ii. The 1950’s – Second Generation:

  • By the earlier 1950s, the routine had improved with the introduction of punch cards.
  • The general motors research laboratories implemented the first operating systems in the early 1950s for their IBM 701.
  • The system generally ran one job at a time.
  • These were called single-stream batch processing systems because programs and data were submitted in groups or batches.

iii. The 1960’s Third Generation:

  • Running several jobs at a time.
  • Developed the concept of multiprogramming.
  • Another major feature is spooling.
  • In spooling, a high-speed device like a disk introduces between a running program and a low-speed device involved with the program in I/O.
  • Introduce a time-sharing technique, a variant of multiprogramming.

iv. Fourth Generation:

  • With the development of LSI (Large Scale Integration) circuits, chips, the operating system entered in the personal computer and the work-station age.
  • Microprocessor technology evolved to the point that it becomes possible to build desktop computers as powerful as the mainframes of the 1970s.
  • Two OSs have dominated the personal computer scene.
    • MS-DOS for Intel 8088 CPU.
    • UNIX for Motorola 6899 CPU family.

Classification of OS:

A. Simple Batch System OS:

  • To speedup, similar needs were grouped together.
  • Run together.
  • Reads jobs from card readers.
  • Lack of interaction between the user and the job while executing.
  • Problems: CPU often idle for I/O device.

B. Multiprogramming OS:

  • Multiple programs run to utilize the CPU.
  • When a program does I/O another program run under CPU.
  • Increase CPU utilization.

C. Time-Sharing OS:

  • Process share a time slot of CPU.
  • Each process gets the equal time of the processor.

D. Multiprocessing OS:

  • To increase computing power, connect multiple CPUs into a single system.
  • Depending on precisely how they are connected and what is shared, these systems are called parallel computers, multi-computers, or multiprocessors.
  • They need a special operating system.

E. Real-Time OS:

  • When rigid time requirements on the operation.
  • Example – industrial control.
  • Two types: i. Hard Real – operation bounded within time. ii. Soft Real – a task gets priority over others.

F. Distributed OS:

  • When very large personal computers, workstations, or even mainframes, the users to share hardware and software resources.
  • Servers can provide print service, file service, or web service.
  • Internet providers run many server machines to support their customers and websites use servers to store the web pages and handle the incoming requests.
  • Typically server operating systems are UNIX and Windows 2000. Linux is also gaining ground for servers.

G. PC (Personal Computer) OS:

  • Hardware cost decreases computer systems dedicated to one user.
  • Introduces a new operating system name as PC.
  • Their job is to provide a good interface to a single user.
  • They are widely used for word processing, spreadsheets, and internet access.
  • Common examples are Windows 98, Windows 2000, Macintosh operating system, and Linux.

Operating System Operations:

a. Interrupt Driven (hardware and software)

  • Hardware interrupt by one of the devices.
  • Software interruption (exception or trap)
  • Software error (e.g., division by zero)
  • Request for operating system service.
  • Other process problems include infinite loop, processes modifying each other to the operating system.

b. The dual-mode operation allows OS to protest itself and other system computers.

  • User mode and kernel mode.
  • Mode bit provided by hardware.
  • Provides the ability to distinguish when the system is running user code or kernel code.
  • Some instructions designed as privileged, only executable in kernel mode.
  • System call changes mode t kernel, return from call resets it to the user.

c. Increasingly CPUs support multi-mode operations i.e. virtual machine manager (VMM) mode for guests.

Transition from User to Kernel Mode:

  1. Timer to prevent infinite loop/process hogging resources.
    • Timer is set to interrupt the computer after some time period.
    • Keep a counter that is decremented by the physical clock.
    • Operating system set the counter (privileged instruction).
    • When counter zero generates an interrupt.
    • Set up before scheduling the process to regain control or terminate a program that exceeds allotted time.

Components of an Operating System:

1. Process Management: A program does nothing unless its instructions are executed by CPU. A program in execution, as mentioned, is a process. A time-shared user program such as a compiler is a process. A word processing program being run by an individual user on a PC is a process. A system task, such as sending output to a printer, can also be a process.

  • Process management is a program in execution. It is a unit of work within the system. The program is a passive entity, process is an active entity.
  • The process needs resources to accomplish its task.
    • CPU, memory, I/O, files.
    • Initialization data.
  • Process termination requires reclaim of any reusable resources.
  • Single-threaded process has one program counter specifying the location of the next instruction to execute.
    • Process executes instructions sequentially, one at a time, until completion.
  • Multi-threaded process has one program counter per thread.
  • Typically system has many processes, some users, and some operating system running concurrently on one or more CPUs.
    • Concurrency by multiplexing the CPUs among the process/threads.

Process Management Activities: The operating system is responsible for the following activities in connection with process management:

  • Scheduling processes and threads on the CPUs.
  • Creating and deleting both user and system processes.
  • Suspending and resuming processes.
  • Providing mechanisms for process synchronization.
  • Providing mechanisms for process communication.
  • Providing mechanisms for deadlock handling

2. File-System Management: File management is one of the most visible components of an operating system. The file usually organized into directories. Computers can store information on several different types of physical media. Magnetic disk, optical disk, and magnetic tape are the most common. Access control on most systems to determine who can access what OS activities include;

  • Creating and deleting files and directories.
  • Primitives to manipulate files and directories.
  • Mapping files onto secondary storage.
  • Backup files onto stable (non-volatile) storage media.

3. I/O system management: One purpose of OS is to hide the peculiarities of hardware devices from the user. Only the device driver knows the peculiarities of the specific device to which it is assigned. I/O subsystem responsible for –

  • Memory management of I/O including buffering (Storing data temporarily while it is being transferred), caching (storing parts of data in faster storage for performance), spooling (the overlapping of the output of one job with the input of other jobs).
  • General device-driver interface.
  • Drivers for specific hardware devices.

4. Main memory management: The main is central to the operation of a modern computer system. Main memory is a large array of bytes, ranging in size from hundreds of thousands to billions. Each byte has its own address main memory is a repository of quickly accessible data shared by the CPU and I/O devices.

  • To execute a program all (or part) of the instructions must be in memory.
  • All (or part) of the data that is needed by the program must be in memory.
  • Memory management determines what is in memory and when optimizing CPU utilization and computer response to users.

Memory Management Activities: The operating system is responsible for the following activities in connection with memory management:

  • Keeping track of which parts of memory are currently being used and by whom deciding processes (or parts thereof) and data to move into and out of memory.
  • Allocating and deal-locating memory space as needed.

5. Mass-storage management: Most of the modern computer systems use disks as the principle on-line storage medium for both programs and data. Most programs – including compilers, assemblers, word-processors, editors, and formatters – are stored on a disk until loaded into memory.

  • Usually, disks used to store data that does not fit in the main memory or data that must be kept for a ‘’long’’ period of time.
  • Proper management is of central importance.
  • Entire speed of computer operation hinges or disk subsystem and its algorithms.
  • OS activities – Free-space management, storage allocation, disk scheduling.
  • Some storage need not be fast –
    • Tertiary storage includes optical storage, magnetic tape.
    • Still must be managed – by OS or applications.
    • Varies between WORM (write-once, read-many-times) and RW (read-write).

6. Networking: A network operating system provides an environment in which users, who are aware of the multiplicity of machines, can access remote resources by either logging into the appropriate remote machine or transferring data from the remote machine to their own machines. Currently, all general-purpose operating system, and even embedded operating systems such as Android and iOS, are network operating systems.

7. Protection and Security System:

  • Protection – any mechanism for controlling access of processes or users to resources defined by the OS.
  • Security – defines the system against internal and external attacks.
    • Huge range, including denial-o-service, worms, viruses, identify theft, theft of service.
  • The system generally first distinguish among users, to determine who can do what –
    • User Identities (user IDs, security IDs) include the name and associated number, one per user.
    • User ID then associated with all files, processes of that user to determine access control.
    • Group identifier (group ID) allows a set of users to be defined and controls managed, then also associated with each process, file.
    • Privilege escalation allows users to change to an effective ID with more rights.

8. Command interpreter system: A command interpreter is a system of software that recognizes and performs commands that are entered interactively by a human or from another program. The command interpreter is a significant part of any operating system. It provides an interface between the operator and the computer.

Reference: Operating System Concepts written by Abraham Silberschatz, Peter Baer Galvin, and Greg Gagne.