SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Operating Systems
Introduction to
Operating System
(OS)
Prof. Neha Tadam, CSE
What is an Operating System (1)?
• A modern computer consists of:
• One or more processors
• Main memory
• Secondary Storage
• Various input/output devices
• Managing all these varied components requires a layer of
software – the
Operating System (OS).
What is an Operating System (2)?
 An Operating System is a System program that acts as an -
• intermediary/interface between a user of a computer and the
computer hardware.
• Resource Allocator
• Manages all resources
• Decides between conflicting requests for efficient and fair resource use
• Platform – creates an environment in which application programs run.
• Control program - Controls execution of programs to prevent errors
and improper use of the computer
 OS goals:
• Control/execute user/application programs.
• Make the computer system convenient to use.
• Ease the solving of user problems.
• Use the computer hardware in an efficient manner.
 OS goals:
• Control/execute user/application programs.
• Make the computer system convenient to use.
• Ease the solving of user problems.
• Use the computer hardware in an efficient manner.
A. Frank - P. Weisberg
Where does the OS fit in?
Computer System Structure
 Computer system can be divided into four components:
• Hardware – provides basic computing resources
CPU, memory, I/O devices
• Operating system
Controls and coordinates use of hardware among various
applications and users
• Application programs – define the ways in which the system
resources are used to solve the computing problems of the
users
Word processors, compilers, web browsers, database
systems, video games
• Users
People, machines, other computers
Services provided by an OS
• Facilities for program creation
• editors, compilers, linkers, debuggers, etc.
• Program execution
• loading in memory, I/O and file initialization.
• Access to I/O and files
• deals with the specifics of I/O and file formats.
• System access
• resolves conflicts for resource contention.
• protection in access to resources and data.
Why are Operating Systems Important?
Important to understand and know how to correctly
use when writing user applications.
Large and complex systems that have a high
economic impact and result in interesting problems
of management.
Few actually involved in OS design and
implementation but nevertheless many general
techniques to be learned and applied.
Combines concepts from many other areas of
Computer Science: Architecture, Languages,
Data Structures, Algorithms, etc.
COURSE SYLLABUS
 Introduction to OS
 Process Scheduling
 Process Synchronization
 Memory Management
 Unit Title: File System
 Unit Title: I/O System
Evolution of Operating System
• The evolution of operating systems
went through seven major phases
• Six of them significantly changed the
ways in which users accessed
computers through the open shop,
batch processing, multiprogramming,
timesharing, personal computing, and
distributed systems.
• In the seventh phase the foundations
of concurrent programming were
developed and demonstrated in
model operating systems .
Open
Shop
The 1940's - First Generations
The 1950's - Second Generation
The 1960's - Third Generation
Fourth Generation
Evolution of Operating System
 Open Shop (Idea of OS)
• The story of operating systems in 1954 when computers had no operating systems
but were operated manually by their users.
• Each user was allocated a minimum 15-minute slot , of which time he usually
spent 10 minutes in setting up the equipment to do his computation . . . By the
time he got his calculation going, he may have had only 5 minutes or less of actual
computation completed-wasting two thirds of his time slot.
• Example: IBM 701 Open shop
Evolution of Operating System
 Serial Processing OS
• Programming in 1's and 0's (machine language) was quite
common for early computer systems.
• They were now asked to prepare their programs and data on
punched cards and submit them to a computing center for
execution.
• Instruction and data used to be fed into the computer through
card reader using Punch Cards.
• Job execution was done in FIFO fashion.
• Job was given to Computer using Punch Cards then later on
Magnetic Tapes were also used.
Evolution of Operating System
 Batch OS (BOS)
• Operators collected decks of punched
cards from users and used a satellite
computer to input a batch of jobs from
punched cards to a magnetic tape.
• The jobs were now input and run one at
a time in their order of appearance on
the tape. (FCFS).
• The running jobs output data on another
tape which used to get printed on a line
printer.
• Example: The SHARE operating system
for the IBM 709
 Multiprogramming OS (needed for efficiency)
