SlideShare a Scribd company logo
1 of 39
CS403PC
Operating System
B.TECH II YEAR – II SEM
(R18) (2022-2023)
Prepared
By
Asst.Prof.M.Gokilavani
Department of Computer Science and Engineering (AI & ML)
R18 B.Tech. CSE (AI & ML) Syllabus JNTU HYDERABAD
22
CS403PC: OPERATING SYSTEMS
B.Tech. II Year II Sem. L T P C
3 0 0 3
Prerequisites:
 A course on “Computer Programming and Data Structures”.
 A course on “Computer Organization and Architecture”.
Course Objectives:
 Introduce operating system concepts (i.e., processes, threads, scheduling, synchronization,
deadlocks, memory management, file and I/O subsystems and protection)
 Introduce the issues to be considered in the design and development of operating system
 Introduce basic Unix commands, system call interface for process management, interprocess
communication and I/O in Unix
Course Outcomes:
 Will be able to control access to a computer and the files that may be shared
 Demonstrate the knowledge of the components of computer and their respective roles in
computing.
 Ability to recognize and resolve user problems with standard operating environments.
 Gain practical knowledge of how programming languages, operating systems, and
architectures interact and how to use each effectively.
UNIT - I
Operating System - Introduction, Structures - Simple Batch, Multiprogrammed, Time-shared,
Personal Computer, Parallel, Distributed Systems, Real-Time Systems, System components,
Operating System services, System Calls
UNIT - II
Process and CPU Scheduling - Process concepts and scheduling, Operations on processes,
Cooperating Processes, Threads, and Interposes Communication, Scheduling Criteria, Scheduling
Algorithms, Multiple -Processor Scheduling.
System call interface for process management-fork, exit, wait, waitpid, exec
UNIT - III
Deadlocks - System Model, Deadlocks Characterization, Methods for Handling Deadlocks, Deadlock
Prevention, Deadlock Avoidance, Deadlock Detection, and Recovery from Deadlock
Process Management and Synchronization - The Critical Section Problem, Synchronization
Hardware, Semaphores, and Classical Problems of Synchronization, Critical Regions, Monitors
Interprocess Communication Mechanisms: IPC between processes on a single computer system,
IPC between processes on different systems, using pipes, FIFOs, message queues, shared memory.
UNIT - IV
Memory Management and Virtual Memory - Logical versus Physical Address Space, Swapping,
Contiguous Allocation, Paging, Segmentation, Segmentation with Paging, Demand Paging, Page
Replacement, Page Replacement Algorithms.
UNIT - V
File System Interface and Operations -Access methods, Directory Structure, Protection, File
System Structure, Allocation methods, Free-space Management. Usage of open, create, read, write,
close, lseek, stat, ioctl system calls.
R18 B.Tech. CSE (AI & ML) Syllabus JNTU HYDERABAD
23
TEXT BOOKS:
1. Operating System Principles- Abraham Silberchatz, Peter B. Galvin, Greg Gagne 7th
Edition,
John Wiley
2. Advanced programming in the UNIX environment, W.R. Stevens, Pearson education.
REFERENCE BOOKS:
1. Operating Systems – Internals and Design Principles Stallings, Fifth Edition–2005, Pearson
Education/PHI
2. Operating System A Design Approach- Crowley, TMH.
3. Modern Operating Systems, Andrew S. Tanenbaum 2nd
edition, Pearson/PHI
4. UNIX programming environment, Kernighan and Pike, PHI/ Pearson Education
5. UNIX Internals -The New Frontiers, U. Vahalia, Pearson Education.
UNIT – I: Operating System - Introduction, Structures - Simple Batch, Multiprogrammed, Time-shared,
Personal Computer, Parallel, Distributed Systems, Real-Time Systems, System components, Operating
System services, System Calls.
1. OPERATING SYSTEM – INTRODUCTION:
What is an operating System?
• Computer System = Hardware + Software
• Software = Application Software + System Software(OS)
 Application Software: Eg: Compilers, Databases, Games, Video player, Browsers, etc.
 System Software: Eg: Shells, Editors, Compilers, etc.
Definition of OS: An Operating System is a system Software that acts as an intermediary/interface between a
user of a computer and the computer hardware.
• Operating system goals:
 Execute user programs and make solving user problems easier
 Make the computer system convenient to use
 Use the computer hardware in an efficient manner
The Structure of Computer Systems:
 Accessing computer resources is divided into layers.
 Each layer is isolated and only interacts directly with the layer below or above it.
 If we install a new hardware device
 No need to change anything about the user/applications.
 However, you do need to make changes to the operating system.
 You need to install the device drivers that the operating system will use to control the new
device.
 If we install a new software application
 No need to make any changes to your hardware.
 But we need to make sure the application is supported by the operating system
 User will need to learn how to use the new application.
 If we change the operating system
 Need to make sure that both applications and hardware will compatible with the new
operating system.
2. COMPUTER ARCHITECTURE:
Special buses
(address, data
and control)
connecting all
input/output
devices to
motherboard.
i. CPU – Central Processing Unit:
 This is the brain of your computer.
 It performs all of the calculations.
 In order to do its job, the CPU needs commands to perform, and data to work with.
 The instructions and data travel to and from the CPU on the system bus.
 The operating system provides rules for how that information gets back and forth, and how it
will be used by the CPU.
ii. RAM – Random Access Memory:
 This is like a desk, or a workspace, where your computer temporarily stores all of the
information (data) and instructions (software or program code) that it is currently using.
 Each RAM chip contains millions of address spaces.
 Each address space is the same size, and has its own unique identifying number (address).
 The operating system provides the rules for using these memory spaces, and controls storage
and retrieval of information from RAM.
 Device drivers for RAM chips are included with the operating system.
iii.Operating System Mode:
 The User Mode is concerned with the actual interface between the user and the system.
 It controls things like running applications and accessing files.
 The Kernel Mode is concerned with everything running in the background.
 It controls things like accessing system resources, controlling hardware functions and
processing program instructions.
 System calls are used to change mode from User to Kernel.
iv. Kernel:
 Kernel is a software code that reside in central core of OS. It has complete control over system.
 When operation system boots, kernel is first part of OS to load in main memory.
 Kernel remains in main memory for entire duration of computer session. The kernel code is
usually loaded in to protected area of memory.
 Kernel performs its task like executing processes and handling interrupts in kernel space.
 User performs its task in user area of memory.
 This memory separation is made in order to prevent user data and kernel data from interfering
with each other.
 Kernel does not interact directly with user, but it interacts using SHELL and other programs
and hardware.
Kernel includes:-
1. Scheduler: It allocates the Kernel’s processing time to various processes.
2. Supervisor: It grants permission to use computer system resources to each process.
3. Interrupt handler: It handles all requests from the various hardware devices which compete
for kernel services.
4. Memory manager: allocates space in memory for all users of kernel service.
• Kernel provides services for process management, file management, I/O management, and
memory management.
• System calls are used to provide these type of services.
v. System Call:
 System call is the programmatic way in which a computer program/user application requests a
service from the kernel of the operating system on which it is executed.
 Application program is just a user-process. Due to security reasons, user applications are not
given access to privileged resources (the ones controlled by OS).
 When they need to do any I/O or have some more memory or spawn a process or wait for
signal/interrupt, it requests operating system to facilitate all these. This request is made through
System Call.
 System calls are also called software-interrupts.
vi. Starting an Operating System(Booting):
 Power on Switch sends electricity to the motherboard on a wire called the Voltage Good line.
 If the power supply is good, then the BIOS (Basic Input/output System) chip takes over.
 In Real Mode, CPU is only capable of using approximately 1 MB of memory built into the
motherboard.
 The BIOS will do a Power-On Self-Test (POST) to make sure that all hardware are working.
vii. BIOS:
 BIOS firmware was stored in a ROM/EPROM (Erasable Programmable Read-Only Memory) chip
known as firmware on the PC motherboard.
 BIOS can be accessed during the initial phases of the boot procedure by pressing del, F2 or F10.
 Finally, the firmware code cycles through all storage devices and looks for a boot-loader. (usually
located in first sector of a disk which is 512 bytes)
 If the boot-loader is found, then the firmware hands over control of the computer to it.
3. FUNCTIONS IN OPERATING SYSTEM:
1. Process Management:
 A process is a program in execution.
 A process needs certain resources, including CPU time, memory, files, and I/O devices to
accomplish its task.
 Simultaneous execution leads to multiple processes. Hence creation, execution and termination
of a process are the most basic functionality of an OS
 If processes are dependent, than they may try to share same resources. Thus task of process
synchronization comes to the picture.
 If processes are independent, than a due care needs to be taken to avoid their overlapping in
memory area.
 Based on priority, it is important to allow more important processes to execute first than others.
2. Memory management:
 Memory is a large array of words or bytes, each with its own address.
 It is a repository of quickly accessible data shared by the CPU and I/O devices.
 Main memory is a volatile storage device. When the computer made turn off everything stored
in RAM will be erased automatically.
 In addition to the physical RAM installed in your computer, most modern operating systems
allow your computer to use a virtual memory system. Virtual memory allows your computer to
use part of a permanent storage device (such as a hard disk) as extra memory.
 The operating system is responsible for the following activities in connections with memory
management:
o Keep track of which parts of memory are currently being used and by whom.
o Decide which processes to load when memory space becomes available.
o Allocate and de-allocate memory space as needed.
3. File management:
 A file is a collection of related information defined by its creator.
 File systems provide the conventions for the encoding, storage and management of data on a
storage device such as a hard disk.
o FAT12 (floppy disks)
o FAT16 (DOS and older versions of Windows)
o FAT32 (older versions of Windows)
o NTFS (newer versions of Windows)
o EXT3 (Unix/Linux)
o HFS+ (Max OS X)
 The operating system is responsible for the following activities in connections with file
management:
o File creation and deletion.
o Directory creation and deletion.
o Support of primitives for manipulating files and directories.
o Mapping files onto secondary storage.
o File backup on stable (nonvolatile) storage media.
4. I/O management:
 Device controllers are components on the motherboard (or on expansion cards) that act as an
interface between the CPU and the actual device.
 Device drivers, which are the operating system software components that interact with the devices
controllers.
 A special device (inside CPU) called the Interrupt Controller handles the task of receiving
interrupt requests and prioritizes them to be forwarded to the processor.
 Deadlocks can occur when two (or more) processes have control of different I/O resources that
are needed by the other processes, and they are unwilling to give up control of the device.
5. Security and protection:
 The operating system uses password protection to protect user data and similar other techniques.
 It also prevents unauthorized access to programs and user data by assigning access right
permission to files and directories.
 The owners of information stored in a multiuser or networked computer system may want to
control use of that information, concurrent processes should not interfere with each other.
6. User Interface:
• A user interface (UI) controls how you enter data and instructions and how information is
displayed on the screen
• There are two types of user interfaces
a. Command Line Interface
b. Graphical user Interface
a. Command-line interface: In a command-line interface, a user types commands represented
by short keywords or abbreviations or presses special keys on the keyboard to enter data and
instructions.
b. Graphical user Interface: With a graphical user interface (GUI), you interact with menus
and visual images.
4. OPERATING SYSTEM STRUCTURES:
 An operating system is a design that enables user application programs to communicate with the
hardware of the machine.
 The operating system should be built with the utmost care because it is such a complicated structure
and should be simple to use and modify.
 Partially developing the operating system is a simple approach to accomplish this.
 Each of these components needs to have distinct inputs, outputs, and functionalities.
