lOMoARcPSD|55996096
Operating System -Compiled Notes - UNIT 1
operating system (SRM Institute of Science and Technology)
Scan to open on Studocu
Studocu is not sponsored or endorsed by any college or university
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
USA20302J - Operating System
UNIT 1 - Syllabus
Introduction Operating Systems (OS)
Operating System overview
Operating system as a resource manager
Operations, Assembler, Compiler, loader, linker
Evolution of Operating Systems:
Serial processing and batch processing
Batch: Simple, Multiprogramming
Multiprocessor, Time Sharing, parallel systems
Distributed (client-server, peer-to-peer),
Real-Time (hard, soft)
Cluster
Network
Structure of Operating systems: simple, layered, Kernel mode
System Call Types
Operating System services in GNU/Linux OS
Communications Threads: Single thread, Multi-thread
Operating System (OS)-A preview…..
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Operating system (OS) is associated with – input devices, output
devices, network devices, CPU
It is a System software
Manages Hardware, software and common programs
OS is found in computers, super computers, servers, video game
consoles, mobile phones, televisions and much more….
Commonly known OS - Windows, Macintosh, Linux, Unix, Android,
FreeBSD, Drupal, iOS, Windows Mobile, Watch OS, Web OS
Components that form the OS
Process Management
Interrupt Management
Memory Management
File System Management
Device Management
I/O Management
Networking and Security
Introduction
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Definition
An Operating System is a program that controls the execution of application
programs and acts as an interface between applications/users and the
computer hardware.
Objectives
Convenience: An OS makes a computer more convenient to use.
Efficiency: An OS allows the computer system resources to be used in an
efficient manner.
Ability to evolve: An OS should be constructed in such a way as to permit the
effective development, testing, and introduction of new system functions.
System
A computer system is a set of integrated devices that input, output, process,
store and communicate.
The computer system uses the programs (functions) that are defined to
control and access the resources (memory, devices, processor cycles, etc.)
Why a computer needs an operating system?
OS is a very big program, which is an inclusive of lots of programs executed
by the processor.
OS mayrelinquishand regain the control on resources and it depends on the
processor to gain and relinquish control on resources.
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Operating System as a Resource Manager
The operating system acts as a layer of abstraction between the
hardware and the software, allowing programs to run on a wide range
of different hardware configurations without need for specific
customization.
The operating system provides a user interface (commands, Graphical
User Interfaces like buttons, check boxes and so on)
It allowing users to interact with the computer and perform various
tasks.
It provides a set of system calls and libraries that applications can use
to access the underlying hardware
It performs common operations such as reading and writing files,
creating and managing processes, and allocating memory,
It provides services like network connectivity, device connectivity, file
management, security and authorization management, users
management, process management
The operating system effectively manages these resources and
performs the functions like,
Keeps track of the status of each resource.
Decides which job should get the resource and for how much
time.
Allocates the resources to the job decided.
Reclaims the resource after the job uses it for the allocated time.
Processor Management Functions
Keeps track of the processor by recording whether the processor
is busy and if so who is using it.
Decides which job should use the processor and for how much
time.
Allocates processor to the job decided.
Reclaims processor after use for the allotted time.
Memory Management Functions
Keeps track of memory by recording which memory locations are
in use by which program and which memory locations are free.
Decides which job should get memory and for how much time in
case of multi-programming.
Allocates the memory space to the job.
Reclaims memory after use to make it available to other jobs.
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Device Management Functions
Keeps track of input/output devices and channels. That is, which
device is in use and by which job.
Decides which job should use the device, and for how much time.
Allocates the device to the job.
Reclaims device after use.
File Management
Keeps track of files, that is, which files are in use and by which
jobs.
Decides which job should use the files and for what purpose
(read/write/append/execute).
Allocates file for use.
Reclaims file, which means, closes the file.
IO Management
Input/output devices like mouse, keyboards, printers etc., are
external I/O devices and are different in their behavior and
characteristics.
The operating system appropriately manages the input and
output operation of these devices and does CPU device
interconnection and interaction via Peripheral Control Interfaces
Security Management
The reliability of an operating system is determined the better
security it provides.
Operating systems use a firewall for security. A firewall is a
security system that monitors every activity happening in the
computer and blocks that activity in case of any threat.
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Operations, Assembler, Compiler, loader, linker
Operation is an activity to control and coordinate the hardware and
software. The operations of an operating system include process
management, memory management, device management and file
management.
An assembler is a program that converts the assembly language to
machine-level language.
A compiler is a program that converts high-level language to assembly
language.
A loader is a program responsible for loading the programs from
secondary memory to main memory for execution. It loads data,
machine instructions, related programs, libraries and other
dependencies for the execution
A linker is a computer program that takes one or more object
files generated by a compiler and combines them into
one, executable program.
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Evolution of Operating System
Batch Operating System
There is no direct interaction between user and computer.
The user needs to prepare jobs and save offline mode to devices like
punch card or paper tape or magnetic tape and hand over to operators
Jobs are grouped into batches ( similar jobs in one batch )
the computer operator submits batches into the CPU to execute the
jobs one by one. CPUs start executing jobs, and when all jobs are
finished, the computer operator provides the output to the user.
Time-Sharing Operating System
Operating system that allows us to connect many people located at
different locations to share and use a specific system at a single time.
The time-sharing operating system is the logical extension of the
multiprogramming through which users can run multiple tasks
concurrently.
provides each user his terminal for input or output that impacts the
program or processor currently running on the system.
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
It represents the CPU's time is shared between many
users/processesBackward Skip y kip 10s
Embedded Operating System
The Embedded operating system is the specific purpose operating
system
These operating systems are designed to work on dedicated devices
like automated teller machines (ATMs), airplane systems, refrigerators,
cars, air conditions, cameras, gaming consoles, washers, (and forms
the internet of things (IoT) environment)
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Multiprogramming Operating System
Two or more processes or programs are activated simultaneously to execute
the processes one after another by the same computer system.
When a program is in run mode and uses CPU, another program or file uses
I/O resources at the same time or waiting for another system resources to
become available. It improves the use of system resources
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Network Operating System
It operates on a server
And it uses network devices like a switch, router, or firewall to handle
data, applications and other network resources.
It provides connectivity among the autonomous operating system,
called as a network operating system.
Useful to share data, files, hardware devices and printer resources
among multiple computers to communicate with each other.
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Types of network operating system
Peer-to-peer network operating system
It allows the users to share the resources between two or more
computermachines using a LAN.
Client-Server network operating system
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
It allows the users to access resources, functions, and
applications through a common server or center hub of the
resources.
The client workstation can access all resources that exist in the
central hub of the network.
Multiple clients can access and share different types of the
resource over the network from different locations.
Distributed Operating system
A distributed operating system provides an environment in which
multiple independent CPU or processor communicates with each other
through physically separate computational nodes.
Each node contains specific software that communicates with the
global aggregate operating system.
With the ease of a distributed system, the programmer or developer
can easily access any operating system and resource to execute the
computational tasks and achieve a common goal.
It is the extension of a network operating system that facilitates a high
degree of connectivity to communicate with other users over the
network.
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Multiprocessing Operating System
It is the type of operating system that refers to using two or more
central processing units (CPU) in a single computer system.
These multiprocessor systems or parallel operating systems are used
to increase the computer system's efficiency.
These operating system shares computer bus, clock, memory and
input or output device for concurrent execution of process or program
and resource management in the CPU.
Real-Time Operating System
To provide services and data processing resources for applications in
which the time interval required to process & respond to input/output
should be so small without any delay real-time system.
It requires an immediate response to complete tasks within a specified
time delay. Hence, a real-time operating system must be fast and
responsive for an embedded system, weapon system, robots, scientific
research & experiments and various real-time objects.
Types of the real-time operating system:
Hard Real-Time System
These types of OS are used with those required to complete critical
tasks within the defined time limit.
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
If the response time is high, it is not accepted by the system or may
face serious issues like a system failure.
In a hard real-time system, the secondary storage is either limited or
missing, so these system stored data in the ROM.
Soft Real-Time System
A soft real-time system is a less restrictive system that can accept
software and hardware resources delays
a critical task prioritizes less important tasks, and that priority retains
active until completion of the task.
Also, a time limit is set for a specific job, which enables short time
delays for further tasks that are acceptable.
Multi Core Systems
Multiprocessor systems are termed multi core that has CPU design to include
multiple computing cores on a single chip
Clustered Systems
These kinds of systems gather multiple CPUs together. Clustered systems
differ from the multiprocessor systems, where the clusters are composed of
two or more individual systems/nodes that are connected to form an
environment.
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Structures of the Operating System
Arranging the modules required by the various management services
through partitioning/layering
Structuring Improves performance
The procedure of structuring clear boundary limits and hence other
modules are not disturbed
1. Simple Structure
No Partitions/Subsystems
Has No Distinction between User and Kernel Modes
Allowing all programs to directly access the hardware
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
MS-DOS layer structure
Simple layers (BUT NOT achieved what was expected) in Traditional
UNIX system structure
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
2. Layered Approach
Small layers of modules, where the big layer will be depending
on the small inner layers
Layers: developed and debugged independently
Order of layers confusion
No low level layer can call the upper layer service
The run through of service request from higher/upper layer to
the lower most layer is making it less efficient – simple
processing has to be done at each layer
Layered Approach
3. Micro kernels
Idea: to remove all non-essential services from the kernel, and
implement them as system applications instead, thereby making
the kernel as small and efficient as possible.
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Most microkernels provide basic process and memory
management, and message passing between other services,and
not much more.
Security and protection can be enhanced, as most services are
performed in user mode, not kernel mode.
System expansion can also be easier, because it only involves
adding more system applications, not rebuilding a new kernel.
Mach was the first and most widely known microkernel, and now
forms a major component of Mac OSX.
Windows NT was originally microkernel, but suffered from
performance problems relative to Windows 95. NT 4.0 improved
performance by moving more services into the kernel, and now
XP is back to being more monolithic.
Another microkernel example is QNX, a real-time OS for
embedded systems.
Architecture of a typical microkernel
4. Modules
Modern OS development, object-oriented, small core kernel and
a set of modules, dynamic linking.
Modules: Well defined tasks and interfaces, any module is
communicate to any other module, eliminating the problems of
going through multiple intermediary layers
The kernel is relatively small in this architecture, similar to
microkernel.
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Solaris loadable modules
5. Hybrid
NOT ONE but hybrids of several architectures
5.1 Mac OS X
The MaC OSX architecture relies on the Mach microkernel
for basic system management services, and the BSD kernel
for additional services. Application services and
dynamically loadable modules ( kernel extensions ) provide
the rest of the OS functionality
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
The Mac OS X structure
5.2 iOS
The iOS operating system was developed by Apple for
iPhones and iPads.
It runs with less memory
Runs with great computing power
Supports touch screen interface
Graphics support for small screens
Architecture of Apple's iOS.
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
5.3 Android
The Android OS was developed for Android smartphones
and tablets.
Android includes versions of Linux and a Java virtual
machine
optimized for small platforms.
Android apps are developed using a special Java-for-
Android development environment.
Architecture of Google's Android
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
OS services
The OS controls the system resources and regulates access
Authentication features
Access attempts
Program execution
Handling user programs (bringing the programs to memory for
execution and sending back)
Associating the user programs and system programs
Handling routines to be linked during runtime
Synchronous
Communication
Deadlock handling
I/O operations
Granting access for the devices (device, drivers (S/w))
Read / write
File System manipulation
File creation, updation, deletion, backups
Merging, appending, storage location, media, synchronization
Properties of those media devices: data transfer rate, capacity, data
access methods
Communication
Data bus (clock), internet (message passing:Synchronization
algorithms)
Error Detection
Failure modules, versioning control issues
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Resource Allocation
CPU utilization
schedulers
Protection
Password, passcode, OTP
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
System calls
The way to talk to system programs
A request for a service- to get hardware accessibility
Acts as an interface between the users programs/processes and
operating system
API/library->Increases system portability
Open, read, close, kill, wait, stop, execute
Categories of system calls
Process control
create process terminate process
load, execute
get/set process attributes (Data sharing across application.
Across different machines)
wait for time, wait event, signal event
allocate and free memory
File management
create file, delete file
open, close
read, write, reposition
get/set file attributes
Device management
request device, release device
read, write, reposition
get/set device attributes
logically attach or detach devices
Information maintenance
get/set total system information -> time, date, computer name
and the organization to which it belongs
get/set process, file, or device metadata ->author, creation time
and date, who edits it
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Communication
create, delete communication connection
send, receive messages
transfer status information
attach or detach remote devices
Protection
get/set file permissions
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Virtualization and Virtual Machines
Virtualization is a process that allows a computer to share its hardware
resources with multiple digitally separated environments.
Each virtualized environment runs within its allocated resources, such as
memory, processing power, and storage.
Provides an illusion of multiple execution environments/OS
Process is executing on different environments with their own memory
managed by virtual memory techniques and CPU scheduling
Ability to share hardware
Only disk systems ->disadvantages
Multi user interactive system
Multiple virtual machines in one physical machine
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Threads and Multithreading
A thread is a single sequential flow of execution of tasks of a process so it is
also known as thread of execution or thread of control.
It takes far less time to create a new thread in an existing process
than to create a new process.
Threads can share the common data; they do not need to use Inter-
Process communication.
Context switching is faster when working with threads.
It takes less time to terminate a thread than a process.
Multithreading is the ability of a program or an operating system to enable
more than one user at a time without requiring multiple copies of the
program running on the computer. Multithreading can also handle multiple
requests from the same user.
Each user request for a program or system service is tracked as a
thread with a separate identity.
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
OS System Design and Implementation
OS provides an atmosphere in which different applications and
programs can do useful work.
There are many problems that can occur while designing and
implementing an operating system.
Operating System Design Goals
It is quite complicated to define all the goals and specifications of the
operating system while designing [Link] design changes depending on
the type of the operating system i.e if it is batch system, time shared
system, single user system, multi user system, distributed system etc.
Two Categories of Design goals
User Goals
The operating system should be convenient, easy to use, reliable, safe
and fast according to the users. However, these specifications are not
very useful as there is no set method to achieve these goals.
System Goals
The operating system should be easy to design, implement and
maintain. These are specifications required by those who create,
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
maintain and operate the operating system. But there is not specific
method to achieve these goals as well.
Operating System Mechanisms and Policies
There is no specific way to design an operating system as it is a highly
creative task. However, there are general software principles that are
applicable to all operating systems.
A subtle difference between mechanism and policy is that mechanism
shows how to do something and policy shows what to do. Policies may
change over time and this would lead to changes in mechanism. So, it
is better to have a general mechanism that would require few changes
even when a policy change occurs.
For example - If the mechanism and policy are independent, then few
changes are required in mechanism if policy changes. If a policy
favours I/O intensive processes over CPU intensive processes, then a
policy change to preference of CPU intensive processes will not change
the mechanism.
Operating System Implementation
The operating system needs to be implemented after it is designed.
Earlier they were written in assembly language but now higher level
languages are used.
Advantages of Higher Level Language
There are multiple advantages to implementing an operating system
using a higher level language such as: the code is written more fast, it
is compact and also easier to debug and understand. Also, the
operating system can be easily moved from one hardware to another if
it is written in a high level language.
Disadvantages of Higher Level Language
Using high level language for implementing an operating system leads
to a loss in speed and increase in storage requirements. However in
modern systems only a small amount of code is needed for high
performance, such as the CPU scheduler and memory manager. Also,
the bottleneck routines in the system can be replaced by assembly
language equivalents if required.
Design Issues
Transparency
Flexibility
Reliability
Performance
Scaling
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
Naming
Replication
Synchronization
Security
Authentication
Authorization
Operating System services in GNU/Linux OS
Downloaded by no comments (susavanthika@[Link])
lOMoARcPSD|55996096
GNU ( pronounced “gnu” ) is a free operating system consisting
of a kernel, libraries, system utilities, compilers, and end-
user applications.
The acronym expands ->GNU's Not Unix"
GNU has a Unix-like design, but it is available as free software
and does not contain any Unix code.
GNU is comprised of a collection of software applications,
libraries and developer tools, along with a program to allocate
resources and communicate with the hardware, or kernel.
GNU can be used with other kernels and is often used with a
Linux kernel.
A GNU/Linux combination is the GNU/Linux operating system.
The components of a GNU system,
GNU compiler collection
GNU C library
GNU Emacs text editor
GNOME desktop environment
GNU programs can be ported to a multitude of other operating
systems, including different platforms such as Mac OS X and
Microsoft Windows.
GNU is sometimes installed on Unix systems as a replacement
for proprietary utilities.
Downloaded by no comments (susavanthika@[Link])