1.9 Introduction to Operating Systems

                                 

     Programming in C    



Introduction to Operating Systems

A computer system consists of several resources such as the processor (CPU), main memory, input/output devices, and files. The operating system (OS) acts as the manager of these resources and allocates them to different programs as required.

An operating system may be defined as system software that acts as an intermediary between the user and the computer hardware. It provides an interface that isolates the user from the internal details of hardware implementation. The operating system consists of a set of specialized software modules that make hardware and software resources available to users. With an operating system in place, the computer system becomes easier to use and more efficient.

Examples of commonly used operating systems include MS Windows, Linux, Mac OS, Solaris, etc.


Functions of an Operating System

1. Process Management

A process is a program in execution. The operating system manages processes by deciding:

  • Which process gets to run

  • For how long it should run

  • The priority level of each process

This abstraction allows multiple programs to execute efficiently on a single processor.


2. Memory Management

The operating system is responsible for:

  • Keeping track of memory usage

  • Allocating memory to processes

  • Freeing memory when it is no longer required

  • Rearranging memory to maximize utilization

Several programs may reside in memory at the same time, and the OS decides which processes are placed in memory, where they are placed, and how much memory each receives.


3. Device Management

The operating system controls and coordinates the use of input/output devices. It:

  • Allocates devices to processes

  • Initiates I/O operations

  • Schedules access to I/O devices among multiple processes


4. File Management

A file is a sequence of bytes used to store programs, data, and documents. The operating system:

  • Keeps track of all files in the system

  • Allows creation, deletion, modification, opening, and closing of files

  • Organizes files into directories

  • Protects files and controls access


Kernel

The kernel is the core part of the operating system that interacts directly with the hardware. It occupies a small portion of the OS code but is heavily used and hence remains in primary memory. When a computer boots, the kernel is loaded into memory and gains control of the system. It starts all essential processes required for user interaction and system operation.


User Interface

The user interface is the part of the operating system that allows users to interact with the system. Early systems used text-based interfaces, while modern operating systems provide Graphical User Interfaces (GUI) using icons, menus, keyboard, and mouse. The user interface varies from one operating system to another.


Operational Overview of a CPU





The execution of a program by the CPU is controlled by machine-level instructions. The processing of a single instruction is known as an instruction cycle. The instruction cycle consists of four steps:

1. Fetch

The instruction is fetched from main memory and loaded into the Instruction Register (IR). The address of the instruction is obtained from the Program Counter (PC).

2. Decode

The instruction is decoded by the Control Unit (CU) to determine the operation to be performed.

3. Execute

The decoded instruction is executed using the Arithmetic Logic Unit (ALU). Required data may be fetched from registers or memory.

4. Store

The result of the execution is stored in a register or memory location.

After storing, the Program Counter is updated to point to the next instruction. This cycle continues until all instructions are executed or the system is stopped.







Reference 📖

The content for this subject is prepared by referring to the standard textbook
“Computer Fundamentals and Programming in C” by Pradip Dey and Manas Ghosh,
Second Edition, Oxford University Press (2018).
The explanations are simplified and exam-focused while strictly aligning with the syllabus and concepts presented in the reference book.





Aivette-coi is created with the intention of helping college students learn smartly, revise quickly, and approach exams with confidence.

With love and care,
by Aivette 💙

Comments

Popular posts from this blog

22IMC7Z2 - CONSTITUTION OF INDIA

1.1 Historical Background of the Indian Constitution: The Company Rule & The Crown Rule

1.3 Preamble and Salient Features of the Indian Constitution