It also defines the operating system structure.
o Simple Structure
o Monolithic Structure
o Layered Approach Structure
o Micro-Kernel Structure
o Exo-Kernel Structure
o Virtual Machines
1. Simple structure:
It is the most straightforward operating system structure, but it lacks definition and is only appropriate for
usage with tiny and restricted systems. Since the interfaces and degrees of functionality in this structure
are clearly defined, programs are able to access I/O routines, which may result in unauthorized access to
I/O procedures. This organizational structure is used by the MS-DOS operating system:
o There are four layers that make up the MS-DOS operating system, and each has its own set of
features.
o These layers include ROM BIOS device drivers, MS-DOS device drivers, application programs,
and system programs.
o The MS-DOS operating system benefits from layering because each level can be defined
independently and, when necessary, can interact with one another.
o If the system is built in layers, it will be simpler to design, manage, and update. Because of this,
simple structures can be used to build constrained systems that are less complex.
o When a user program fails, the operating system as whole crashes.
o Because MS-DOS systems have a low level of abstraction, programs and I/O procedures are visible
to end users, giving them the potential for unwanted access.
The following figure illustrates layering in simple structure:
Advantages of Simple Structure:
o Because there are only a few interfaces and levels, it is simple to develop.
o Because there are fewer layers between the hardware and the applications, it offers superior
performance.
Disadvantages of Simple Structure:
o The entire operating system breaks if just one user program malfunctions.
o Since the layers are interconnected, and in communication with one another, there is no abstraction
or data hiding.
o The operating system's operations are accessible to layers, which can result in data tampering and
system failure.
2. Monolithic structure:
 The monolithic operating system controls all aspects of the operating system's operation, including
file management, memory management, device management, and operational operations.
 The core of an operating system for computers is called the kernel (OS). All other System
components are provided with fundamental services by the kernel.
 The operating system and the hardware use it as their main interface.
 When an operating system is built into a single piece of hardware, such as a keyboard or mouse,
the kernel can directly access all of its resources.
 The monolithic operating system is often referred to as the monolithic kernel. Multiple
programming techniques such as batch processing and time-sharing increase a processor's
usability.
 Working on top of the operating system and under complete command of all hardware, the
monolithic kernel performs the role of a virtual computer.
 This is an old operating system that was used in banks to carry out simple tasks like batch
processing and time-sharing, which allows numerous users at different terminals to access the
Operating System.
The following diagram represents the monolithic structure:
Advantages of Monolithic Structure:
o Because layering is unnecessary and the kernel alone is responsible for managing all operations,
it is easy to design and execute.
o Due to the fact that functions like memory management, file management, process scheduling,
etc., are implemented in the same address area, the monolithic kernel runs rather quickly when
compared to other systems. Utilizing the same address speeds up and reduces the time required for
address allocation for new processes.
Disadvantages of Monolithic Structure:
o The monolithic kernel's services are interconnected in address space and have an impact on one
another, so if any of them malfunctions, the entire system does as well.
o It is not adaptable. Therefore, launching a new service is difficult.
3. Layered structure:
 The OS is separated into layers or levels in this kind of arrangement. Layer 0 (the lowest layer)
contains the hardware, and layer 1 (the highest layer) contains the user interface (layer N).
 These layers are organized hierarchically, with the top-level layers making use of the capabilities
of the lower-level ones.
 The functionalities of each layer are separated in this method, and abstraction is also an option.
Because layered structures are hierarchical, debugging is simpler, therefore all lower-level layers
are debugged before the upper layer is examined. As a result, the present layer alone has to be
reviewed since all the lower layers have already been examined.
 The image below shows how OS is organized into layers:
Advantages of Layered Structure:
o Work duties are separated since each layer has its own functionality, and there is some amount of
abstraction.
o Debugging is simpler because the lower layers are examined first, followed by the top layers.
Disadvantages of Layered Structure:
o Performance is compromised in layered structures due to layering.
o Construction of the layers requires careful design because upper layers only make use of lower
layers' capabilities.
4. Micro-kernel structure:
 The operating system is created using a micro-kernel framework that strips the kernel of any
unnecessary parts.
 Systems and user applications are used to implement these optional kernel components.
 So, Micro-Kernels is the name given to these systems that have been developed.
 Each Micro-Kernel is created separately and is kept apart from the others. As a result, the system
is now more trustworthy and secure.
 If one Micro-Kernel malfunctions, the remaining operating system is unaffected and continues to
function normally.
The image below shows Micro-Kernel Operating System Structure:
Advantages of Micro-Kernel Structure:
o It enables portability of the operating system across platforms.
o Due to the isolation of each Micro-Kernel, it is reliable and secure.
o The reduced size of Micro-Kernels allows for successful testing.
o The remaining operating system remains unaffected and keeps running properly even if a
component or Micro-Kernel fails.
Disadvantages of Micro-Kernel Structure:
o The performance of the system is decreased by increased inter-module communication.
o The construction of a system is complicated.
5. Exo-kernel:
 An operating system called Exokernel was created at MIT with the goal of offering application-
level management of hardware resources.
 The exokernel architecture's goal is to enable application-specific customization by separating
resource management from protection. Exokernel size tends to be minimal due to its limited
operability.
 Because the OS sits between the programs and the actual hardware, it will always have an effect
on the functionality, performance, and breadth of the apps that are developed on it.
 By rejecting the idea that an operating system must offer abstractions upon which to base
applications, the exokernel operating system makes an effort to solve this issue.
 The goal is to give developers as few restriction on the use of abstractions as possible while yet
allowing them the freedom to do so when necessary. Because of the way the exokernel architecture
is designed, a single tiny kernel is responsible for moving all hardware abstractions into unreliable
libraries known as library operating systems.
 Exokernels differ from micro- and monolithic kernels in that their primary objective is to prevent
forced abstraction.
Exokernel operating systems have a number of features, including:
o Enhanced application control support.
o Splits management and security apart.
o A secure transfer of abstractions is made to an unreliable library operating system.
o Brings up a low-level interface.
o Operating systems for libraries provide compatibility and portability.
Advantages of Exokernel Structure:
o Application performance is enhanced by it.
o Accurate resource allocation and revocation enable more effective utilisation of hardware
resources.
o New operating systems can be tested and developed more easily.
o Every user-space program is permitted to utilise its own customised memory management.
Disadvantages of Exokernel Structure:
o A decline in consistency
o Exokernel interfaces have a complex architecture.
6. Virtual Machines (VM’s)
 The hardware of our personal computer, including the CPU, disc drives, RAM, and NIC (Network
Interface Card), is abstracted by a virtual machine into a variety of various execution contexts
based on our needs, giving us the impression that each execution environment is a separate
computer.
 A virtual box is an example of it.
 Using CPU scheduling and virtual memory techniques, an operating system allows us to execute
multiple processes simultaneously while giving the impression that each one is using a separate
processor and virtual memory.
 System calls and a file system are examples of extra functionalities that a process can have that
the hardware is unable to give.
 Instead of offering these extra features, the virtual machine method just offers an interface that is
similar to that of the most fundamental hardware.
 A virtual duplicate of the computer system underneath is made available to each process.
 We can develop a virtual machine for a variety of reasons, all of which are fundamentally
connected to the capacity to share the same underlying hardware while concurrently supporting
various execution environments, i.e., various operating systems.
 Disk systems are the fundamental problem with the virtual machine technique. If the actual
machine only has three-disc drives but needs to host seven virtual machines, let's imagine that.
 It is obvious that it is impossible to assign a disc drive to every virtual machine because the
program that creates virtual machines would require a sizable amount of disc space in order to
offer virtual memory and spooling.
 The provision of virtual discs is the solution. The result is that users get their own virtual machines.
They can then use any of the operating systems or software programs that are installed on the
machine below.
 Virtual machine software is concerned with programming numerous virtual machines
simultaneously into a physical machine; it is not required to take into account any user-support
software.
 With this configuration, it may be possible to break the challenge of building an interactive system
for several users into two manageable chunks.
Advantages of Virtual Machines:
o Due to total isolation between each virtual machine and every other virtual machine, there are no
issues with security.
o A virtual machine may offer an architecture for the instruction set that is different from that of
actual computers.
o Simple availability, accessibility, and recovery convenience.
Disadvantages of Virtual Machines:
o Depending on the workload, operating numerous virtual machines simultaneously on a host
computer may have an adverse effect on one of them.
o When it comes to hardware access, virtual computers are less effective than physical ones.
5. TYPES OF OPERATING SYSTEM:
An operating system is a well-organized collection of programs that manages the computer
hardware. It is a type of system software that is responsible for the smooth functioning of the computer
system.
1. Batch Operating System
2. Multiprogramming Operating System
3. Time-Sharing OS
4. Multiprocessing OS
5. Distributed OS
6. Network OS
7. Real Time OS
8. Embedded OS
1. Batch Operating System:
 The users of this type of operating system does not interact with the computer directly.
 Each user prepares his job on an off-line device like punch cards and submits it to the computer
operator
 There is an operator which takes similar jobs having the same requirement and group them into
batches.
Advantages of Batch Operating System:
 Processors of the batch systems know how long the job would be when it is in queue
 Multiple users can share the batch systems
 The idle time for the batch system is very less
 It is easy to manage large work repeatedly in batch systems
Disadvantages of Batch Operating System:
 The computer operators should be well known with batch systems
 Batch systems are hard to debug
 It is sometimes costly
 The other jobs will have to wait for an unknown time if any job fails
Examples of Batch based Operating System:
IBM's MVS.
2. Multiprogramming Operating System:
 This type of OS is used to execute more than one jobs simultaneously by a single processor.
 It increases CPU utilization by organizing jobs so that the CPU always has one job to execute.
 Multiprogramming operating systems use the mechanism of job scheduling and CPU scheduling.
3. Time-Sharing OS:
 Each task is given some time to execute so that all the tasks work smoothly.
 These systems are also known as Multi-tasking Systems.
 The task can be from a single user or different users also.
 The time that each task gets to execute is called quantum.
 After this time interval is over OS switches over to the next task.
Advantages of Time-Sharing OS:
 Each task gets an equal opportunity
 Fewer chances of duplication of software
 CPU idle time can be reduced
Disadvantages of Time-Sharing OS:
 Reliability problem
 One must have to take care of the security and integrity of user programs and data
 Data communication problem
Examples of Time-Sharing Oss: Multics, UNIX, etc.
4. Multiprocessing OS:
 Multiprocessor operating systems are also known as parallel OS or tightly coupled OS.
 Such operating systems have more than one processor in close communication that sharing the
computer bus, the clock and sometimes memory and peripheral devices.
 It executes multiple jobs at the same time and makes the processing faster.
 It supports large physical address space and larger virtual address space.
 If one processor fails then other processor should retrieve the interrupted process state so
execution of process can continue.
 Inter-processes communication mechanism is provided and implemented in hardware.
5. Distributed OS:
 Various autonomous interconnected computers communicate with each other using a shared
communication network.
 Independent systems possess their own memory unit and CPU.
 These are referred to as loosely coupled systems.
 Examples:- Locus, DYSEAC
6. Network OS:
 These systems run on a server and provide the capability to manage data, users, groups, security,
applications, and other networking functions.
 These types of operating systems allow shared access of files, printers, security, applications,
and other networking functions over a small private network.
 The “other" computers arc called client computers, and each computer that connects to a network
server must be running client software designed to request a specific service.
 Popularly known as tightly coupled systems.
Advantages of Network Operating System:
 Highly stable centralized servers
 Security concerns are handled through servers
 New technologies and hardware up-gradation are easily integrated into the system
 Server access is possible remotely from different locations and types of systems
Disadvantages of Network Operating System:
 Servers are costly
 User has to depend on a central location for most operations
 Maintenance and updates are required regularly
Examples of Network Operating System are:
 Microsoft Windows Server 2003/2008/2012, UNIX, Linux, Mac OS X, Novell NetWare, and
BSD, etc.
7. Real Time OS:
 These types of OSs serve real-time systems.
 The time interval required to process and respond to inputs is very small.
 This time interval is called response time.
 Real-time systems are used when there are time requirements that are very strict like
o missile systems,
o air traffic control systems,
o Robots, etc.
8. Embedded OS:
 An embedded operating system is one that is built into the circuitry of an electronic device.
 Embedded operating systems are now found in automobiles, bar-code scanners, cell phones,