• Single user cannot keep CPU and I/O devices busy at
all times
• Multiprogramming organizes jobs (code and data) so
CPU always has one to execute
• A subset of total jobs in system is kept in memory
• One job selected and run via job scheduling
• When it has to wait (for I/O for example), OS
switches to another job
Evolution of Operating System
Spooling:
• Spooling is an acronym for simultaneous
peripheral operations online.
• Data is sent to and stored in memory until
the program for the execution. When data
is temporarily held to be used and
executed by a program, device or the
system, then this process is called
Spooling.
• It overlaps I/O of one job with the
computation of other job and uses disk as
very large device. It’s a combination of
buffering and queueing.
Evolution of Operating System
 Time Sharing OS (Multitasking)
• Logical extension of Multiprogramming.
• CPU executes many jobs while switching between them frequently.
• The time that each task gets to execute is called quantum(< 1 second).
After this time interval is over OS switches over to the next task.
• Each user has at least one program executing in memory - process
• If several jobs ready to run at the same time - CPU scheduling
• If processes don’t fit in memory, swapping moves them in and out to run
• Virtual memory allows execution of processes not completely in
memory
• Uses CPU scheduling and Multiprogramming simultaneously.
Evolution of Operating System
 Parallel OS
• A parallel computing system consists of multiple processors that
communicate with each other using a shared memory.
• Single computer is required. Many operations are performed
simultaneously.
• It may have shared or distributed memory.
• Processors communicate with each other through bus
Evolution of Operating System
 Distributed OS
• System components are located at different locations.
• Uses multiple computers. Multiple computers perform multiple
operations.
• It have only distributed memory
• Computer communicate with each other through message passing.
• Improves system scalability, fault tolerance and resource sharing
capabilities.
Evolution of Operating System
OS Evolution
 OS for Interactive Processing
Allowed programs to carry on dialogue with user via remote
terminals (workstations)
Real-time processing
Users demand timely response
Machines too expensive to serve only one user
Common for several users to want interactive services at the
same time
Different Operating Systems on the Same
Machine ?
 It is possible to have more than one operating system available to be
used on a machine.
 Only one operating system is run at a time, though.
 Examples:
VAX - VMS or Ultrix
IBM PCs - DOS or Linux
Operating-System Operations
 Interrupt driven (hardware and software)
Hardware interrupt by one of the devices
Software interrupt (exception or trap):
Software error (e.g., division by zero)
Request for operating system service
Other process problems include infinite loop,
processes modifying each other or the
operating system
Operating-System Operations (cont.)
 Dual-mode operation allows OS to protect itself and other system
components
 User mode and kernel mode
 Mode bit provided by hardware
Provides ability to distinguish when system is running
user code or kernel code
Some instructions designated as privileged, only
executable in kernel mode
System call changes mode to kernel, return from call
resets it to user
Transition from User to Kernel Mode
 Timer to prevent infinite loop / process hogging resources
 Timer is set to interrupt the computer after some time period
 Keep a counter that is decremented by the physical clock.
 Operating system set the counter (privileged instruction)
 When counter zero generate an interrupt
 Set up before scheduling process to regain control or terminate
program that exceeds allotted time
OS Components
The OS Shell
 Defines interface between OS and users
 Windows GUI
 UNIX command line
 UNIX users can choose among a variety of shells
 csh is the “C shell”
 tcsh is an enhanced “C shell”
 Shell programming
OS Shell interface
O / S
shell
Users
Users
Users
The OS Kernel
 The internal part of the OS is often called the Kernel
 Kernel Components
 Process Manager
 Memory Manager
 Storage Manager
 I/O Manager
 Protection and Security
A. Frank - P. Weisberg
Process Management
 A process is a program in execution. It is a unit of work within the
system. Program is a passive entity, process is an active entity.
 Process needs resources to accomplish its task
 CPU, memory, I/O, files
 Initialization data
 Process termination requires reclaim of any reusable resources
 Single-threaded process has one program counter specifying
location of next instruction to execute
 Process executes instructions sequentially, one at a time, until completion
 Multi-threaded process has one program counter per thread
 Typically system has many processes, some user, some operating
system running concurrently on one or more CPUs
 Concurrency by multiplexing the CPUs among the processes / threads
Process Management Activities
 Creating and deleting both user and system processes
 Suspending and resuming processes
 Providing mechanisms for process synchronization
 Providing mechanisms for process communication
 Providing mechanisms for deadlock handling
The operating system is responsible for the following activities in
connection with process management:
Memory Management
 To execute a program all (or part) of the instructions must be in
memory
 All (or part) of the data that is needed by the program must be
