0% found this document useful (0 votes)
14 views

Operating System MODULE 1

The document provides an extensive overview of operating systems, covering their functions, architectures, types, and components. It explains the roles of hardware, memory management, process management, and user interfaces, as well as the importance of security and resource management. Additionally, it discusses virtualization and the characteristics of free and open-source operating systems.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Operating System MODULE 1

The document provides an extensive overview of operating systems, covering their functions, architectures, types, and components. It explains the roles of hardware, memory management, process management, and user interfaces, as well as the importance of security and resource management. Additionally, it discusses virtualization and the characteristics of free and open-source operating systems.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Operating System

Module 1 Notes
Operating Systems – Module 1: Introduction to Operating Systems

(Based on Operating System Concepts by Silberschatz, Galvin, and Gagne)

1. Computer Hardware Review

A computer system consists of various hardware components that work together to perform
computations. The Operating System (OS) acts as an interface between the hardware and
software applications.

1.1 Processors (CPU – Central Processing Unit)

The Processor (CPU) is the "brain" of the computer, responsible for executing instructions.

1.1.1 CPU Components

1. Arithmetic Logic Unit (ALU) – Performs mathematical and logical operations.

2. Control Unit (CU) – Directs execution of instructions.

3. Registers – Small, fast memory units within the CPU.

4. Cache Memory – Stores frequently used instructions for faster processing.

5. Clock Speed – Determines how many operations the CPU can perform per second
(measured in GHz).

1.1.2 CPU Execution Cycle (Fetch-Decode-Execute Cycle)

1. Fetch – Retrieves instruction from RAM.

2. Decode – Determines what operation needs to be performed.

3. Execute – Performs the required operation.

4. Store – Saves the result to memory.

1.1.3 Types of Processors

Processor Type Description Examples

Can execute only one instruction at a


Single-Core Intel Pentium 4
time.

Contains multiple cores for parallel Intel i9, AMD


Multi-Core
execution. Ryzen

Simulates multiple logical cores in a single


Hyper-Threading Intel Core i7
physical core.
Processor Type Description Examples

RISC (Reduced Instruction Set


Uses simple, high-speed instructions. ARM, MIPS
Computing)

CISC (Complex Instruction Set Uses complex instructions for fewer


Intel x86
Computing) cycles.

1.2 Memory (RAM, ROM, Cache, Virtual Memory)

Memory is used to store and access data.

1.2.1 Types of Memory

Memory Type Description Volatility

RAM (Random Access Memory) Temporary memory for running applications. Volatile

ROM (Read-Only Memory) Permanent firmware storage (BIOS). Non-Volatile

Cache Memory Fast memory near CPU for frequently used data. Volatile

Virtual Memory Uses disk space as extended RAM. Virtualized

Virtual Memory (Paging & Swapping)

• Extends physical memory using secondary storage (HDD/SSD).

• Paging: Memory divided into fixed-sized pages.

• Swapping: Entire processes moved in and out of RAM.

1.3 I/O Devices and Buses

I/O devices allow communication between the computer and the outside world.

1.3.1 Storage Devices

Storage Type Description Examples

Primary Storage Fast, temporary RAM, Cache

Secondary Storage Long-term data storage HDD, SSD

Tertiary Storage Backup and archival Magnetic tapes

1.3.2 Input & Output Devices


Device Type Examples

Input Devices Keyboard, Mouse, Scanner

Output Devices Monitor, Printer, Speaker

1.3.3 Buses (Data Communication Paths)

• Data Bus – Transfers actual data.

• Address Bus – Carries memory addresses.

• Control Bus – Sends control signals.

2. Operating System Basics

An Operating System (OS) is system software that manages hardware resources and provides
services for applications.

2.1 Functions of an OS

1. Process Management – Handles program execution.

2. Memory Management – Allocates memory efficiently.

3. File System Management – Organizes file storage.

4. Device Management – Manages I/O devices.

5. Security & Protection – Provides authentication and encryption.

3. OS Architectures

3.1 Types of OS Architectures

Architecture Description Examples

Monolithic OS Single, large kernel. Linux, Unix

Layered OS Divides OS into layers. Windows NT

Microkernel OS Minimal kernel, with user-space services. macOS, QNX

4. Types of Operating Systems

OS Type Description Examples

Mainframe OS Supports large-scale, multi-user processing. IBM z/OS

Server OS Designed for networked systems. Windows Server, Linux


OS Type Description Examples

Multiprocessor OS Supports multiple CPUs. Unix, Solaris

Embedded OS Used in specialized hardware. VxWorks, FreeRTOS

Real-Time OS (RTOS) Ensures precise execution timing. QNX, RTLinux

Sensor Node OS Used in Wireless Sensor Networks (WSNs). TinyOS, Contiki

Smart Card OS Used in credit/debit cards & ID cards. JavaCard OS, MULTOS

5. Virtualization

5.1 What is Virtualization?

• Running multiple OS instances on a single machine.

• Uses Hypervisors like VMware, VirtualBox.

5.2 Types of Virtualization

1. Hardware Virtualization: Full OS virtualization using VMs.

2. OS Virtualization: Containers (Docker).

