Operating System MODULE 1
Operating System MODULE 1
Module 1 Notes
Operating Systems – Module 1: Introduction to Operating Systems
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.
The Processor (CPU) is the "brain" of the computer, responsible for executing instructions.
5. Clock Speed – Determines how many operations the CPU can perform per second
(measured in GHz).
RAM (Random Access Memory) Temporary memory for running applications. Volatile
Cache Memory Fast memory near CPU for frequently used data. Volatile
I/O devices allow communication between the computer and the outside world.
An Operating System (OS) is system software that manages hardware resources and provides
services for applications.
2.1 Functions of an OS
3. OS Architectures
Smart Card OS Used in credit/debit cards & ID cards. JavaCard OS, MULTOS
5. Virtualization
• A Free and Open Source OS is a system where the source code is freely available for
modification and distribution.
OS Description
Linux Most popular open-source OS. Various distributions like Ubuntu, Fedora.
• 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 .
1. User
3. Operating system
4. Hardware
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.
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.
• 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.
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.
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
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
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.
• 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
Types of Kernel
• Microkernel
• Hybrid Kernel
• Exokernel
• It helps in managing the data present in the device i.e. Memory Management.
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.
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 : 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