in memory.
 Memory management determines what is in memory and when
 Optimizing CPU utilization and computer response to users
 Memory management activities
 Keeping track of which parts of memory are currently being used
and by whom
 Deciding which processes (or parts thereof) and data to move into
and out of memory
 Allocating and deallocating memory space as needed
Storage Management
 OS provides uniform, logical view of information storage
 Abstracts physical properties to logical storage unit - file
 Each medium is controlled by device (i.e., disk drive, tape drive)
 Varying properties include access speed, capacity, data-transfer rate, access
method (sequential or random)
 File-System management
 Files usually organized into directories
 Access control on most systems to determine who can access what
 OS activities include
 Creating and deleting files and directories
 Primitives to manipulate files and directories
 Mapping files onto secondary storage
 Backup files onto stable (non-volatile) storage media
Mass-Storage Management
 Usually disks used to store data that does not fit in main memory or
data that must be kept for a “long” period of time
 Proper management is of central importance
 Entire speed of computer operation hinges on disk subsystem and its
algorithms
 OS activities
 Free-space management
 Storage allocation
 Disk scheduling
 Some storage need not be fast
 Tertiary storage includes optical storage, magnetic tape
 Still must be managed – by OS or applications
 Varies between WORM (write-once, read-many-times) and RW (read-
write)
Migration of data “A” from Disk to Register
 Multitasking environments must be careful to use most recent
value, no matter where it is stored in the storage hierarchy
 Multiprocessor environment must provide cache coherency in
hardware such that all CPUs have the most recent value in their
cache
 Distributed environment situation even more complex
 Several copies of a datum can exist
 Various solutions covered in Chapter 17
I/O Subsystem
 One purpose of OS is to hide peculiarities of hardware devices
from the user
 I/O subsystem responsible for
 Memory management of I/O including buffering (storing data
temporarily while it is being transferred), caching (storing parts of data
in faster storage for performance), spooling (the overlapping of output
of one job with input of other jobs)
 General device-driver interface
 Drivers for specific hardware devices
OS Device Drivers
 Software to communicate with peripheral devices or controllers
 Each driver is unique
 Translates general requests into specific steps for that device
Protection and Security
 Protection – any mechanism for controlling access of processes or
users to resources defined by the OS
 Security – defense of the system against internal and external attacks
 Huge range, including denial-of-service, worms, viruses, identity theft, theft
of service
 Systems generally first distinguish among users, to determine who can
do what
 User identities (user IDs, security IDs) include name and associated
number, one per user
 User ID then associated with all files, processes of that user to determine
access control
 Group identifier (group ID) allows set of users to be defined and controls
managed, then also associated with each process, file
 Privilege escalation allows user to change to effective ID with more rights
OS Summary
 Shell -- interface to user
 File Manager -- manages mass memory
 Device Drivers -- communicate with peripherals
 Memory Manager -- manages main memory
 Scheduler & Dispatcher -- manage processes
System Calls
 Programming interface to the services provided
by the OS
 Typically written in a high-level language (C or
C++)
 Mostly accessed by programs via a high-level
Application Programming Interface (API)
rather than direct system call use
 Three most common APIs are Win32 API for
Windows, POSIX API for POSIX-based
systems (including virtually all versions of
UNIX, Linux, and Mac OS X), and Java API
for the Java virtual machine (JVM)
Types of System Calls
 Process control
 create process, terminate process
 end, abort
 load, execute
 get process attributes, set process attributes
 wait for time
 wait event, signal event
 allocate and free memory
 Dump memory if error
 Debugger for determining bugs, single step execution
 Locks for managing access to shared data between processes
Types of System Calls
 File management
 create file, delete file
 open, close file
 read, write, reposition
 get and set file attributes
 Device management
 request device, release device
 read, write, reposition
 get device attributes, set device attributes
 logically attach or detach devices
Types of System Calls (Cont.)
 Information maintenance
 get time or date, set time or date
 get system data, set system data
 get and set process, file, or device attributes
 Communications
 create, delete communication connection
 send, receive messages if message passing model to host
name or process name
From client to server
 Shared-memory model create and gain access to memory
regions
 transfer status information
 attach and detach remote devices
Types of System Calls (Cont.)
 Protection
 Control access to resources
 Get and set permissions
 Allow and deny user access