6. Free and Open-Source Operating Systems

6.1 What is an Open-Source OS?

• A Free and Open Source OS is a system where the source code is freely available for
modification and distribution.

6.2 Examples of Open-Source OS

OS Description

Linux Most popular open-source OS. Various distributions like Ubuntu, Fedora.

FreeBSD Unix-like, high-performance OS.

ReactOS Windows-compatible open-source OS.

Android (AOSP) Open-source mobile OS based on Linux.

Functionalities of Operating System

• Resource Management: When parallel accessing happens in the OS means when


multiple users are accessing the system the OS works as Resource Manager, Its
responsibility is to provide hardware to the user. It decreases the load in the system.

• Process Management: It includes various tasks like scheduling and termination of the
process. It is done with the help of CPU Scheduling algorithms .
• Storage Management: The file system mechanism used for the management of the
storage. NIFS , CIFS , CFS , NFS , etc. are some file systems. All the data is stored in
various tracks of Hard disks that are all managed by the storage manager. It
included Hard Disk .

• Memory Management: Refers to the management of primary memory. The operating


system has to keep track of how much memory has been used and by whom. It has to
decide which process needs memory space and how much. OS also has to allocate and
deallocate the memory space.

• Security/Privacy Management: Privacy is also provided by the Operating system using


passwords so that unauthorized applications can’t access programs or data. For
example, Windows uses Kerberos authentication to prevent unauthorized access to
data.

The process operating system as User Interface:

1. User

2. System and application programs

3. Operating system

4. Hardware

Every general-purpose computer consists of hardware, an operating system(s), system


programs, and application programs. The hardware consists of memory, CPU, ALU, I/O devices,
peripheral devices, and storage devices. The system program consists of compilers, loaders,
editors, OS, etc.

Conceptual View of Computer System

Every computer must have an operating system to run other programs. The operating system
coordinates the use of the hardware among the various system programs and application
programs for various users. It simply provides an environment within which other programs can
do useful work.
An OS is a package of some programs that runs on a computer machine, allowing it to perform
efficiently. It manages the simple tasks of recognizing input from the keyboard, managing files
and directories on disk, displaying output on the screen, and controlling peripheral devices.

Purposes and Tasks of Operating Systems

Several tasks are performed by the Operating Systems and it also helps in serving a lot of
purposes which are mentioned below. We will see how Operating System helps us in serving in
a better way with the help of the task performed by it.

Purposes of an Operating System

• It controls the allocation and use of the computing System’s resources among the
various user and tasks.

• It provides an interface between the computer hardware and the programmer that
simplifies and makes it feasible for coding and debugging of application programs.

Tasks of an Operating System

1. Provides the facilities to create and modify programs and data files using an editor.

2. Access to the compiler for translating the user program from high-level language to
machine language.

3. Provide a loader program to move the compiled program code to the computer’s
memory for execution.

4. Provide routines that handle the details of I/O programming.

I/O System Management

The module that keeps track of the status of devices is called the I/O traffic controller. Each I/O
device has a device handler that resides in a separate process associated with that device.
The I/O subsystem consists of

• A memory Management component that includes buffering caching and spooling.

• A general device driver interface.

Assembler

The input to an assembler is an assembly language program. The output is an object program
plus information that enables the loader to prepare the object program for execution. At one
time, the computer programmer had at his disposal a basic machine that interpreted, through
hardware, certain fundamental instructions. He would program this computer by writing a
series of ones and Zeros (Machine language) and placing them into the memory of the
machine. Examples of assembly languages include

Compiler and Interpreter

The High-level languages – examples are C, C++, Java, Python, etc (around 300+ famous high-
level languages) are processed by compilers and interpreters . A compiler is a program that
accepts a source program in a “high-level language “and produces machine code in one go.
Some of the compiled languages are FORTRAN, COBOL, C, C++, Rust, and Go. An interpreter is
a program that does the same thing but converts high-level code to machine code line-by-line
and not all at once. Examples of interpreted languages are

• Python

• Perl

• Ruby

Loader

A Loader is a routine that loads an object program and prepares it for execution. There are
various loading schemes: absolute, relocating, and direct-linking. In general, the loader must
load, relocate and link the object program. The loader is a program that places programs into
memory and prepares them for execution. In a simple loading scheme, the assembler outputs
the machine language translation of a program on a secondary device and a loader places it in
the core. The loader places into memory the machine language version of the user’s program
and transfers control to it. Since the loader program is much smaller than the assembler, those
make more core available to the user’s program.

Components of an Operating Systems

There are two basic components of an Operating System.

• Shell

• Kernel

Shell

Shell is the outermost layer of the Operating System and it handles the interaction with the user.
The main task of the Shell is the management of interaction between the User and OS. Shell
provides better communication with the user and the Operating System Shell does it by giving
proper input to the user it also interprets input for the OS and handles the output from the OS. It
works as a way of communication between the User and the OS.

Kernel

The kernel is one of the components of the Operating System which works as a core
component. The rest of the components depends on Kernel for the supply of the important
services that are provided by the Operating System. The kernel is the primary interface between
the Operating system and Hardware.