medical equipment, and personal digital assistants.
 The most popular embedded operating systems for consumer products, such as PDAs, include the
following:
o Windows XP Embedded
o Windows CE .NET:- it supports wireless communications, multimedia and Web
browsing. It also allows for the use of smaller versions of Microsoft Word, Excel, and
Outlook.
o Palm OS: - It is the standard operating system for Palm-brand PDAs as well as other
proprietary handheld devices.
o Symbian: - OS found in “smart” cell phones from Nokia and Sony Ericsson.
6. SYSTEM COMPONENTS:
 There are various components of an Operating System to perform well defined tasks.
 Though most of the Operating Systems differ in structure but logically they have similar
components.
 Each component must be a well-defined portion of a system that appropriately describes the
functions, inputs, and outputs.
There are following 8-components of an Operating System:
1. Process Management
2. I/O Device Management
3. File Management
4. Network Management
5. Main Memory Management
6. Secondary Storage Management
7. Security Management
8. Command Interpreter System
Following section explains all the above components in more detail:
i. Process Management
 A process is program or a fraction of a program that is loaded in main memory.
 A process needs certain resources including CPU time, Memory, Files, and I/O devices to
accomplish its task.
 The process management component manages the multiple processes running simultaneously on
the Operating System.
 A program in running state is called a process.
The operating system is responsible for the following activities in connection with process management:
 Create, load, execute, suspend, resume, and terminate processes.
 Switch system among multiple processes in main memory.
 Provides communication mechanisms so that processes can communicate with each other’s
 Provides synchronization mechanisms to control concurrent access to shared data to keep shared
data consistent.
 Allocate/de-allocate resources properly to prevent or avoid deadlock situation.
ii. I/O Device Management
 One of the purposes of an operating system is to hide the peculiarities of specific hardware devices
from the user.
 I/O Device Management provides an abstract level of H/W devices and keep the details from
applications to ensure proper use of devices, to prevent errors, and to provide users with convenient
and efficient programming environment.
Following are the tasks of I/O Device Management component:
 Hide the details of H/W devices
 Manage main memory for the devices using cache, buffer, and spooling
 Maintain and provide custom drivers for each device.
iii. File Management
 File management is one of the most visible services of an operating system.
 Computers can store information in several different physical forms; magnetic tape, disk, and drum
are the most common forms.
 A file is defined as a set of correlated information and it is defined by the creator of the file. Mostly
files represent data, source and object forms, and programs.
 Data files can be of any type like alphabetic, numeric, and alphanumeric.
 A files is a sequence of bits, bytes, lines or records whose meaning is defined by its creator and
user.
 The operating system implements the abstract concept of the file by managing mass storage device,
such as types and disks.
 Also files are normally organized into directories to ease their use. These directories may contain
files and other directories and so on.
The operating system is responsible for the following activities in connection with file management:
 File creation and deletion
 Directory creation and deletion
 The support of primitives for manipulating files and directories
 Mapping files onto secondary storage
 File backup on stable (nonvolatile) storage media
iv. Network Management
 The definition of network management is often broad, as network management involves several
different components.
 Network management is the process of managing and administering a computer network.
 A computer network is a collection of various types of computers connected with each other.
 Network management comprises fault analysis, maintaining the quality of service, provisioning of
networks, and performance management.
 Network management is the process of keeping your network healthy for an efficient
communication between different computers.
Following are the features of network management:
 Network administration
 Network maintenance
 Network operation
 Network provisioning
 Network security
v. Main Memory Management
 Memory is a large array of words or bytes, each with its own address. It is a repository of quickly
accessible data shared by the CPU and I/O devices.
 Main memory is a volatile storage device which means it loses its contents in the case of system
failure or as soon as system power goes down.
 The main motivation behind Memory Management is to maximize memory utilization on the
computer system.
The operating system is responsible for the following activities in connections with memory management:
 Keep track of which parts of memory are currently being used and by whom.
 Decide which processes to load when memory space becomes available.
 Allocate and deallocate memory space as needed.
vi. Secondary Storage Management
 The main purpose of a computer system is to execute programs. These programs, together with
the data they access, must be in main memory during execution.
 Since the main memory is too small to permanently accommodate all data and program, the
computer system must provide secondary storage to backup main memory.
 Most modern computer systems use disks as the principle on-line storage medium, for both
programs and data.
 Most programs, like compilers, assemblers, sort routines, editors, formatters, and so on, are stored
on the disk until loaded into memory, and then use the disk as both the source and destination of
their processing.
The operating system is responsible for the following activities in connection with disk management:
 Free space management
 Storage allocation
 Disk scheduling
vii. Security Management
 The operating system is primarily responsible for all task and activities happen in the computer
system.
 The various processes in an operating system must be protected from each other’s activities.
 For that purpose, various mechanisms which can be used to ensure that the files, memory segment,
CPU and other resources can be operated on only by those processes that have gained proper
authorization from the operating system.
 Security Management refers to a mechanism for controlling the access of programs, processes, or
users to the resources defined by a computer controls to be imposed, together with some means of
enforcement.
 For example, memory addressing hardware ensure that a process can only execute within its own
address space.
 The timer ensure that no process can gain control of the CPU without relinquishing it. Finally, no
process is allowed to do its own I/O, to protect the integrity of the various peripheral devices.
viii. Command Interpreter System
 One of the most important component of an operating system is its command interpreter.
 The command interpreter is the primary interface between the user and the rest of the system.
 Command Interpreter System executes a user command by calling one or more number of
underlying system programs or system calls.
 Command Interpreter System allows human users to interact with the Operating System and
provides convenient programming environment to the users.
 Many commands are given to the operating system by control statements.
 A program which reads and interprets control statements is automatically executed.
 This program is called the shell and few examples are Windows DOS command window, Bash of
Unix/Linux or C-Shell of Unix/Linux.
7. OPERATING SYSTEM SERVICES:
An Operating System provides services to both the users and to the programs.
 It provides programs an environment to execute.
 It provides users the services to execute the programs in a convenient manner.
Following are a few common services provided by an operating system −
 Program execution
 I/O operations
 File System manipulation
 Communication
 Error Detection
 Resource Allocation
 Protection
i. Program execution
 Operating systems handle many kinds of activities from user programs to system programs like
printer spooler, name servers, file server, etc. Each of these activities is encapsulated as a process.
 A process includes the complete execution context (code to execute, data to manipulate, registers,
OS resources in use).
Following are the major activities of an operating system with respect to program management −
 Loads a program into memory.
 Executes the program.
 Handles program's execution.
 Provides a mechanism for process synchronization.
 Provides a mechanism for process communication.
 Provides a mechanism for deadlock handling.
ii. I/O Operation
 An I/O subsystem comprises of I/O devices and their corresponding driver software. Drivers hide
the peculiarities of specific hardware devices from the users.
An Operating System manages the communication between user and device drivers.
 I/O operation means read or write operation with any file or any specific I/O device.
 Operating system provides the access to the required I/O device when required.
iii. File system manipulation
 A file represents a collection of related information. Computers can store files on the disk
(secondary storage), for long-term storage purpose.
 Examples of storage media include magnetic tape, magnetic disk and optical disk drives like CD,
DVD.
 Each of these media has its own properties like speed, capacity, and data transfer rate and data
access methods.
 A file system is normally organized into directories for easy navigation and usage.
 These directories may contain files and other directions.
Following are the major activities of an operating system with respect to file management −
 Program needs to read a file or write a file.
 The operating system gives the permission to the program for operation on file.
 Permission varies from read-only, read-write, denied and so on.
 Operating System provides an interface to the user to create/delete files.
 Operating System provides an interface to the user to create/delete directories.
 Operating System provides an interface to create the backup of file system.
iv. Communication
 In case of distributed systems which are a collection of processors that do not share memory,
peripheral devices, or a clock, the operating system manages communications between all the
processes.
 Multiple processes communicate with one another through communication lines in the network.
 The OS handles routing and connection strategies, and the problems of contention and security.
Following are the major activities of an operating system with respect to communication −
 Two processes often require data to be transferred between them
 Both the processes can be on one computer or on different computers, but are connected
through a computer network.
 Communication may be implemented by two methods, either by Shared Memory or by
Message Passing.
v. Error handling
 Errors can occur anytime and anywhere.
 An error may occur in CPU, in I/O devices or in the memory hardware.
Following are the major activities of an operating system with respect to error handling −
 The OS constantly checks for possible errors.
 The OS takes an appropriate action to ensure correct and consistent computing.
vi. Resource Management
 In case of multi-user or multi-tasking environment, resources such as main memory, CPU cycles
and files storage are to be allocated to each user or job.
Following are the major activities of an operating system with respect to resource management −
 The OS manages all kinds of resources using schedulers.
 CPU scheduling algorithms are used for better utilization of CPU.
vii. Protection
 Considering a computer system having multiple users and concurrent execution of multiple
processes, the various processes must be protected from each other's activities.
 Protection refers to a mechanism or a way to control the access of programs, processes, or users to
the resources defined by a computer system.
Following are the major activities of an operating system with respect to protection −
 The OS ensures that all access to system resources is controlled.
 The OS ensures that external I/O devices are protected from invalid access attempts.
 The OS provides authentication features for each user by means of passwords.
8. SYSTEM CALLS:
 A system call is a way for a user program to interface with the operating system.
 The program requests several services, and the OS responds by invoking a series of system calls to
satisfy the request.
 A system call can be written in assembly language or a high-level language like C or Pascal.
 System calls are predefined functions that the operating system may directly invoke if a high-level
language is used.
What is system Call?
• A system call is a method for a computer program to request a service from the kernel of
the operating system on which it is running.
• A system call is a method of interacting with the operating system via programs.
• A system call is a request from computer software to an operating system's kernel.
• The Application Program Interface (API) connects the operating system's functions to user
programs.
• It acts as a link between the operating system and a process, allowing user-level programs to
request operating system services.
• The kernel system can only be accessed using system calls.
• System calls are required for any programs that use resources.
How are system calls made?
• When a computer software needs to access the operating system's kernel, it makes a system call.
• The system call uses an API to expose the operating system's services to user programs.
• It is the only method to access the kernel system.
• All programs or processes that require resources for execution must use system calls, as they
serve as an interface between the operating system and user programs.
Below are some examples of how a system call varies from a user function.
• A system call function may create and use kernel processes to execute the asynchronous
processing.
• A system call has greater authority than a standard subroutine. A system call with kernel-
mode privilege executes in the kernel protection domain.
• System calls are not permitted to use shared libraries or any symbols that are not present
in the kernel protection domain.
• The code and data for system calls are stored in global kernel memory.
Example of System Calls:
Example of Standard API:
Why do you need system calls in Operating System?
There are various situations where you must require system calls in the operating system. Following
of the situations are as follows:
• It is must require when a file system wants to create or delete a file.
• Network connections require the system calls to sending and receiving data packets.
• If you want to read or write a file, you need to system calls.
• If you want to access hardware devices, including a printer, scanner, you need a system
call.
• System calls are used to create and manage new processes.
How System call works?
• Typically, a number associated with each system call
• System-call interface maintains a table indexed according to these numbers
• The system call interface invokes the intended system call in OS kernel and returns status of the
system call and any return values
• The caller need know nothing about how the system call is implemented
• Just needs to obey API and understand what OS will do as a result call
• Most details of OS interface hidden from programmer by API
• Managed by run-time support library (set of functions built into libraries included
with compiler)
API – System Call – OS Relationship:
System Call Parameter Passing:
• Often, more information is required than simply identity of desired system call
• Exact type and amount of information vary according to OS and call
• Three general methods used to pass parameters to the OS
• Simplest: pass the parameters in registers
• In some cases, may be more parameters than registers
• Parameters stored in a block, or table, in memory, and address of block passed as a
parameter in a register
• This approach taken by Linux and Solaris
• Parameters placed, or pushed, onto the stack by the program and popped off the stack
by the operating system
• Block and stack methods do not limit the number or length of parameters being passed
Parameter Passing via Table:
TYPES OF SYSTEM CALLS:
1) Process Control
This system calls perform the task of process creation, process termination, etc.
Functions:
 End and Abort
 Load and Execute
 Create Process and Terminate Process
 Wait and Signal Event
 Allocate and free memory