Operating System Services
 Operating systems provide an environment for execution of
programs and services to programs and users
 One set of operating-system services provides functions that
are helpful to the user:
 User interface - Almost all operating systems have a user
interface (UI).
Varies between Command-Line (CLI), Graphics
User Interface (GUI), batch
 Program execution - The system must be able to load a
program into memory and to run that program, end
execution, either normally or abnormally (indicating
error)
 I/O operations - A running program may require I/O,
which may involve a file or an I/O device
Operating System Services (Cont.)
 One set of operating-system services provides functions that are helpful to the user
(Cont.):
 File-system manipulation - The file system is of particular interest. Programs
need to read and write files and directories, create and delete them, search them, list
file Information, permission management.
 Communications – Processes may exchange information, on the same computer or
between computers over a network
Communications may be via shared memory or through message passing
(packets moved by the OS)
 Error detection – OS needs to be constantly aware of possible errors
May occur in the CPU and memory hardware, in I/O devices, in user program
For each type of error, OS should take the appropriate action to ensure correct
and consistent computing
Debugging facilities can greatly enhance the user’s and programmer’s abilities
to efficiently use the system
Operating System Services (Cont.)
 Another set of OS functions exists for ensuring the efficient
operation of the system itself via resource sharing
 Resource allocation - When multiple users or multiple jobs
running concurrently, resources must be allocated to each of
them
Many types of resources - CPU cycles, main memory, file
storage, I/O devices.
 Accounting - To keep track of which users use how much and
what kinds of computer resources
 Protection and security - 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
Protection involves ensuring that all access to system
resources is controlled
Security of the system from outsiders requires user
authentication, extends to defending external I/O devices
from invalid access attempts
A View of Operating System Services
Nt introduction(os)

Weitere ähnliche Inhalte

Was ist angesagt?

What is operating system
What is operating systemWhat is operating system
What is operating system
Suvithak
 
Operating systems
Operating systemsOperating systems
Operating systems
anishgoel
 

Was ist angesagt? (20)

Os concepts
Os conceptsOs concepts
Os concepts
 
What is operating system
What is operating systemWhat is operating system
What is operating system
 
Operating system
Operating systemOperating system
Operating system
 
Operating system concepts
Operating system conceptsOperating system concepts
Operating system concepts
 
Operating Systems 1 (2/12) - Hardware Basics
Operating Systems 1 (2/12) - Hardware BasicsOperating Systems 1 (2/12) - Hardware Basics
Operating Systems 1 (2/12) - Hardware Basics
 
Unit 1 introduction to os
Unit 1 introduction to osUnit 1 introduction to os
Unit 1 introduction to os
 
ITFT_Device management in Operating System
ITFT_Device management in Operating SystemITFT_Device management in Operating System
ITFT_Device management in Operating System
 
OPERATING SYSTEM
OPERATING SYSTEMOPERATING SYSTEM
OPERATING SYSTEM
 
Operating system 02 os as an extended machine
Operating system 02 os as an extended machineOperating system 02 os as an extended machine
Operating system 02 os as an extended machine
 
Os1
Os1Os1
Os1
 
OPERATING SYSTEM
OPERATING SYSTEMOPERATING SYSTEM
OPERATING SYSTEM
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works.
 
Bca i-fundamental of computer-u-3-functions operating systems
Bca  i-fundamental of  computer-u-3-functions operating systemsBca  i-fundamental of  computer-u-3-functions operating systems
Bca i-fundamental of computer-u-3-functions operating systems
 
Operating System Introduction - Definition, Working, Components
Operating System Introduction - Definition, Working, ComponentsOperating System Introduction - Definition, Working, Components
Operating System Introduction - Definition, Working, Components
 
Operating Systems FYBSC IT UNIT I- Introduction to Operating Systems
Operating Systems FYBSC IT UNIT I- Introduction to Operating SystemsOperating Systems FYBSC IT UNIT I- Introduction to Operating Systems
Operating Systems FYBSC IT UNIT I- Introduction to Operating Systems
 
Operating Systems As a Product
Operating Systems As a ProductOperating Systems As a Product
Operating Systems As a Product
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Introduction to OS.
Introduction to OS.Introduction to OS.
Introduction to OS.
 
Operating systems
Operating systemsOperating systems
Operating systems
 
Operating System Overview
Operating System OverviewOperating System Overview
Operating System Overview
 