Functions of Kernel

The following functions are to be performed by the Kernel.

• It helps in controlling the System Calls.

• It helps in I/O Management.

• It helps in the management of applications, memory, etc.

Types of Kernel

There are four types of Kernel that are mentioned below.


• Monolithic Kernel

• Microkernel

• Hybrid Kernel

• Exokernel

Advantages of Operating System

• It helps in managing the data present in the device i.e. Memory Management.

• It helps in making the best use of computer hardware.

• It helps in maintaining the security of the device.

• It helps different applications in running them efficiently.

Disadvantages of Operating System

• Operating Systems can be difficult for someone to use.

• Some OS are expensive and they require heavy maintenance.

• Operating Systems can come under threat if used by hackers.

Operating System Services


Program Execution

It is the Operating System that manages how a program is going to be executed. It loads the
program into the memory after which it is executed. The order in which they are executed
depends on the CPU Scheduling Algorithms. A few are FCFS, SJF, etc. When the program is in
execution, the Operating System also handles deadlock i.e. no two processes come for
execution at the same time. The Operating System is responsible for the smooth execution of
both user and system programs. The Operating System utilizes various resources available for
the efficient running of all types of functionalities.

Input Output Operations

Operating System manages the input-output operations and establishes communication


between the user and device drivers. Device drivers are software that is associated with
hardware that is being managed by the OS so that the sync between the devices works properly.
It also provides access to input-output devices to a program when needed.

Communication Between Processes

The Operating system manages the communication between processes. Communication


between processes includes data transfer among them. If the processes are not on the same
computer but connected through a computer network, then also their communication is
managed by the Operating System itself.

File Management

The operating system helps in managing files also. If a program needs access to a file, it is the
operating system that grants access. These permissions include read-only, read-write, etc. It
also provides a platform for the user to create, and delete files. The Operating System is
responsible for making decisions regarding the storage of all types of data or files, i.e, floppy
disk/hard disk/pen drive, etc. The Operating System decides how the data should be
manipulated and stored.

Memory Management

Let’s understand memory management by OS in simple way. Imagine a cricket team with
limited number of player . The team manager (OS) decide whether the upcoming player will be
in playing 11 ,playing 15 or will not be included in team , based on his performance . In the same
way, OS first check whether the upcoming program fulfil all requirement to get memory space or
not ,if all things good, it checks how much memory space will be sufficient for program and then
load the program into memory at certain location. And thus , it prevents program from using
unnecessary memory.

Process Management

Let’s understand the process management in unique way. Imagine, our kitchen stove as the
(CPU) where all cooking(execution) is really happen and chef as the (OS) who uses kitchen-
stove(CPU) to cook different dishes(program). The chef(OS) has to cook different
dishes(programs) so he ensure that any particular dish(program) does not take long
time(unnecessary time) and all dishes(programs) gets a chance to cooked(execution) .The
chef(OS) basically scheduled time for all dishes(programs) to run kitchen(all the system)
smoothly and thus cooked(execute) all the different dishes(programs) efficiently.

Security and Privacy

• Security : OS keep our computer safe from an unauthorized user by adding security
layer to it. Basically, Security is nothing but just a layer of protection which protect
computer from bad guys like viruses and hackers. OS provide us defenses
like firewalls and anti-virus software and ensure good safety of computer and personal
information.

• Privacy : OS give us facility to keep our essential information hidden like having a lock
on our door, where only you can enter and other are not allowed . Basically , it respect
our secrets and provide us facility to keep it safe.

Resource Management

System resources are shared between various processes. It is the Operating system that
manages resource sharing. It also manages the CPU time among processes using CPU
Scheduling Algorithms. It also helps in the memory management of the system. It also controls
input-output devices. The OS also ensures the proper use of all the resources available by
deciding which resource to be used by whom.

User Interface

User interface is essential and all operating systems provide it. Users either interacts with the
operating system through the command-line interface or graphical user interface or GUI. The
command interpreter executes the next user-specified command.

A GUI offers the user a mouse-based window and menu system as an interface.

Networking
This service enables communication between devices on a network, such as connecting to the
internet, sending and receiving data packets, and managing network connections.

Error Handling

The Operating System also handles the error occurring in the CPU, in Input-Output devices, etc.
It also ensures that an error does not occur frequently and fixes the errors. It also prevents the
process from coming to a deadlock. It also looks for any type of error or bugs that can occur
while any task. The well-secured OS sometimes also acts as a countermeasure for preventing
any sort of breach of the Computer System from any external source and probably handling
them.

Time Management

Imagine traffic light as (OS), which indicates all the cars(programs) whether it should be
stop(red)=>(simple queue), start(yellow)=>(ready queue),move(green)=>(under execution) and
this light (control) changes after a certain interval of time at each side of the road(computer
system) so that the cars(program) from all side of road move smoothly without traffic.

Conclusion

In conclusion, operating system services are essential for managing computer resources,
ensuring security and stability, supporting multitasking, providing control over system
operations, enabling input/output operations, and facilitating networking and communication.
These services allow users and applications to interact efficiently with the hardware and
software, making the overall computing experience smooth and effective

You might also like