2) File Management
File management system calls handle file manipulation jobs like creating a file, reading, and writing, etc.
Functions:
 Create a file
 Delete file
 Open and close file
 Read, write, and reposition
 Get and set file attributes
3) Device Management
Device management does the job of device manipulation like reading from device buffers, writing into
device buffers, etc.
Functions:
 Request and release device
 Logically attach/ detach devices
 Get and Set device attributes
4) Information Maintenance
It handles information and its transfer between the OS and the user program.
Functions:
 Get or set time and date
 Get process and device attributes
5) Communication:
These types of system calls are specially used for interprocess communications.
Functions:
 Create, delete communications connections
 Send, receive message
 Help OS to transfer status information
 Attach or detach remote devices
Example of System Calls in Windows and UNIX:
IMPORTANT SYSTEM CALLS USED IN OS:
wait()
 In some systems, a process needs to wait for another process to complete its execution.
 This type of situation occurs when a parent process creates a child process, and the execution of
the parent process remains suspended until its child process executes.
 The suspension of the parent process automatically occurs with a wait() system call. When the
child process ends execution, the control moves back to the parent process.
fork()
 Processes use this system call to create processes that are a copy of themselves. With the help of
this system Call parent process creates a child process, and the execution of the parent process will
be suspended till the child process executes.
exec()
 This system call runs when an executable file in the context of an already running process that
replaces the older executable file. However, the original process identifier remains as a new
process is not built, but stack, data, head, data, etc. are replaced by the new process.
kill():
 The kill() system call is used by OS to send a termination signal to a process that urges the process
to exit. However, a kill system call does not necessarily mean killing the process and can have
various meanings.
exit():
 The exit() system call is used to terminate program execution. Specially in the multi-threaded
environment, this call defines that the thread execution is complete. The OS reclaims resources
that were used by the process after the use of exit() system call.
Standard C Library Example:
• C program invoking printf() library call, which calls write() system call.
SYSTEM PROGRAM:
• System programs provide a convenient environment for program development and execution.
• They can be divided into:
• File manipulation
• Status information sometimes stored in a File modification
• Programming language support
• Program loading and execution
• Communications
• Background services
• Application programs
• Most users’ view of the operation system is defined by system programs, not the actual system
calls
• Provide a convenient environment for program development and execution
• Some of them are simply user interfaces to system calls; others are considerably more
complex.
• File management - Create, delete, copy, rename, print, dump, list, and generally manipulate
files and directories.
• Status information
• Some ask the system for info - date, time, amount of available memory, disk space, and
number of users.
• Others provide detailed performance, logging, and debugging information
• Typically, these programs format and print the output to the terminal or other output
devices.
• Some systems implement a registry - used to store and retrieve configuration
information.
• File modification
• Text editors to create and modify files
• Special commands to search contents of files or perform transformations of the text
• Programming-language support - Compilers, assemblers, debuggers and interpreters
sometimes provided
• Program loading and execution- Absolute loaders, relocatable loaders, linkage editors, and
overlay-loaders, debugging systems for higher-level and machine language
• Communications - Provide the mechanism for creating virtual connections among processes,
users, and computer systems
• Allow users to send messages to one another’s screens, browse web pages, send
electronic-mail messages, and log in remotely, transfer files from one machine to another.
• Background Services
• Launch at boot time
• Some for system startup, then terminate
• Some from system boot to shutdown
• Provide facilities like disk checking, process scheduling, error logging, printing
• Run in user context not kernel context
• Known as services, subsystems, daemons
• Application programs
• Don’t pertain to system
• Run by users
• Not typically considered part of OS
• Launched by command line, mouse click, finger poke
9. OPERATING SYSTEM PROPERTIES:
Following are the different properties of an Operating System.
 Batch processing
 Multitasking
 Multiprogramming
 Interactivity
 Real Time System
 Distributed Environment
 Spooling
i. Batch processing
 Batch processing is a technique in which an Operating System collects the programs and data
together in a batch before processing starts.
 An operating system does the following activities related to batch processing −
 The OS defines a job which has predefined sequence of commands, programs and data as a single
unit.
 The OS keeps a number a jobs in memory and executes them without any manual information.
 Jobs are processed in the order of submission, i.e., first come first served fashion.
 When a job completes its execution, its memory is released and the output for the job gets copied
into an output spool for later printing or processing.
Advantages
 Batch processing takes much of the work of the operator to the computer.
 Increased performance as a new job get started as soon as the previous job is finished, without any
manual intervention.
Disadvantages
 Difficult to debug program.
 A job could enter an infinite loop.
 Due to lack of protection scheme, one batch job can affect pending jobs.
ii. Multitasking
 Multitasking is when multiple jobs are executed by the CPU simultaneously by switching between
them. Switches occur so frequently that the users may interact with each program while it is
running. An OS does the following activities related to multitasking −
 The user gives instructions to the operating system or to a program directly, and receives an
immediate response.
 The OS handles multitasking in the way that it can handle multiple operations/executes multiple
programs at a time.
 Multitasking Operating Systems are also known as Time-sharing systems.
 These Operating Systems were developed to provide interactive use of a computer system at a
reasonable cost.
 A time-shared operating system uses the concept of CPU scheduling and multiprogramming to
provide each user with a small portion of a time-shared CPU.
 Each user has at least one separate program in memory.
 A program that is loaded into memory and is executing is commonly referred to as a process.
 When a process executes, it typically executes for only a very short time before it either finishes
or needs to perform I/O.
 Since interactive I/O typically runs at slower speeds, it may take a long time to complete. During
this time, a CPU can be utilized by another process.
 The operating system allows the users to share the computer simultaneously. Since each action or
command in a time-shared system tends to be short, only a little CPU time is needed for each user.
 As the system switches CPU rapidly from one user/program to the next, each user is given the
impression that he/she has his/her own CPU, whereas actually one CPU is being shared among
many users.
iii. Multiprogramming
 Sharing the processor, when two or more programs reside in memory at the same time, is referred
as multiprogramming.
 Multiprogramming assumes a single shared processor.
 Multiprogramming increases CPU utilization by organizing jobs so that the CPU always has one
to execute.
The following figure shows the memory layout for a multiprogramming system.
An OS does the following activities related to multiprogramming.
 The operating system keeps several jobs in memory at a time.
 This set of jobs is a subset of the jobs kept in the job pool.
 The operating system picks and begins to execute one of the jobs in the memory.
 Multiprogramming operating systems monitor the state of all active programs and system
resources using memory management programs to ensure that the CPU is never idle, unless there
are no jobs to process.
Advantages
 High and efficient CPU utilization.
 User feels that many programs are allotted CPU almost simultaneously.
Disadvantages
 CPU scheduling is required.
 To accommodate many jobs in memory, memory management is required.
iv. Interactivity
 Interactivity refers to the ability of users to interact with a computer system. An Operating system
does the following activities related to interactivity −
 Provides the user an interface to interact with the system.
 Manages input devices to take inputs from the user. For example, keyboard.
 Manages output devices to show outputs to the user. For example, Monitor.
 The response time of the OS needs to be short, since the user submits and waits for the result.
v. Real Time System
Real-time systems are usually dedicated, embedded systems. An operating system does the following
activities related to real-time system activity.
 In such systems, Operating Systems typically read from and react to sensor data.
 The Operating system must guarantee response to events within fixed periods of time to ensure
correct performance.
vi. Distributed Environment
 A distributed environment refers to multiple independent CPUs or processors in a computer
system. An operating system does the following activities related to distributed environment −
 The OS distributes computation logics among several physical processors.
 The processors do not share memory or a clock. Instead, each processor has its own local memory.
 The OS manages the communications between the processors. They communicate with each other
through various communication lines.
vii. Spooling
 Spooling is an acronym for simultaneous peripheral operations on line.
 Spooling refers to putting data of various I/O jobs in a buffer.
 This buffer is a special area in memory or hard disk which is accessible to I/O devices.
An operating system does the following activities related to distributed environment −
 Handles I/O device data spooling as devices have different data access rates.
 Maintains the spooling buffer which provides a waiting station where data can rest while the slower
device catches up.
 Maintains parallel computation because of spooling process as a computer can perform I/O in
parallel fashion.
 It becomes possible to have the computer read data from a tape, write data to disk and to write out
to a tape printer while it is doing its computing task.
Advantages
 The spooling operation uses a disk as a very large buffer.
 Spooling is capable of overlapping I/O operation for one job with processor operations for
another job.

More Related Content

What's hot

Sources of bioelectric potentials
Sources of bioelectric potentialsSources of bioelectric potentials
Sources of bioelectric potentialsGhansyam Rathod
 
Minimum Modes and Maximum Modes of 8086 Microprocessor
Minimum Modes and Maximum Modes of 8086 MicroprocessorMinimum Modes and Maximum Modes of 8086 Microprocessor
Minimum Modes and Maximum Modes of 8086 MicroprocessorNikhil Kumar
 
Gravitational search algorithm
Gravitational search algorithmGravitational search algorithm
Gravitational search algorithmAhmed Fouad Ali
 
Computer organisation Module 1.ppt
Computer organisation Module 1.pptComputer organisation Module 1.ppt
Computer organisation Module 1.pptSoulReaper21
 
Logical instruction of 8085
Logical instruction of 8085Logical instruction of 8085
Logical instruction of 8085vishalgohel12195
 
Introduction to biofluid mechanics
Introduction to biofluid mechanicsIntroduction to biofluid mechanics
Introduction to biofluid mechanicsRiadh Al-Haidari
 
BIOMETRIC IDENTIFICATION IN ATM’S PPT
BIOMETRIC IDENTIFICATION IN ATM’S  PPTBIOMETRIC IDENTIFICATION IN ATM’S  PPT
BIOMETRIC IDENTIFICATION IN ATM’S PPTsravya raju
 
Biosignals andthermometry fin
Biosignals andthermometry finBiosignals andthermometry fin
Biosignals andthermometry finMUBOSScz
 
Biofluid Chapter 3.6.pdf
Biofluid Chapter 3.6.pdfBiofluid Chapter 3.6.pdf
Biofluid Chapter 3.6.pdfAbrarFarhan3
 

What's hot (15)

Sources of bioelectric potentials
Sources of bioelectric potentialsSources of bioelectric potentials
Sources of bioelectric potentials
 
Minimum Modes and Maximum Modes of 8086 Microprocessor
Minimum Modes and Maximum Modes of 8086 MicroprocessorMinimum Modes and Maximum Modes of 8086 Microprocessor
Minimum Modes and Maximum Modes of 8086 Microprocessor
 
Gravitational search algorithm
Gravitational search algorithmGravitational search algorithm
Gravitational search algorithm
 
Computer organisation Module 1.ppt
Computer organisation Module 1.pptComputer organisation Module 1.ppt
Computer organisation Module 1.ppt
 
SYNCHRONIZATION
SYNCHRONIZATIONSYNCHRONIZATION
SYNCHRONIZATION
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
 
Logical instruction of 8085
Logical instruction of 8085Logical instruction of 8085
Logical instruction of 8085
 
Case studing
Case studingCase studing
Case studing
 
Introduction to biofluid mechanics
Introduction to biofluid mechanicsIntroduction to biofluid mechanics
Introduction to biofluid mechanics
 
Step to program in tasm
Step to program in tasmStep to program in tasm
Step to program in tasm
 
design of accumlator
design of accumlatordesign of accumlator
design of accumlator
 