Ähnlich wie Nt introduction(os)

operatinndnd jdj jjrg-system-1(1) (1).pptx
operatinndnd jdj jjrg-system-1(1) (1).pptxoperatinndnd jdj jjrg-system-1(1) (1).pptx
operatinndnd jdj jjrg-system-1(1) (1).pptx
krishnajoshi70
 

Ähnlich wie Nt introduction(os) (20)

OS Content.pdf
OS Content.pdfOS Content.pdf
OS Content.pdf
 
Operating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdfOperating Systems PPT 1 (1).pdf
Operating Systems PPT 1 (1).pdf
 
Engg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdfEngg-0505-IT-Operating-Systems-2nd-year.pdf
Engg-0505-IT-Operating-Systems-2nd-year.pdf
 
operatinndnd jdj jjrg-system-1(1) (1).pptx
operatinndnd jdj jjrg-system-1(1) (1).pptxoperatinndnd jdj jjrg-system-1(1) (1).pptx
operatinndnd jdj jjrg-system-1(1) (1).pptx
 
unit1 part1.ppt
unit1 part1.pptunit1 part1.ppt
unit1 part1.ppt
 
os unit 1 (2).pptx. introduction to operating systems
os unit 1 (2).pptx. introduction to operating systemsos unit 1 (2).pptx. introduction to operating systems
os unit 1 (2).pptx. introduction to operating systems
 
CSE3120- Module1 part 1 v1.pptx
CSE3120- Module1 part 1 v1.pptxCSE3120- Module1 part 1 v1.pptx
CSE3120- Module1 part 1 v1.pptx
 
os_1.pdf
os_1.pdfos_1.pdf
os_1.pdf
 
Operating System
Operating SystemOperating System
Operating System
 
Unit I OS.pdf
Unit I OS.pdfUnit I OS.pdf
Unit I OS.pdf
 
Operating System Overview.pdf
Operating System Overview.pdfOperating System Overview.pdf
Operating System Overview.pdf
 
Ch1 - OS.pdf
Ch1 - OS.pdfCh1 - OS.pdf
Ch1 - OS.pdf
 
Operating System-Introduction
Operating System-IntroductionOperating System-Introduction
Operating System-Introduction
 
Advanced_OS_Unit 1 & 2.ppt
Advanced_OS_Unit 1 & 2.pptAdvanced_OS_Unit 1 & 2.ppt
Advanced_OS_Unit 1 & 2.ppt
 
1. Unit 1_Introduction to OS.pptx
1. Unit 1_Introduction to OS.pptx1. Unit 1_Introduction to OS.pptx
1. Unit 1_Introduction to OS.pptx
 
Chapter one_oS.ppt
Chapter one_oS.pptChapter one_oS.ppt
Chapter one_oS.ppt
 
Kernel security Concepts
Kernel security ConceptsKernel security Concepts
Kernel security Concepts
 
Operating system
Operating systemOperating system
Operating system
 
EMBEDDED OS
EMBEDDED OSEMBEDDED OS
EMBEDDED OS
 
Operating system concept
Operating system conceptOperating system concept
Operating system concept
 