BIOMETRIC IDENTIFICATION IN ATM’S PPT
BIOMETRIC IDENTIFICATION IN ATM’S  PPTBIOMETRIC IDENTIFICATION IN ATM’S  PPT
BIOMETRIC IDENTIFICATION IN ATM’S PPT
 
Biosignals andthermometry fin
Biosignals andthermometry finBiosignals andthermometry fin
Biosignals andthermometry fin
 
Biofluid Chapter 3.6.pdf
Biofluid Chapter 3.6.pdfBiofluid Chapter 3.6.pdf
Biofluid Chapter 3.6.pdf
 
Physical symbol system
Physical symbol systemPhysical symbol system
Physical symbol system
 

Similar to CS403: Operating System : Unit I _merged.pdf

Similar to CS403: Operating System : Unit I _merged.pdf (20)

Basic operating systems in computer and it's uses
Basic operating systems in computer and it's usesBasic operating systems in computer and it's uses
Basic operating systems in computer and it's uses
 
L-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.pptL-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.ppt
 
Ch3
Ch3Ch3
Ch3
 
NE223_chapter 1_Overview of operating systems.ppt
NE223_chapter 1_Overview of operating systems.pptNE223_chapter 1_Overview of operating systems.ppt
NE223_chapter 1_Overview of operating systems.ppt
 
Ch3 OS
Ch3 OSCh3 OS
Ch3 OS
 
OSCh3
OSCh3OSCh3
OSCh3
 
OS_Ch3
OS_Ch3OS_Ch3
OS_Ch3
 
Unit 1 q&a
Unit  1 q&aUnit  1 q&a
Unit 1 q&a
 
Bedtime Stories on Operating Systems.pdf
Bedtime Stories on Operating Systems.pdfBedtime Stories on Operating Systems.pdf
Bedtime Stories on Operating Systems.pdf
 
Operating System
Operating SystemOperating System
Operating System
 
Introduction of operating system
Introduction of operating systemIntroduction of operating system
Introduction of operating system
 
Chapter 1- Introduction.ppt
Chapter 1- Introduction.pptChapter 1- Introduction.ppt
Chapter 1- Introduction.ppt
 
Ch1kiit [compatibility mode]
Ch1kiit [compatibility mode]Ch1kiit [compatibility mode]
Ch1kiit [compatibility mode]
 
Operating system notes ch1
Operating system notes ch1Operating system notes ch1
Operating system notes ch1
 
Ch1
Ch1Ch1
Ch1
 
Ch1
Ch1Ch1
Ch1
 
Principles of operating system
Principles of operating systemPrinciples of operating system
Principles of operating system
 
os mod1 notes
 os mod1 notes os mod1 notes
os mod1 notes
 
Basics of Operating System
Basics of Operating SystemBasics of Operating System
Basics of Operating System
 
Kernel
KernelKernel
Kernel
 

More from Asst.prof M.Gokilavani

CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
IT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdfIT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdfAsst.prof M.Gokilavani
 
IT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notesIT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notesAsst.prof M.Gokilavani
 
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdfGE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdfAsst.prof M.Gokilavani
 
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdfGE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdfAsst.prof M.Gokilavani
 
GE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdfGE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdfAsst.prof M.Gokilavani
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAsst.prof M.Gokilavani
 
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdfAI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdfAsst.prof M.Gokilavani
 
AI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptxAI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptxAsst.prof M.Gokilavani
 
AI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptxAI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptxAsst.prof M.Gokilavani
 
AI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAsst.prof M.Gokilavani
 
AI3391 Artificial Intelligence Session 25 Horn clause.pptx
AI3391 Artificial Intelligence Session 25 Horn clause.pptxAI3391 Artificial Intelligence Session 25 Horn clause.pptx
AI3391 Artificial Intelligence Session 25 Horn clause.pptxAsst.prof M.Gokilavani
 

More from Asst.prof M.Gokilavani (20)

CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
IT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdfIT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdf
 
IT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notesIT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notes
 
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdfGE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
 
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdfGE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
 
GE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdfGE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdf
 
GE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdfGE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdf
 
GE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _NotesGE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _Notes
 
GE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_NotesGE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_Notes
 
GE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_NotesGE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_Notes
 
GE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_NotesGE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_Notes
 
GE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_NotesGE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_Notes
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
 
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdfAI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
 
AI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptxAI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptx
 
AI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptxAI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptx
 
AI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptx
 
AI3391 Artificial Intelligence Session 25 Horn clause.pptx
AI3391 Artificial Intelligence Session 25 Horn clause.pptxAI3391 Artificial Intelligence Session 25 Horn clause.pptx
AI3391 Artificial Intelligence Session 25 Horn clause.pptx
 

Recently uploaded

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 

Recently uploaded (20)

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 

CS403: Operating System : Unit I _merged.pdf

  • 1. CS403PC Operating System B.TECH II YEAR – II SEM (R18) (2022-2023) Prepared By Asst.Prof.M.Gokilavani Department of Computer Science and Engineering (AI & ML)
  • 2. R18 B.Tech. CSE (AI & ML) Syllabus JNTU HYDERABAD 22 CS403PC: OPERATING SYSTEMS B.Tech. II Year II Sem. L T P C 3 0 0 3 Prerequisites:  A course on “Computer Programming and Data Structures”.  A course on “Computer Organization and Architecture”. Course Objectives:  Introduce operating system concepts (i.e., processes, threads, scheduling, synchronization, deadlocks, memory management, file and I/O subsystems and protection)  Introduce the issues to be considered in the design and development of operating system  Introduce basic Unix commands, system call interface for process management, interprocess communication and I/O in Unix Course Outcomes:  Will be able to control access to a computer and the files that may be shared  Demonstrate the knowledge of the components of computer and their respective roles in computing.  Ability to recognize and resolve user problems with standard operating environments.  Gain practical knowledge of how programming languages, operating systems, and architectures interact and how to use each effectively. UNIT - I Operating System - Introduction, Structures - Simple Batch, Multiprogrammed, Time-shared, Personal Computer, Parallel, Distributed Systems, Real-Time Systems, System components, Operating System services, System Calls UNIT - II Process and CPU Scheduling - Process concepts and scheduling, Operations on processes, Cooperating Processes, Threads, and Interposes Communication, Scheduling Criteria, Scheduling Algorithms, Multiple -Processor Scheduling. System call interface for process management-fork, exit, wait, waitpid, exec UNIT - III Deadlocks - System Model, Deadlocks Characterization, Methods for Handling Deadlocks, Deadlock Prevention, Deadlock Avoidance, Deadlock Detection, and Recovery from Deadlock Process Management and Synchronization - The Critical Section Problem, Synchronization Hardware, Semaphores, and Classical Problems of Synchronization, Critical Regions, Monitors Interprocess Communication Mechanisms: IPC between processes on a single computer system, IPC between processes on different systems, using pipes, FIFOs, message queues, shared memory. UNIT - IV Memory Management and Virtual Memory - Logical versus Physical Address Space, Swapping, Contiguous Allocation, Paging, Segmentation, Segmentation with Paging, Demand Paging, Page Replacement, Page Replacement Algorithms. UNIT - V File System Interface and Operations -Access methods, Directory Structure, Protection, File System Structure, Allocation methods, Free-space Management. Usage of open, create, read, write, close, lseek, stat, ioctl system calls.
  • 3. R18 B.Tech. CSE (AI & ML) Syllabus JNTU HYDERABAD 23 TEXT BOOKS: 1. Operating System Principles- Abraham Silberchatz, Peter B. Galvin, Greg Gagne 7th Edition, John Wiley 2. Advanced programming in the UNIX environment, W.R. Stevens, Pearson education. REFERENCE BOOKS: 1. Operating Systems – Internals and Design Principles Stallings, Fifth Edition–2005, Pearson Education/PHI 2. Operating System A Design Approach- Crowley, TMH. 3. Modern Operating Systems, Andrew S. Tanenbaum 2nd edition, Pearson/PHI 4. UNIX programming environment, Kernighan and Pike, PHI/ Pearson Education 5. UNIX Internals -The New Frontiers, U. Vahalia, Pearson Education.
  • 4. UNIT – I: Operating System - Introduction, Structures - Simple Batch, Multiprogrammed, Time-shared, Personal Computer, Parallel, Distributed Systems, Real-Time Systems, System components, Operating System services, System Calls. 1. OPERATING SYSTEM – INTRODUCTION: What is an operating System? • Computer System = Hardware + Software • Software = Application Software + System Software(OS)  Application Software: Eg: Compilers, Databases, Games, Video player, Browsers, etc.  System Software: Eg: Shells, Editors, Compilers, etc. Definition of OS: An Operating System is a system Software that acts as an intermediary/interface between a user of a computer and the computer hardware. • Operating system goals:  Execute user programs and make solving user problems easier  Make the computer system convenient to use  Use the computer hardware in an efficient manner The Structure of Computer Systems:  Accessing computer resources is divided into layers.  Each layer is isolated and only interacts directly with the layer below or above it.  If we install a new hardware device  No need to change anything about the user/applications.  However, you do need to make changes to the operating system.  You need to install the device drivers that the operating system will use to control the new device.
  • 5.  If we install a new software application  No need to make any changes to your hardware.  But we need to make sure the application is supported by the operating system  User will need to learn how to use the new application.  If we change the operating system  Need to make sure that both applications and hardware will compatible with the new operating system. 2. COMPUTER ARCHITECTURE: Special buses (address, data and control) connecting all input/output devices to motherboard.
  • 6. i. CPU – Central Processing Unit:  This is the brain of your computer.  It performs all of the calculations.  In order to do its job, the CPU needs commands to perform, and data to work with.  The instructions and data travel to and from the CPU on the system bus.  The operating system provides rules for how that information gets back and forth, and how it will be used by the CPU. ii. RAM – Random Access Memory:  This is like a desk, or a workspace, where your computer temporarily stores all of the information (data) and instructions (software or program code) that it is currently using.  Each RAM chip contains millions of address spaces.  Each address space is the same size, and has its own unique identifying number (address).  The operating system provides the rules for using these memory spaces, and controls storage and retrieval of information from RAM.  Device drivers for RAM chips are included with the operating system. iii.Operating System Mode:  The User Mode is concerned with the actual interface between the user and the system.  It controls things like running applications and accessing files.  The Kernel Mode is concerned with everything running in the background.  It controls things like accessing system resources, controlling hardware functions and processing program instructions.  System calls are used to change mode from User to Kernel.
  • 7. iv. Kernel:  Kernel is a software code that reside in central core of OS. It has complete control over system.  When operation system boots, kernel is first part of OS to load in main memory.  Kernel remains in main memory for entire duration of computer session. The kernel code is usually loaded in to protected area of memory.  Kernel performs its task like executing processes and handling interrupts in kernel space.  User performs its task in user area of memory.  This memory separation is made in order to prevent user data and kernel data from interfering with each other.  Kernel does not interact directly with user, but it interacts using SHELL and other programs and hardware. Kernel includes:- 1. Scheduler: It allocates the Kernel’s processing time to various processes. 2. Supervisor: It grants permission to use computer system resources to each process. 3. Interrupt handler: It handles all requests from the various hardware devices which compete for kernel services. 4. Memory manager: allocates space in memory for all users of kernel service. • Kernel provides services for process management, file management, I/O management, and memory management. • System calls are used to provide these type of services. v. System Call:  System call is the programmatic way in which a computer program/user application requests a service from the kernel of the operating system on which it is executed.  Application program is just a user-process. Due to security reasons, user applications are not given access to privileged resources (the ones controlled by OS).  When they need to do any I/O or have some more memory or spawn a process or wait for signal/interrupt, it requests operating system to facilitate all these. This request is made through System Call.  System calls are also called software-interrupts. vi. Starting an Operating System(Booting):
  • 8.  Power on Switch sends electricity to the motherboard on a wire called the Voltage Good line.  If the power supply is good, then the BIOS (Basic Input/output System) chip takes over.  In Real Mode, CPU is only capable of using approximately 1 MB of memory built into the motherboard.  The BIOS will do a Power-On Self-Test (POST) to make sure that all hardware are working. vii. BIOS:  BIOS firmware was stored in a ROM/EPROM (Erasable Programmable Read-Only Memory) chip known as firmware on the PC motherboard.  BIOS can be accessed during the initial phases of the boot procedure by pressing del, F2 or F10.  Finally, the firmware code cycles through all storage devices and looks for a boot-loader. (usually located in first sector of a disk which is 512 bytes)  If the boot-loader is found, then the firmware hands over control of the computer to it. 3. FUNCTIONS IN OPERATING SYSTEM: 1. Process Management:  A process is a program in execution.  A process needs certain resources, including CPU time, memory, files, and I/O devices to accomplish its task.  Simultaneous execution leads to multiple processes. Hence creation, execution and termination of a process are the most basic functionality of an OS  If processes are dependent, than they may try to share same resources. Thus task of process synchronization comes to the picture.  If processes are independent, than a due care needs to be taken to avoid their overlapping in memory area.  Based on priority, it is important to allow more important processes to execute first than others.
  • 9. 2. Memory management:  Memory is a large array of words or bytes, each with its own address.  It is a repository of quickly accessible data shared by the CPU and I/O devices.  Main memory is a volatile storage device. When the computer made turn off everything stored in RAM will be erased automatically.  In addition to the physical RAM installed in your computer, most modern operating systems allow your computer to use a virtual memory system. Virtual memory allows your computer to use part of a permanent storage device (such as a hard disk) as extra memory.  The operating system is responsible for the following activities in connections with memory management: o Keep track of which parts of memory are currently being used and by whom. o Decide which processes to load when memory space becomes available. o Allocate and de-allocate memory space as needed. 3. File management:  A file is a collection of related information defined by its creator.  File systems provide the conventions for the encoding, storage and management of data on a storage device such as a hard disk. o FAT12 (floppy disks) o FAT16 (DOS and older versions of Windows) o FAT32 (older versions of Windows) o NTFS (newer versions of Windows) o EXT3 (Unix/Linux) o HFS+ (Max OS X)  The operating system is responsible for the following activities in connections with file management: o File creation and deletion. o Directory creation and deletion. o Support of primitives for manipulating files and directories. o Mapping files onto secondary storage. o File backup on stable (nonvolatile) storage media. 4. I/O management:  Device controllers are components on the motherboard (or on expansion cards) that act as an interface between the CPU and the actual device.  Device drivers, which are the operating system software components that interact with the devices controllers.  A special device (inside CPU) called the Interrupt Controller handles the task of receiving interrupt requests and prioritizes them to be forwarded to the processor.  Deadlocks can occur when two (or more) processes have control of different I/O resources that are needed by the other processes, and they are unwilling to give up control of the device. 5. Security and protection:  The operating system uses password protection to protect user data and similar other techniques.  It also prevents unauthorized access to programs and user data by assigning access right permission to files and directories.
  • 10.  The owners of information stored in a multiuser or networked computer system may want to control use of that information, concurrent processes should not interfere with each other. 6. User Interface: • A user interface (UI) controls how you enter data and instructions and how information is displayed on the screen • There are two types of user interfaces a. Command Line Interface b. Graphical user Interface a. Command-line interface: In a command-line interface, a user types commands represented by short keywords or abbreviations or presses special keys on the keyboard to enter data and instructions. b. Graphical user Interface: With a graphical user interface (GUI), you interact with menus and visual images.
  • 11. 4. OPERATING SYSTEM STRUCTURES:  An operating system is a design that enables user application programs to communicate with the hardware of the machine.  The operating system should be built with the utmost care because it is such a complicated structure and should be simple to use and modify.  Partially developing the operating system is a simple approach to accomplish this.  Each of these components needs to have distinct inputs, outputs, and functionalities. It also defines the operating system structure. o Simple Structure o Monolithic Structure o Layered Approach Structure o Micro-Kernel Structure o Exo-Kernel Structure o Virtual Machines 1. Simple structure: It is the most straightforward operating system structure, but it lacks definition and is only appropriate for usage with tiny and restricted systems. Since the interfaces and degrees of functionality in this structure are clearly defined, programs are able to access I/O routines, which may result in unauthorized access to I/O procedures. This organizational structure is used by the MS-DOS operating system: o There are four layers that make up the MS-DOS operating system, and each has its own set of features. o These layers include ROM BIOS device drivers, MS-DOS device drivers, application programs, and system programs. o The MS-DOS operating system benefits from layering because each level can be defined independently and, when necessary, can interact with one another. o If the system is built in layers, it will be simpler to design, manage, and update. Because of this, simple structures can be used to build constrained systems that are less complex. o When a user program fails, the operating system as whole crashes. o Because MS-DOS systems have a low level of abstraction, programs and I/O procedures are visible to end users, giving them the potential for unwanted access.
  • 12. The following figure illustrates layering in simple structure: Advantages of Simple Structure: o Because there are only a few interfaces and levels, it is simple to develop. o Because there are fewer layers between the hardware and the applications, it offers superior performance. Disadvantages of Simple Structure: o The entire operating system breaks if just one user program malfunctions. o Since the layers are interconnected, and in communication with one another, there is no abstraction or data hiding. o The operating system's operations are accessible to layers, which can result in data tampering and system failure. 2. Monolithic structure:  The monolithic operating system controls all aspects of the operating system's operation, including file management, memory management, device management, and operational operations.  The core of an operating system for computers is called the kernel (OS). All other System components are provided with fundamental services by the kernel.  The operating system and the hardware use it as their main interface.  When an operating system is built into a single piece of hardware, such as a keyboard or mouse, the kernel can directly access all of its resources.  The monolithic operating system is often referred to as the monolithic kernel. Multiple programming techniques such as batch processing and time-sharing increase a processor's usability.  Working on top of the operating system and under complete command of all hardware, the monolithic kernel performs the role of a virtual computer.
  • 13.  This is an old operating system that was used in banks to carry out simple tasks like batch processing and time-sharing, which allows numerous users at different terminals to access the Operating System. The following diagram represents the monolithic structure: Advantages of Monolithic Structure: o Because layering is unnecessary and the kernel alone is responsible for managing all operations, it is easy to design and execute. o Due to the fact that functions like memory management, file management, process scheduling, etc., are implemented in the same address area, the monolithic kernel runs rather quickly when compared to other systems. Utilizing the same address speeds up and reduces the time required for address allocation for new processes. Disadvantages of Monolithic Structure: o The monolithic kernel's services are interconnected in address space and have an impact on one another, so if any of them malfunctions, the entire system does as well. o It is not adaptable. Therefore, launching a new service is difficult. 3. Layered structure:  The OS is separated into layers or levels in this kind of arrangement. Layer 0 (the lowest layer) contains the hardware, and layer 1 (the highest layer) contains the user interface (layer N).  These layers are organized hierarchically, with the top-level layers making use of the capabilities of the lower-level ones.  The functionalities of each layer are separated in this method, and abstraction is also an option. Because layered structures are hierarchical, debugging is simpler, therefore all lower-level layers
  • 14. are debugged before the upper layer is examined. As a result, the present layer alone has to be reviewed since all the lower layers have already been examined.  The image below shows how OS is organized into layers: Advantages of Layered Structure: o Work duties are separated since each layer has its own functionality, and there is some amount of abstraction. o Debugging is simpler because the lower layers are examined first, followed by the top layers. Disadvantages of Layered Structure: o Performance is compromised in layered structures due to layering. o Construction of the layers requires careful design because upper layers only make use of lower layers' capabilities. 4. Micro-kernel structure:  The operating system is created using a micro-kernel framework that strips the kernel of any unnecessary parts.  Systems and user applications are used to implement these optional kernel components.  So, Micro-Kernels is the name given to these systems that have been developed.  Each Micro-Kernel is created separately and is kept apart from the others. As a result, the system is now more trustworthy and secure.  If one Micro-Kernel malfunctions, the remaining operating system is unaffected and continues to function normally.
  • 15. The image below shows Micro-Kernel Operating System Structure: Advantages of Micro-Kernel Structure: o It enables portability of the operating system across platforms. o Due to the isolation of each Micro-Kernel, it is reliable and secure. o The reduced size of Micro-Kernels allows for successful testing. o The remaining operating system remains unaffected and keeps running properly even if a component or Micro-Kernel fails. Disadvantages of Micro-Kernel Structure: o The performance of the system is decreased by increased inter-module communication. o The construction of a system is complicated. 5. Exo-kernel:  An operating system called Exokernel was created at MIT with the goal of offering application- level management of hardware resources.  The exokernel architecture's goal is to enable application-specific customization by separating resource management from protection. Exokernel size tends to be minimal due to its limited operability.  Because the OS sits between the programs and the actual hardware, it will always have an effect on the functionality, performance, and breadth of the apps that are developed on it.  By rejecting the idea that an operating system must offer abstractions upon which to base applications, the exokernel operating system makes an effort to solve this issue.  The goal is to give developers as few restriction on the use of abstractions as possible while yet allowing them the freedom to do so when necessary. Because of the way the exokernel architecture is designed, a single tiny kernel is responsible for moving all hardware abstractions into unreliable libraries known as library operating systems.
  • 16.  Exokernels differ from micro- and monolithic kernels in that their primary objective is to prevent forced abstraction. Exokernel operating systems have a number of features, including: o Enhanced application control support. o Splits management and security apart. o A secure transfer of abstractions is made to an unreliable library operating system. o Brings up a low-level interface. o Operating systems for libraries provide compatibility and portability. Advantages of Exokernel Structure: o Application performance is enhanced by it. o Accurate resource allocation and revocation enable more effective utilisation of hardware resources. o New operating systems can be tested and developed more easily. o Every user-space program is permitted to utilise its own customised memory management. Disadvantages of Exokernel Structure: o A decline in consistency o Exokernel interfaces have a complex architecture. 6. Virtual Machines (VM’s)  The hardware of our personal computer, including the CPU, disc drives, RAM, and NIC (Network Interface Card), is abstracted by a virtual machine into a variety of various execution contexts based on our needs, giving us the impression that each execution environment is a separate computer.  A virtual box is an example of it.  Using CPU scheduling and virtual memory techniques, an operating system allows us to execute multiple processes simultaneously while giving the impression that each one is using a separate processor and virtual memory.  System calls and a file system are examples of extra functionalities that a process can have that the hardware is unable to give.  Instead of offering these extra features, the virtual machine method just offers an interface that is similar to that of the most fundamental hardware.  A virtual duplicate of the computer system underneath is made available to each process.  We can develop a virtual machine for a variety of reasons, all of which are fundamentally connected to the capacity to share the same underlying hardware while concurrently supporting various execution environments, i.e., various operating systems.
  • 17.  Disk systems are the fundamental problem with the virtual machine technique. If the actual machine only has three-disc drives but needs to host seven virtual machines, let's imagine that.  It is obvious that it is impossible to assign a disc drive to every virtual machine because the program that creates virtual machines would require a sizable amount of disc space in order to offer virtual memory and spooling.  The provision of virtual discs is the solution. The result is that users get their own virtual machines. They can then use any of the operating systems or software programs that are installed on the machine below.  Virtual machine software is concerned with programming numerous virtual machines simultaneously into a physical machine; it is not required to take into account any user-support software.  With this configuration, it may be possible to break the challenge of building an interactive system for several users into two manageable chunks. Advantages of Virtual Machines: o Due to total isolation between each virtual machine and every other virtual machine, there are no issues with security. o A virtual machine may offer an architecture for the instruction set that is different from that of actual computers. o Simple availability, accessibility, and recovery convenience. Disadvantages of Virtual Machines: o Depending on the workload, operating numerous virtual machines simultaneously on a host computer may have an adverse effect on one of them. o When it comes to hardware access, virtual computers are less effective than physical ones. 5. TYPES OF OPERATING SYSTEM: An operating system is a well-organized collection of programs that manages the computer hardware. It is a type of system software that is responsible for the smooth functioning of the computer system. 1. Batch Operating System 2. Multiprogramming Operating System 3. Time-Sharing OS 4. Multiprocessing OS 5. Distributed OS 6. Network OS 7. Real Time OS
  • 18. 8. Embedded OS 1. Batch Operating System:  The users of this type of operating system does not interact with the computer directly.  Each user prepares his job on an off-line device like punch cards and submits it to the computer operator  There is an operator which takes similar jobs having the same requirement and group them into batches. Advantages of Batch Operating System:  Processors of the batch systems know how long the job would be when it is in queue  Multiple users can share the batch systems  The idle time for the batch system is very less  It is easy to manage large work repeatedly in batch systems Disadvantages of Batch Operating System:  The computer operators should be well known with batch systems  Batch systems are hard to debug  It is sometimes costly  The other jobs will have to wait for an unknown time if any job fails Examples of Batch based Operating System: IBM's MVS. 2. Multiprogramming Operating System:  This type of OS is used to execute more than one jobs simultaneously by a single processor.  It increases CPU utilization by organizing jobs so that the CPU always has one job to execute.
  • 19.  Multiprogramming operating systems use the mechanism of job scheduling and CPU scheduling. 3. Time-Sharing OS:  Each task is given some time to execute so that all the tasks work smoothly.  These systems are also known as Multi-tasking Systems.  The task can be from a single user or different users also.  The time that each task gets to execute is called quantum.  After this time interval is over OS switches over to the next task. Advantages of Time-Sharing OS:  Each task gets an equal opportunity  Fewer chances of duplication of software  CPU idle time can be reduced Disadvantages of Time-Sharing OS:  Reliability problem  One must have to take care of the security and integrity of user programs and data  Data communication problem Examples of Time-Sharing Oss: Multics, UNIX, etc.
  • 20. 4. Multiprocessing OS:  Multiprocessor operating systems are also known as parallel OS or tightly coupled OS.  Such operating systems have more than one processor in close communication that sharing the computer bus, the clock and sometimes memory and peripheral devices.  It executes multiple jobs at the same time and makes the processing faster.  It supports large physical address space and larger virtual address space.  If one processor fails then other processor should retrieve the interrupted process state so execution of process can continue.  Inter-processes communication mechanism is provided and implemented in hardware. 5. Distributed OS:  Various autonomous interconnected computers communicate with each other using a shared communication network.  Independent systems possess their own memory unit and CPU.  These are referred to as loosely coupled systems.  Examples:- Locus, DYSEAC 6. Network OS:  These systems run on a server and provide the capability to manage data, users, groups, security, applications, and other networking functions.  These types of operating systems allow shared access of files, printers, security, applications, and other networking functions over a small private network.  The “other" computers arc called client computers, and each computer that connects to a network server must be running client software designed to request a specific service.  Popularly known as tightly coupled systems. Advantages of Network Operating System:  Highly stable centralized servers
  • 21.  Security concerns are handled through servers  New technologies and hardware up-gradation are easily integrated into the system  Server access is possible remotely from different locations and types of systems Disadvantages of Network Operating System:  Servers are costly  User has to depend on a central location for most operations  Maintenance and updates are required regularly Examples of Network Operating System are:  Microsoft Windows Server 2003/2008/2012, UNIX, Linux, Mac OS X, Novell NetWare, and BSD, etc. 7. Real Time OS:  These types of OSs serve real-time systems.  The time interval required to process and respond to inputs is very small.  This time interval is called response time.  Real-time systems are used when there are time requirements that are very strict like o missile systems, o air traffic control systems, o Robots, etc. 8. Embedded OS:  An embedded operating system is one that is built into the circuitry of an electronic device.  Embedded operating systems are now found in automobiles, bar-code scanners, cell phones, medical equipment, and personal digital assistants.  The most popular embedded operating systems for consumer products, such as PDAs, include the following: o Windows XP Embedded o Windows CE .NET:- it supports wireless communications, multimedia and Web browsing. It also allows for the use of smaller versions of Microsoft Word, Excel, and Outlook. o Palm OS: - It is the standard operating system for Palm-brand PDAs as well as other proprietary handheld devices. o Symbian: - OS found in “smart” cell phones from Nokia and Sony Ericsson.
  • 22. 6. SYSTEM COMPONENTS:  There are various components of an Operating System to perform well defined tasks.  Though most of the Operating Systems differ in structure but logically they have similar components.  Each component must be a well-defined portion of a system that appropriately describes the functions, inputs, and outputs. There are following 8-components of an Operating System: 1. Process Management 2. I/O Device Management 3. File Management 4. Network Management 5. Main Memory Management 6. Secondary Storage Management 7. Security Management 8. Command Interpreter System Following section explains all the above components in more detail: i. Process Management  A process is program or a fraction of a program that is loaded in main memory.  A process needs certain resources including CPU time, Memory, Files, and I/O devices to accomplish its task.  The process management component manages the multiple processes running simultaneously on the Operating System.  A program in running state is called a process. The operating system is responsible for the following activities in connection with process management:  Create, load, execute, suspend, resume, and terminate processes.  Switch system among multiple processes in main memory.  Provides communication mechanisms so that processes can communicate with each other’s  Provides synchronization mechanisms to control concurrent access to shared data to keep shared data consistent.  Allocate/de-allocate resources properly to prevent or avoid deadlock situation. ii. I/O Device Management  One of the purposes of an operating system is to hide the peculiarities of specific hardware devices from the user.  I/O Device Management provides an abstract level of H/W devices and keep the details from applications to ensure proper use of devices, to prevent errors, and to provide users with convenient and efficient programming environment. Following are the tasks of I/O Device Management component:
  • 23.  Hide the details of H/W devices  Manage main memory for the devices using cache, buffer, and spooling  Maintain and provide custom drivers for each device. iii. File Management  File management is one of the most visible services of an operating system.  Computers can store information in several different physical forms; magnetic tape, disk, and drum are the most common forms.  A file is defined as a set of correlated information and it is defined by the creator of the file. Mostly files represent data, source and object forms, and programs.  Data files can be of any type like alphabetic, numeric, and alphanumeric.  A files is a sequence of bits, bytes, lines or records whose meaning is defined by its creator and user.  The operating system implements the abstract concept of the file by managing mass storage device, such as types and disks.  Also files are normally organized into directories to ease their use. These directories may contain files and other directories and so on. The operating system is responsible for the following activities in connection with file management:  File creation and deletion  Directory creation and deletion  The support of primitives for manipulating files and directories  Mapping files onto secondary storage  File backup on stable (nonvolatile) storage media iv. Network Management  The definition of network management is often broad, as network management involves several different components.  Network management is the process of managing and administering a computer network.  A computer network is a collection of various types of computers connected with each other.  Network management comprises fault analysis, maintaining the quality of service, provisioning of networks, and performance management.  Network management is the process of keeping your network healthy for an efficient communication between different computers. Following are the features of network management:  Network administration  Network maintenance  Network operation  Network provisioning  Network security
  • 24. v. Main Memory Management  Memory is a large array of words or bytes, each with its own address. It is a repository of quickly accessible data shared by the CPU and I/O devices.  Main memory is a volatile storage device which means it loses its contents in the case of system failure or as soon as system power goes down.  The main motivation behind Memory Management is to maximize memory utilization on the computer system. The operating system is responsible for the following activities in connections with memory management:  Keep track of which parts of memory are currently being used and by whom.  Decide which processes to load when memory space becomes available.  Allocate and deallocate memory space as needed. vi. Secondary Storage Management  The main purpose of a computer system is to execute programs. These programs, together with the data they access, must be in main memory during execution.  Since the main memory is too small to permanently accommodate all data and program, the computer system must provide secondary storage to backup main memory.  Most modern computer systems use disks as the principle on-line storage medium, for both programs and data.  Most programs, like compilers, assemblers, sort routines, editors, formatters, and so on, are stored on the disk until loaded into memory, and then use the disk as both the source and destination of their processing. The operating system is responsible for the following activities in connection with disk management:  Free space management  Storage allocation  Disk scheduling vii. Security Management  The operating system is primarily responsible for all task and activities happen in the computer system.  The various processes in an operating system must be protected from each other’s activities.  For that purpose, various mechanisms which can be used to ensure that the files, memory segment, CPU and other resources can be operated on only by those processes that have gained proper authorization from the operating system.  Security Management refers to a mechanism for controlling the access of programs, processes, or users to the resources defined by a computer controls to be imposed, together with some means of enforcement.  For example, memory addressing hardware ensure that a process can only execute within its own address space.  The timer ensure that no process can gain control of the CPU without relinquishing it. Finally, no process is allowed to do its own I/O, to protect the integrity of the various peripheral devices.
  • 25. viii. Command Interpreter System  One of the most important component of an operating system is its command interpreter.  The command interpreter is the primary interface between the user and the rest of the system.  Command Interpreter System executes a user command by calling one or more number of underlying system programs or system calls.  Command Interpreter System allows human users to interact with the Operating System and provides convenient programming environment to the users.  Many commands are given to the operating system by control statements.  A program which reads and interprets control statements is automatically executed.  This program is called the shell and few examples are Windows DOS command window, Bash of Unix/Linux or C-Shell of Unix/Linux. 7. OPERATING SYSTEM SERVICES: An Operating System provides services to both the users and to the programs.  It provides programs an environment to execute.  It provides users the services to execute the programs in a convenient manner. Following are a few common services provided by an operating system −  Program execution  I/O operations  File System manipulation  Communication  Error Detection  Resource Allocation  Protection i. Program execution  Operating systems handle many kinds of activities from user programs to system programs like printer spooler, name servers, file server, etc. Each of these activities is encapsulated as a process.  A process includes the complete execution context (code to execute, data to manipulate, registers, OS resources in use). Following are the major activities of an operating system with respect to program management −  Loads a program into memory.  Executes the program.  Handles program's execution.  Provides a mechanism for process synchronization.  Provides a mechanism for process communication.  Provides a mechanism for deadlock handling.
  • 26. ii. I/O Operation  An I/O subsystem comprises of I/O devices and their corresponding driver software. Drivers hide the peculiarities of specific hardware devices from the users. An Operating System manages the communication between user and device drivers.  I/O operation means read or write operation with any file or any specific I/O device.  Operating system provides the access to the required I/O device when required. iii. File system manipulation  A file represents a collection of related information. Computers can store files on the disk (secondary storage), for long-term storage purpose.  Examples of storage media include magnetic tape, magnetic disk and optical disk drives like CD, DVD.  Each of these media has its own properties like speed, capacity, and data transfer rate and data access methods.  A file system is normally organized into directories for easy navigation and usage.  These directories may contain files and other directions. Following are the major activities of an operating system with respect to file management −  Program needs to read a file or write a file.  The operating system gives the permission to the program for operation on file.  Permission varies from read-only, read-write, denied and so on.  Operating System provides an interface to the user to create/delete files.  Operating System provides an interface to the user to create/delete directories.  Operating System provides an interface to create the backup of file system. iv. Communication  In case of distributed systems which are a collection of processors that do not share memory, peripheral devices, or a clock, the operating system manages communications between all the processes.  Multiple processes communicate with one another through communication lines in the network.  The OS handles routing and connection strategies, and the problems of contention and security. Following are the major activities of an operating system with respect to communication −  Two processes often require data to be transferred between them  Both the processes can be on one computer or on different computers, but are connected through a computer network.  Communication may be implemented by two methods, either by Shared Memory or by Message Passing. v. Error handling  Errors can occur anytime and anywhere.  An error may occur in CPU, in I/O devices or in the memory hardware.
  • 27. Following are the major activities of an operating system with respect to error handling −  The OS constantly checks for possible errors.  The OS takes an appropriate action to ensure correct and consistent computing. vi. Resource Management  In case of multi-user or multi-tasking environment, resources such as main memory, CPU cycles and files storage are to be allocated to each user or job. Following are the major activities of an operating system with respect to resource management −  The OS manages all kinds of resources using schedulers.  CPU scheduling algorithms are used for better utilization of CPU. vii. Protection  Considering a computer system having multiple users and concurrent execution of multiple processes, the various processes must be protected from each other's activities.  Protection refers to a mechanism or a way to control the access of programs, processes, or users to the resources defined by a computer system. Following are the major activities of an operating system with respect to protection −  The OS ensures that all access to system resources is controlled.  The OS ensures that external I/O devices are protected from invalid access attempts.  The OS provides authentication features for each user by means of passwords. 8. SYSTEM CALLS:  A system call is a way for a user program to interface with the operating system.  The program requests several services, and the OS responds by invoking a series of system calls to satisfy the request.  A system call can be written in assembly language or a high-level language like C or Pascal.  System calls are predefined functions that the operating system may directly invoke if a high-level language is used. What is system Call? • A system call is a method for a computer program to request a service from the kernel of the operating system on which it is running. • A system call is a method of interacting with the operating system via programs. • A system call is a request from computer software to an operating system's kernel. • The Application Program Interface (API) connects the operating system's functions to user programs. • It acts as a link between the operating system and a process, allowing user-level programs to request operating system services. • The kernel system can only be accessed using system calls. • System calls are required for any programs that use resources. How are system calls made? • When a computer software needs to access the operating system's kernel, it makes a system call. • The system call uses an API to expose the operating system's services to user programs. • It is the only method to access the kernel system.
  • 28. • All programs or processes that require resources for execution must use system calls, as they serve as an interface between the operating system and user programs. Below are some examples of how a system call varies from a user function. • A system call function may create and use kernel processes to execute the asynchronous processing. • A system call has greater authority than a standard subroutine. A system call with kernel- mode privilege executes in the kernel protection domain. • System calls are not permitted to use shared libraries or any symbols that are not present in the kernel protection domain. • The code and data for system calls are stored in global kernel memory. Example of System Calls: Example of Standard API:
  • 29. Why do you need system calls in Operating System? There are various situations where you must require system calls in the operating system. Following of the situations are as follows: • It is must require when a file system wants to create or delete a file. • Network connections require the system calls to sending and receiving data packets. • If you want to read or write a file, you need to system calls. • If you want to access hardware devices, including a printer, scanner, you need a system call. • System calls are used to create and manage new processes. How System call works? • Typically, a number associated with each system call • System-call interface maintains a table indexed according to these numbers • The system call interface invokes the intended system call in OS kernel and returns status of the system call and any return values • The caller need know nothing about how the system call is implemented • Just needs to obey API and understand what OS will do as a result call • Most details of OS interface hidden from programmer by API • Managed by run-time support library (set of functions built into libraries included with compiler) API – System Call – OS Relationship:
  • 30. System Call Parameter Passing: • Often, more information is required than simply identity of desired system call • Exact type and amount of information vary according to OS and call • Three general methods used to pass parameters to the OS • Simplest: pass the parameters in registers • In some cases, may be more parameters than registers • Parameters stored in a block, or table, in memory, and address of block passed as a parameter in a register • This approach taken by Linux and Solaris • Parameters placed, or pushed, onto the stack by the program and popped off the stack by the operating system • Block and stack methods do not limit the number or length of parameters being passed Parameter Passing via Table: TYPES OF SYSTEM CALLS:
  • 31. 1) Process Control This system calls perform the task of process creation, process termination, etc. Functions:  End and Abort  Load and Execute  Create Process and Terminate Process  Wait and Signal Event  Allocate and free memory 2) File Management File management system calls handle file manipulation jobs like creating a file, reading, and writing, etc. Functions:  Create a file  Delete file  Open and close file  Read, write, and reposition  Get and set file attributes 3) Device Management Device management does the job of device manipulation like reading from device buffers, writing into device buffers, etc. Functions:  Request and release device  Logically attach/ detach devices  Get and Set device attributes 4) Information Maintenance It handles information and its transfer between the OS and the user program. Functions:  Get or set time and date  Get process and device attributes 5) Communication: These types of system calls are specially used for interprocess communications. Functions:  Create, delete communications connections  Send, receive message  Help OS to transfer status information  Attach or detach remote devices
  • 32. Example of System Calls in Windows and UNIX: IMPORTANT SYSTEM CALLS USED IN OS: wait()  In some systems, a process needs to wait for another process to complete its execution.  This type of situation occurs when a parent process creates a child process, and the execution of the parent process remains suspended until its child process executes.  The suspension of the parent process automatically occurs with a wait() system call. When the child process ends execution, the control moves back to the parent process. fork()  Processes use this system call to create processes that are a copy of themselves. With the help of this system Call parent process creates a child process, and the execution of the parent process will be suspended till the child process executes.
  • 33. exec()  This system call runs when an executable file in the context of an already running process that replaces the older executable file. However, the original process identifier remains as a new process is not built, but stack, data, head, data, etc. are replaced by the new process. kill():  The kill() system call is used by OS to send a termination signal to a process that urges the process to exit. However, a kill system call does not necessarily mean killing the process and can have various meanings. exit():  The exit() system call is used to terminate program execution. Specially in the multi-threaded environment, this call defines that the thread execution is complete. The OS reclaims resources that were used by the process after the use of exit() system call. Standard C Library Example: • C program invoking printf() library call, which calls write() system call.
  • 34. SYSTEM PROGRAM: • System programs provide a convenient environment for program development and execution. • They can be divided into: • File manipulation • Status information sometimes stored in a File modification • Programming language support • Program loading and execution • Communications • Background services • Application programs • Most users’ view of the operation system is defined by system programs, not the actual system calls • Provide a convenient environment for program development and execution • Some of them are simply user interfaces to system calls; others are considerably more complex. • File management - Create, delete, copy, rename, print, dump, list, and generally manipulate files and directories. • Status information • Some ask the system for info - date, time, amount of available memory, disk space, and number of users. • Others provide detailed performance, logging, and debugging information • Typically, these programs format and print the output to the terminal or other output devices. • Some systems implement a registry - used to store and retrieve configuration information. • File modification
  • 35. • Text editors to create and modify files • Special commands to search contents of files or perform transformations of the text • Programming-language support - Compilers, assemblers, debuggers and interpreters sometimes provided • Program loading and execution- Absolute loaders, relocatable loaders, linkage editors, and overlay-loaders, debugging systems for higher-level and machine language • Communications - Provide the mechanism for creating virtual connections among processes, users, and computer systems • Allow users to send messages to one another’s screens, browse web pages, send electronic-mail messages, and log in remotely, transfer files from one machine to another. • Background Services • Launch at boot time • Some for system startup, then terminate • Some from system boot to shutdown • Provide facilities like disk checking, process scheduling, error logging, printing • Run in user context not kernel context • Known as services, subsystems, daemons • Application programs • Don’t pertain to system • Run by users • Not typically considered part of OS • Launched by command line, mouse click, finger poke 9. OPERATING SYSTEM PROPERTIES: Following are the different properties of an Operating System.  Batch processing  Multitasking  Multiprogramming  Interactivity  Real Time System  Distributed Environment  Spooling i. Batch processing  Batch processing is a technique in which an Operating System collects the programs and data together in a batch before processing starts.  An operating system does the following activities related to batch processing −  The OS defines a job which has predefined sequence of commands, programs and data as a single unit.  The OS keeps a number a jobs in memory and executes them without any manual information.  Jobs are processed in the order of submission, i.e., first come first served fashion.  When a job completes its execution, its memory is released and the output for the job gets copied into an output spool for later printing or processing.
  • 36. Advantages  Batch processing takes much of the work of the operator to the computer.  Increased performance as a new job get started as soon as the previous job is finished, without any manual intervention. Disadvantages  Difficult to debug program.  A job could enter an infinite loop.  Due to lack of protection scheme, one batch job can affect pending jobs. ii. Multitasking  Multitasking is when multiple jobs are executed by the CPU simultaneously by switching between them. Switches occur so frequently that the users may interact with each program while it is running. An OS does the following activities related to multitasking −  The user gives instructions to the operating system or to a program directly, and receives an immediate response.  The OS handles multitasking in the way that it can handle multiple operations/executes multiple programs at a time.  Multitasking Operating Systems are also known as Time-sharing systems.  These Operating Systems were developed to provide interactive use of a computer system at a reasonable cost.  A time-shared operating system uses the concept of CPU scheduling and multiprogramming to provide each user with a small portion of a time-shared CPU.  Each user has at least one separate program in memory.
  • 37.  A program that is loaded into memory and is executing is commonly referred to as a process.  When a process executes, it typically executes for only a very short time before it either finishes or needs to perform I/O.  Since interactive I/O typically runs at slower speeds, it may take a long time to complete. During this time, a CPU can be utilized by another process.  The operating system allows the users to share the computer simultaneously. Since each action or command in a time-shared system tends to be short, only a little CPU time is needed for each user.  As the system switches CPU rapidly from one user/program to the next, each user is given the impression that he/she has his/her own CPU, whereas actually one CPU is being shared among many users. iii. Multiprogramming  Sharing the processor, when two or more programs reside in memory at the same time, is referred as multiprogramming.  Multiprogramming assumes a single shared processor.  Multiprogramming increases CPU utilization by organizing jobs so that the CPU always has one to execute. The following figure shows the memory layout for a multiprogramming system.
  • 38. An OS does the following activities related to multiprogramming.  The operating system keeps several jobs in memory at a time.  This set of jobs is a subset of the jobs kept in the job pool.  The operating system picks and begins to execute one of the jobs in the memory.  Multiprogramming operating systems monitor the state of all active programs and system resources using memory management programs to ensure that the CPU is never idle, unless there are no jobs to process. Advantages  High and efficient CPU utilization.  User feels that many programs are allotted CPU almost simultaneously. Disadvantages  CPU scheduling is required.  To accommodate many jobs in memory, memory management is required. iv. Interactivity  Interactivity refers to the ability of users to interact with a computer system. An Operating system does the following activities related to interactivity −  Provides the user an interface to interact with the system.  Manages input devices to take inputs from the user. For example, keyboard.  Manages output devices to show outputs to the user. For example, Monitor.  The response time of the OS needs to be short, since the user submits and waits for the result. v. Real Time System Real-time systems are usually dedicated, embedded systems. An operating system does the following activities related to real-time system activity.  In such systems, Operating Systems typically read from and react to sensor data.  The Operating system must guarantee response to events within fixed periods of time to ensure correct performance. vi. Distributed Environment  A distributed environment refers to multiple independent CPUs or processors in a computer system. An operating system does the following activities related to distributed environment −  The OS distributes computation logics among several physical processors.  The processors do not share memory or a clock. Instead, each processor has its own local memory.  The OS manages the communications between the processors. They communicate with each other through various communication lines. vii. Spooling  Spooling is an acronym for simultaneous peripheral operations on line.  Spooling refers to putting data of various I/O jobs in a buffer.  This buffer is a special area in memory or hard disk which is accessible to I/O devices. An operating system does the following activities related to distributed environment −  Handles I/O device data spooling as devices have different data access rates.
  • 39.  Maintains the spooling buffer which provides a waiting station where data can rest while the slower device catches up.  Maintains parallel computation because of spooling process as a computer can perform I/O in parallel fashion.  It becomes possible to have the computer read data from a tape, write data to disk and to write out to a tape printer while it is doing its computing task. Advantages  The spooling operation uses a disk as a very large buffer.  Spooling is capable of overlapping I/O operation for one job with processor operations for another job.