Kürzlich hochgeladen

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Kürzlich hochgeladen (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

Nt introduction(os)

  • 1. Operating Systems Introduction to Operating System (OS) Prof. Neha Tadam, CSE
  • 2. What is an Operating System (1)? • A modern computer consists of: • One or more processors • Main memory • Secondary Storage • Various input/output devices • Managing all these varied components requires a layer of software – the Operating System (OS).
  • 3. What is an Operating System (2)?  An Operating System is a System program that acts as an - • intermediary/interface between a user of a computer and the computer hardware. • Resource Allocator • Manages all resources • Decides between conflicting requests for efficient and fair resource use • Platform – creates an environment in which application programs run. • Control program - Controls execution of programs to prevent errors and improper use of the computer  OS goals: • Control/execute user/application programs. • Make the computer system convenient to use. • Ease the solving of user problems. • Use the computer hardware in an efficient manner.
  • 4.  OS goals: • Control/execute user/application programs. • Make the computer system convenient to use. • Ease the solving of user problems. • Use the computer hardware in an efficient manner. A. Frank - P. Weisberg
  • 5. Where does the OS fit in?
  • 6. Computer System Structure  Computer system can be divided into four components: • Hardware – provides basic computing resources CPU, memory, I/O devices • Operating system Controls and coordinates use of hardware among various applications and users • Application programs – define the ways in which the system resources are used to solve the computing problems of the users Word processors, compilers, web browsers, database systems, video games • Users People, machines, other computers
  • 7. Services provided by an OS • Facilities for program creation • editors, compilers, linkers, debuggers, etc. • Program execution • loading in memory, I/O and file initialization. • Access to I/O and files • deals with the specifics of I/O and file formats. • System access • resolves conflicts for resource contention. • protection in access to resources and data.
  • 8. Why are Operating Systems Important? Important to understand and know how to correctly use when writing user applications. Large and complex systems that have a high economic impact and result in interesting problems of management. Few actually involved in OS design and implementation but nevertheless many general techniques to be learned and applied. Combines concepts from many other areas of Computer Science: Architecture, Languages, Data Structures, Algorithms, etc.
  • 9. COURSE SYLLABUS  Introduction to OS  Process Scheduling  Process Synchronization  Memory Management  Unit Title: File System  Unit Title: I/O System
  • 10. Evolution of Operating System • The evolution of operating systems went through seven major phases • Six of them significantly changed the ways in which users accessed computers through the open shop, batch processing, multiprogramming, timesharing, personal computing, and distributed systems. • In the seventh phase the foundations of concurrent programming were developed and demonstrated in model operating systems . Open Shop The 1940's - First Generations The 1950's - Second Generation The 1960's - Third Generation Fourth Generation
  • 11. Evolution of Operating System  Open Shop (Idea of OS) • The story of operating systems in 1954 when computers had no operating systems but were operated manually by their users. • Each user was allocated a minimum 15-minute slot , of which time he usually spent 10 minutes in setting up the equipment to do his computation . . . By the time he got his calculation going, he may have had only 5 minutes or less of actual computation completed-wasting two thirds of his time slot. • Example: IBM 701 Open shop
  • 12. Evolution of Operating System  Serial Processing OS • Programming in 1's and 0's (machine language) was quite common for early computer systems. • They were now asked to prepare their programs and data on punched cards and submit them to a computing center for execution. • Instruction and data used to be fed into the computer through card reader using Punch Cards. • Job execution was done in FIFO fashion. • Job was given to Computer using Punch Cards then later on Magnetic Tapes were also used.
  • 13. Evolution of Operating System  Batch OS (BOS) • Operators collected decks of punched cards from users and used a satellite computer to input a batch of jobs from punched cards to a magnetic tape. • The jobs were now input and run one at a time in their order of appearance on the tape. (FCFS). • The running jobs output data on another tape which used to get printed on a line printer. • Example: The SHARE operating system for the IBM 709
  • 14.  Multiprogramming OS (needed for efficiency) • Single user cannot keep CPU and I/O devices busy at all times • Multiprogramming organizes jobs (code and data) so CPU always has one to execute • A subset of total jobs in system is kept in memory • One job selected and run via job scheduling • When it has to wait (for I/O for example), OS switches to another job Evolution of Operating System
  • 15.
  • 16. Spooling: • Spooling is an acronym for simultaneous peripheral operations online. • Data is sent to and stored in memory until the program for the execution. When data is temporarily held to be used and executed by a program, device or the system, then this process is called Spooling. • It overlaps I/O of one job with the computation of other job and uses disk as very large device. It’s a combination of buffering and queueing. Evolution of Operating System
  • 17.  Time Sharing OS (Multitasking) • Logical extension of Multiprogramming. • CPU executes many jobs while switching between them frequently. • The time that each task gets to execute is called quantum(< 1 second). After this time interval is over OS switches over to the next task. • Each user has at least one program executing in memory - process • If several jobs ready to run at the same time - CPU scheduling • If processes don’t fit in memory, swapping moves them in and out to run • Virtual memory allows execution of processes not completely in memory • Uses CPU scheduling and Multiprogramming simultaneously. Evolution of Operating System
  • 18.  Parallel OS • A parallel computing system consists of multiple processors that communicate with each other using a shared memory. • Single computer is required. Many operations are performed simultaneously. • It may have shared or distributed memory. • Processors communicate with each other through bus Evolution of Operating System
  • 19.  Distributed OS • System components are located at different locations. • Uses multiple computers. Multiple computers perform multiple operations. • It have only distributed memory • Computer communicate with each other through message passing. • Improves system scalability, fault tolerance and resource sharing capabilities. Evolution of Operating System
  • 20. OS Evolution  OS for Interactive Processing Allowed programs to carry on dialogue with user via remote terminals (workstations) Real-time processing Users demand timely response Machines too expensive to serve only one user Common for several users to want interactive services at the same time
  • 21. Different Operating Systems on the Same Machine ?  It is possible to have more than one operating system available to be used on a machine.  Only one operating system is run at a time, though.  Examples: VAX - VMS or Ultrix IBM PCs - DOS or Linux
  • 22. Operating-System Operations  Interrupt driven (hardware and software) Hardware interrupt by one of the devices Software interrupt (exception or trap): Software error (e.g., division by zero) Request for operating system service Other process problems include infinite loop, processes modifying each other or the operating system
  • 23. Operating-System Operations (cont.)  Dual-mode operation allows OS to protect itself and other system components  User mode and kernel mode  Mode bit provided by hardware Provides ability to distinguish when system is running user code or kernel code Some instructions designated as privileged, only executable in kernel mode System call changes mode to kernel, return from call resets it to user
  • 24. Transition from User to Kernel Mode  Timer to prevent infinite loop / process hogging resources  Timer is set to interrupt the computer after some time period  Keep a counter that is decremented by the physical clock.  Operating system set the counter (privileged instruction)  When counter zero generate an interrupt  Set up before scheduling process to regain control or terminate program that exceeds allotted time
  • 26. The OS Shell  Defines interface between OS and users  Windows GUI  UNIX command line  UNIX users can choose among a variety of shells  csh is the “C shell”  tcsh is an enhanced “C shell”  Shell programming
  • 27. OS Shell interface O / S shell Users Users Users
  • 28. The OS Kernel  The internal part of the OS is often called the Kernel  Kernel Components  Process Manager  Memory Manager  Storage Manager  I/O Manager  Protection and Security
  • 29. A. Frank - P. Weisberg
  • 30. Process Management  A process is a program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity.  Process needs resources to accomplish its task  CPU, memory, I/O, files  Initialization data  Process termination requires reclaim of any reusable resources  Single-threaded process has one program counter specifying location of next instruction to execute  Process executes instructions sequentially, one at a time, until completion  Multi-threaded process has one program counter per thread  Typically system has many processes, some user, some operating system running concurrently on one or more CPUs  Concurrency by multiplexing the CPUs among the processes / threads
  • 31. Process Management Activities  Creating and deleting both user and system processes  Suspending and resuming processes  Providing mechanisms for process synchronization  Providing mechanisms for process communication  Providing mechanisms for deadlock handling The operating system is responsible for the following activities in connection with process management:
  • 32. Memory Management  To execute a program all (or part) of the instructions must be in memory  All (or part) of the data that is needed by the program must be in memory.  Memory management determines what is in memory and when  Optimizing CPU utilization and computer response to users  Memory management activities  Keeping track of which parts of memory are currently being used and by whom  Deciding which processes (or parts thereof) and data to move into and out of memory  Allocating and deallocating memory space as needed
  • 33. Storage Management  OS provides uniform, logical view of information storage  Abstracts physical properties to logical storage unit - file  Each medium is controlled by device (i.e., disk drive, tape drive)  Varying properties include access speed, capacity, data-transfer rate, access method (sequential or random)  File-System management  Files usually organized into directories  Access control on most systems to determine who can access what  OS activities include  Creating and deleting files and directories  Primitives to manipulate files and directories  Mapping files onto secondary storage  Backup files onto stable (non-volatile) storage media
  • 34. Mass-Storage Management  Usually disks used to store data that does not fit in main memory or data that must be kept for a “long” period of time  Proper management is of central importance  Entire speed of computer operation hinges on disk subsystem and its algorithms  OS activities  Free-space management  Storage allocation  Disk scheduling  Some storage need not be fast  Tertiary storage includes optical storage, magnetic tape  Still must be managed – by OS or applications  Varies between WORM (write-once, read-many-times) and RW (read- write)
  • 35. Migration of data “A” from Disk to Register  Multitasking environments must be careful to use most recent value, no matter where it is stored in the storage hierarchy  Multiprocessor environment must provide cache coherency in hardware such that all CPUs have the most recent value in their cache  Distributed environment situation even more complex  Several copies of a datum can exist  Various solutions covered in Chapter 17
  • 36. I/O Subsystem  One purpose of OS is to hide peculiarities of hardware devices from the user  I/O subsystem responsible for  Memory management of I/O including buffering (storing data temporarily while it is being transferred), caching (storing parts of data in faster storage for performance), spooling (the overlapping of output of one job with input of other jobs)  General device-driver interface  Drivers for specific hardware devices
  • 37. OS Device Drivers  Software to communicate with peripheral devices or controllers  Each driver is unique  Translates general requests into specific steps for that device
  • 38. Protection and Security  Protection – any mechanism for controlling access of processes or users to resources defined by the OS  Security – defense of the system against internal and external attacks  Huge range, including denial-of-service, worms, viruses, identity theft, theft of service  Systems generally first distinguish among users, to determine who can do what  User identities (user IDs, security IDs) include name and associated number, one per user  User ID then associated with all files, processes of that user to determine access control  Group identifier (group ID) allows set of users to be defined and controls managed, then also associated with each process, file  Privilege escalation allows user to change to effective ID with more rights
  • 39. OS Summary  Shell -- interface to user  File Manager -- manages mass memory  Device Drivers -- communicate with peripherals  Memory Manager -- manages main memory  Scheduler & Dispatcher -- manage processes
  • 40. System Calls  Programming interface to the services provided by the OS  Typically written in a high-level language (C or C++)  Mostly accessed by programs via a high-level Application Programming Interface (API) rather than direct system call use  Three most common APIs are Win32 API for Windows, POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X), and Java API for the Java virtual machine (JVM)
  • 41.
  • 42. Types of System Calls  Process control  create process, terminate process  end, abort  load, execute  get process attributes, set process attributes  wait for time  wait event, signal event  allocate and free memory  Dump memory if error  Debugger for determining bugs, single step execution  Locks for managing access to shared data between processes
  • 43. Types of System Calls  File management  create file, delete file  open, close file  read, write, reposition  get and set file attributes  Device management  request device, release device  read, write, reposition  get device attributes, set device attributes  logically attach or detach devices
  • 44. Types of System Calls (Cont.)  Information maintenance  get time or date, set time or date  get system data, set system data  get and set process, file, or device attributes  Communications  create, delete communication connection  send, receive messages if message passing model to host name or process name From client to server  Shared-memory model create and gain access to memory regions  transfer status information  attach and detach remote devices
  • 45. Types of System Calls (Cont.)  Protection  Control access to resources  Get and set permissions  Allow and deny user access
  • 46. Operating System Services  Operating systems provide an environment for execution of programs and services to programs and users  One set of operating-system services provides functions that are helpful to the user:  User interface - Almost all operating systems have a user interface (UI). Varies between Command-Line (CLI), Graphics User Interface (GUI), batch  Program execution - The system must be able to load a program into memory and to run that program, end execution, either normally or abnormally (indicating error)  I/O operations - A running program may require I/O, which may involve a file or an I/O device
  • 47. Operating System Services (Cont.)  One set of operating-system services provides functions that are helpful to the user (Cont.):  File-system manipulation - The file system is of particular interest. Programs need to read and write files and directories, create and delete them, search them, list file Information, permission management.  Communications – Processes may exchange information, on the same computer or between computers over a network Communications may be via shared memory or through message passing (packets moved by the OS)  Error detection – OS needs to be constantly aware of possible errors May occur in the CPU and memory hardware, in I/O devices, in user program For each type of error, OS should take the appropriate action to ensure correct and consistent computing Debugging facilities can greatly enhance the user’s and programmer’s abilities to efficiently use the system
  • 48. Operating System Services (Cont.)  Another set of OS functions exists for ensuring the efficient operation of the system itself via resource sharing  Resource allocation - When multiple users or multiple jobs running concurrently, resources must be allocated to each of them Many types of resources - CPU cycles, main memory, file storage, I/O devices.  Accounting - To keep track of which users use how much and what kinds of computer resources  Protection and security - 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 Protection involves ensuring that all access to system resources is controlled Security of the system from outsiders requires user authentication, extends to defending external I/O devices from invalid access attempts
  • 49. A View of Operating System Services