SlideShare a Scribd company logo
OPERATING SYSTEMS
Course Objectives:
 Learn basics of operating Systems.
 Understand the process management and
synchronization that take place in the operating
system.
 Learn the principles of memory, I/O and file
management in a secured environment
12/21/2022 Unit-I: Introduction 1
COURSE OUTCOMES:
At the end of this course the student will be
able to
 Outline the basic functionalities and structure of the Operating System
 Analyze various Process Scheduling algorithms, distinguish between
various types of Operating systems like Windows and Linux.
 Solve issues related to process Synchronization and Deadlocks in the
Operating System
 Demonstrate the concepts of Memory Management(Physical and Virtual
memory)
 Infer the directory structure and analyze disk management algorithms.
 understand the concepts of I/O systems, protection and security
12/21/2022 Unit-I: Introduction 2
Syllabus
• UNIT I : Introduction to Operating System
• UNIT II: Process Management
• UNIT III: Process-Synchronization & Deadlocks
• UNIT IV: Memory Management
• UNIT V: File System
• UNIT VI: I/O Systems
12/21/2022 Unit-I: Introduction 3
UNIT–I: Introduction
1. Introduction to Operating System Concepts
• Multitasking
• Multiprogramming
• Multiuser
• Multithreading
• Multi processing
2. Types of Operating Systems
• Batch Operating System
• Time–sharing Systems
• Distributed OS
• Network OS
• Real–Time OS
3. Various Operating System Services
4. Architecture
5. System Calls and Programs
Exam Questions
Unit-I: Introduction 4
|<<
Introduction to Operating System Concepts
• Prerequisites
• Operating System (OS)
• Resources of a Computer System
• User View
• System View
• Objectives and Functions of OS
• Multiprogramming
• Multitasking
• Multiuser
• Multithreading
Unit-I: Introduction 5
• Data Structures
• Computer Organisation
• Any High–Level Language (C, …)
Unit-I: Introduction
6
|<<
Prerequisites
Defn1: OS is software that manages computer hardware and
software resources and provides common services for
computer programs. (source: Wiki)
Defn2: Controls and coordinates use of Hardware
among Various Applications and Users
Defn3:Collection of System Software (Programs),
which makes it User friendly and Most efficient
Kernel
Program running at all times on the Computer
Unit-I: Introduction 7
Operating System (OS)
Kernel
• Central module and Part of the OS that loads first, and it remains in main
memory.
• So, it has to be as small as possible while still providing all the essential
services required by other parts of the operating system and applications.
• Its loaded into a protected area of memory to prevent it from being
overwritten by programs or other parts of the operating system.
• Responsible for memory management,
– process and task management, and
– disk management.
– The kernel connects the system hardware to the application software.
• Every OS has a kernel.
• For example the Linux kernel is used in numerous operating systems
including Linux, FreeBSD, Android and others.
Unit-I: Introduction 8
• AT & T / BSD
Unix
• Sun Microsystems’
Solaris 2
Linux
• Microsoft
MS-DOS
Windows 95 / 98 / NT
Windows 2000 (Windows Me)
Windows XP
Windows Vista
Windows 7 / Windows 8
Windows 10
• DEC
VMS (Virtual Memory System)
TOPS–20 (Total Operations Processing System)
• IBM
OS/2
• Apple
Macintosh
Unit-I: Introduction 9
|<<
Most Popular Operating Systems
• Hardware
• Operating System
• Application Programs
• Users
Unit-I: Introduction 10
Basic Structure/Components of a Computer System
1. Central Processing Unit (CPU)
2. Memory
3. Input–Output (I/O) / Peripheral Devices
• Provides basic Computing Resources.
Hardware and Software
required to solve a problem
CPU Time
Memory Space
File Storage Space
I/O Devices
…
Unit-I: Introduction 11
|<<
Resources of a Computer System
Four Components of Computer System
Varies according to the interface used
Goal
To maximize the work, the user is performing
• Ease of use
• Performance
• Resource utilization
Mainframe / Minicomputer
• Share Resources
• Exchange Information
• Designed to maximize Resource utilization
All Available CPU Time, Memory and I/O used efficiently
Unit-I: Introduction 12
User View
• Workstations (Perform Effective Resource Sharing)
• Connected to Networks of other workstations and Servers
• Dedicated Resources at disposal
• Also Share Resources such as Networking and Servers
(File, Compute, Print Servers)
• Handheld Computers (Ease of use)
• Standalone units for Individual users
• Connected to Networks
(Directly by wire / through wireless Modems and Networking)
• Perform relatively few remote operations
(Power, Speed, Interface limitations)
• Designed mostly for individual usability
• Embedded Computers in Home Devices and Automobiles (Performance)
• Have Numeric Keypads
• May turn indicator lights on or off to show status
• Designed primarily to run without user intervention
Unit-I: Introduction 13
User View (contd.)
Most intimately involved with Hardware
• Resource Allocator
•Acts as Manager of Resources.
•Decides to allocate Resources to Specific Programs and Users
so that OS operates the Computer System Efficiently and Fairly
•Important as many Users access the same Mainframe / Minicomputer
• Control Program
•Manages Execution of User Programs
to prevent Errors and Improper use of Computer
•Concerned with Operation and Control of I/O Devices
Unit-I: Introduction 14
System View
Essential part of a Computer System
• Purpose: To provide an environment in which a User can Execute Programs
in a Convenient and Efficient manner
• Program that acts as an intermediary between the User of a Computer and the
Computer Hardware
• Must Ensure Correct Operation of Computer System
• Provides Certain Services to Programs and users of those programs in order to
make their Tasks Easier
• Controls and Coordinates the use of Hardware among Various Application
Programs for the Various users
• Primary Goals-
User friendly
Efficient Operation of the Computer System
Unit-I: Introduction 15
Objectives and Functions of Operating System
Computer System Organization
• Computer-system operation
– One or more CPUs, device controllers connect through common bus providing
access to shared memory
– Concurrent execution of CPUs and devices competing for memory cycles
Storage-Device Hierarchy
•The higher
levels are
expensive,
but are fast.
•As we move
down the
hierarchy, the
cost per bit
decreases,
where as
Access time
generally
increases.
Computer-System Architecture
1.Single-Processor Systems
2.Multi-Processor Systems
3.Clustered Systems
Unit-I: Introduction 18
Computer-System Architecture
• Single Processor Systems
– One CPU
– May have other special-purpose processors (such
as disk controllers)
• Run a limited instruction set
• Do not run user processes
• Sometimes managed by OS
• For example a disk controller processor receives a
sequence of requests from the main CPU and
implements its own disk queue and scheduling
algorithm to relieve the main CPU of the overhead of
disk scheduling.
Multiprocessor systems
• Two or more processors in close communication, sharing the
computer bus and sometimes the clock, memory, and
peripherals.
• Advantages:
– Increased throughput
• The speed-up ratio with N processors is not N however,
it is less than N.
– Economy of scale
• Sharing of peripherals, mass storage, power supplies.
• Can cost less than multiple single-processor systems
– Increased reliability
• Graceful degredation(The ability to continue providing
service proportional to the level of surviving hardware)
• Fault tolerance
– Failure detection, diagnose and correction
– Hardware duplication(HP NonStop system)
Multiprocessor Systems
• Two types:
– Asymmetric multiprocessing in which each
processor is assigned a specific task. A master
processor controls the system, scheduling and
allocating work to slave processors.
– Symmetric multiprocessing (SMP) in which each
processor performs all tasks within the operating
system. All processors are peers.
Symmetric Multiprocessing Architecture
Clustered Systems
• Gather together multiple CPUs to accomplish computation
• Composed of two or more individual systems coupled together.
• High availability service.
– Each node can monitor one or more of the others over the
LAN.
– If the monitored machine fails, the monitoring machine can
take ownership of its storage and restart the applications that
were running on the failed machine.
• Structure
– Asymmetric clustering: One machine is in hot-standby mode
while the other is running applications. Hot-standby machine
only monitors the active server.
– Symmetric clustering:Two or more hosts are running
applications and are monitoring each other
• Parallel Clusters allow multiple hosts to access the same data on
the shared storage. May need a distributed lock manager (DLM).
• Single User System
• Single Program in execution.
Unit-I: Introduction 24
Uniprogramming
Unit-I: Introduction 25
Multiprogramming Systems
Multiprogramming is also the ability of an operating system to
execute more than one program on a single processor machine.
More than one task/program/job/process can reside into the main
memory at one point of time. A computer running excel and firefox
browser simultaneously is an example of multiprogramming.
Time sharing is a logical extension of multiprogramming.
In this, the CPU executes multiple jobs by switching among them, but the
switches occur so frequently that the users can interact with each program
while it is running.
Response time should be < 1 second
Each user has at least one program executing in memory process
Job scheduling: Which jobs to bring to memory from job pool on disk.
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
(physical memory versus logical memory)
Unit-I: Introduction 26
|<<
Time Sharing
• Multiple Tasks are performed during the Same period of time.
• Tasks Share Common Processing Resources
such as CPU and Main Memory.
• In Uniprocessor Systems,
Multitasking Solves the problem by Scheduling which task may be the one
running at any given time, and when another waiting task gets a turn.
Context Switch
• Act of reassigning a CPU from one task to another one.
Unit-I: Introduction 27
|<<
Multitasking /
Multiprocessing
Allows for Multiple users to use the Same Computer
in timely manner.
Multiuser
Unit-I: Introduction 28
Multitasking
Multitasking is the ability of an operating system to
execute more than one task simultaneously on a single
processor machine. Though we say so but in reality no
two tasks on a single processor machine can be executed
at the same time. Actually CPU switches from one task to
the next task so quickly that appears as if all the tasks are
executing at the same time. More than one
task/program/job/process can reside into the same CPU at
one point of time.
Unit-I: Introduction 29
Multiprocessing
Multiprocessing is the ability of an operating system to execute more
than one process simultaneously on a multi processor machine. In
this, a computer uses more than one CPU at a time.
Unit-I: Introduction 30
Multithreading
Multithreading is the ability of an operating system to execute the
different parts of a program called threads at the same time. Threads
are the light wait processes which are independent part of a process
or program. In multithreading system, more than one threads are
executed parallely on a single CPU.
• Batch Processing Systems
• Interactive Systems
• Time Sharing
• Time Slicing
• Distributed Systems
• Network Systems
• Real–Time Systems
• Evolution of OS
Unit-I: Introduction 31
Types of Operating Systems
|<<
Computer runs one and only one application at a time.
In Batch processing same type of jobs batch (BATCH- a
set of jobs with similar needs) together and execute at a
time.
The OS was simple, its major task was to transfer control
from one job to the next.
The job was submitted to the computer operator in form of
punch cards. At some later time the output appeared.
The OS was always resident in memory.
Common Input devices were card readers and tape drives.
Common output devices were Line printers ,Tape drives
Card punches
Unit-I: Introduction 32
Batch Processing Systems
12/21/2022 Unit-I: Introduction 33
OS always resident in memory.
CPU is often idle.
User did not interact directly with computer systems.
User prepared a job and submitted to computer operator.
Operators batched together jobs with similar needs
and run them through the computer as a group.
Programmers would leave their programs
with the operator.
The operator would sort the programs into batches
with similar requirements
and as the computer became available
would run each job.
Unit-I: Introduction 34
|<<
Batch Processing (during earlier days)
Unit-I: Introduction 35
• The User interacts directly with OS to supply commands and
data as the application program executes and the user receives
results of processing immediately.
• User and Computer System interact.
• User Requests.
• System Responds.
• The process goes on.
Unit-I: Introduction 36
|<<
Interactive Processing
•There will be an user interface in place to allow all these to
happen
•It can be CLI or GUI
Unit-I: Introduction 37
Variable CPU Time to different processes.
Once CPU Time is allocated to a process, will not be interrupted
till it completes its execution, or waiting for an I/O, or cannot
continue its execution.
Unit-I: Introduction 38
|<<
Time Sharing
Equal Amount of CPU time allocated
among Various Processes.
Time Slicing
• Distribute the Computation among Several Physical Processors
Loosely Coupled System
•Each Processor has its Own Local Memory.
•Processors Communicate with one another through Various
Communications lines, such as High–Speed buses or Telephone
lines
•Enables Parallelism but speed up is not the goal
Advantages of Distributed Systems
• Resources Sharing
• Computation Speed up–load Sharing
• Reliability
• Communications
Unit-I: Introduction 39
Distributed Systems
Unit-I: Introduction 40
Unit-I: Introduction 41
Unit-I: Introduction 42
Unit-I: Introduction 43
Special purpose OS.
Used when rigid time requirements have been placed
on the operation of a processor or the flow of data.
Used as control device in a dedicated application.
Sensors bring data to the computer.
The computer analyses the data
and possibly adjust controls to modify the sensor inputs.
Well-defined, Fixed-time constraints.
Processing must be done within the defined constraints.
Ex: Systems controlling scientific experiments
Medical imaging systems
Industrial control systems
Certain display systems
Automobile-engine fuel-injection systems
Home-appliance controllers
Weapon systems
Unit-I: Introduction 44
Real–Time Systems
Hard real-time systems
Guarantee critical tasks be completed on time.
Soft real-time systems
Critical real-time task gets priority over other tasks
and retains the priority until it completes.
Ex: Multimedia
Advanced scientific projects
Undersea exploration
Planetary rovers
Unit-I: Introduction 45
|<<
Types of Real–Time Systems
Unit-I: Introduction 46
Evolution of Operating Systems
Unit-I: Introduction 47
|<<
|<<
Various Operating System Services
Provides No. of Services.
Lowest level – System Calls
Allow running program to make requests
from the OS directly.
Higher level – Command Interpreter or Shell
User issues request without writing program.
Categories
1. Program Control
2. Status Requests
3. I/O Requests
Unit-I: Introduction 48
Operating
System
Services
1. User Interface
2. Program Execution
3. I/O Operations
4. File-System Manipulation
5. Communications
6. Error Detection
Unit-I: Introduction 49
|<<
– Other Services
1. Resource Allocation
2. Accounting
3. Protection and Security
• All Operating Systems have User Interface (UI)
• Command-Line Interface (CLI)
• Graphics User Interface (GUI)
Unit-I: Introduction 50
|<<
User Interface
• Load Program into Memory
• Run the Program
• End Execution, either Normally or Abnormally (indicating Error)
Program Execution
Running Program may require I/O,
which may involve File or I/O Device.
Unit-I: Introduction 51
I/O Operations
|<<
Programs need to
Read and Write Files and Directories,
Create and Delete Files and Directories,
Search Files and Directories,
List File Information,
Permission Management.
File–System Manipulation
Processes may exchange information,
on the Same Computer or between Computers
over a Network
Communications may be via
– Shared Memory or
– thru Message Passing (Packets moved by the Operating System)
Unit-I: Introduction 52
Communications
|<<
Two ways of passing
data between
programs.
• May occur in
– the CPU and Memory Hardware,
– I / O Devices,
– 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
Unit-I: Introduction 53
Error Detection
|<<
When Multiple Users or Multiple Jobs running Concurrently,
Resources must be Allocated to each of them.
Resource Allocation
To Keep Track of
Which Users use How much
What Kinds of Computer Resources
To know Usage statistics.
Unit-I: Introduction 54
Accounting
|<<
• 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
Protection and Security
System Calls
• Provides Interface between Running Program and the Operating System.
• It provides as an interface to the services made available by an OS
– These calls are generally available as routines written in C and C++,
although certain low-level tasks, may need to be written using
assembly-language instructions.
• Methods used to Pass Parameters between a Running Program and the
Operating System.
1. Pass Parameters in Registers.
2. Store the Parameters in a Table in Memory, and the Table Address is
passed as a Parameter in a Register.
3. Push (store) the Parameters onto the Stack by the Program, and Pop
off the Stack by Operating System.
Unit-I: Introduction 55
|<<
System Calls
• System Calls
• Types of System Calls
• System Programs
System Call Sequence
to Copy the contents of One file to another file.
Dr. D. S. R. Murthy 56
Unit-I: Introduction
|<<
Example of System Calls
12/21/2022 Unit-I: Introduction 57
The handling of a user application invoking the open() system call
12/21/2022 Unit-I: Introduction 58
Passing of Parameters as a table
Types of System Calls
1. Process Control
2. File Management
3. Device Management
4. Information Maintenance
5. Communications
Example
Unit-I: Introduction 59
|<<
• End, Abort
• Load, Execute
• Create Process, Terminate Process
• Get Process Attributes, Set Process Attributes
• Wait for time
• Wait Event, Signal Event
• Allocate and Free Memory
Unit-I: Introduction 60
|<<
System Calls – Process Control
• Create File, Delete File
• Open, Close
• Read, Write, Reposition
• Get File attributes, Set File attributes
Unit-I: Introduction 61
|<<
System Calls – File Management
• Request Device, Release Device
• Read, Write, Reposition
• Get Device attributes, Set Device attributes
• Logically Attach or Detach Devices
System Calls – Device Management
Unit-I: Introduction 62
• Get Time or Date, Set Time or Date
• Get System Data, Set System Data
• Get Process, File, or Device attributes
• Set Process, File, or Device attributes
|<<
System Calls – Information Maintenance
Message Passing Vs Shared Memory
• Create, Delete Communication connection
• Send, Receive Messages
• Transfer Status information
• Attach or Detach Remote Devices
System Calls – Communications
Unit-I: Introduction 63
System programs provide a convenient
environment for program development
and execution. They can be divided into:
Categories
1. Programming Language Support
2. Program Loading and Execution
3. File Management
4. File Modification
5. Status information
6. Communications
|<<
System Programs
System Calls
1. Process Control
2. File Management
3. Device Management
4. Information Maintenance
5. Communications
Unit-I: Introduction 64
|<<
• Compilers
• Assemblers
• Interpreters
System Programs – Programming Language Support
• Absolute Loaders
• Relocatable Loaders
• Linkage Editors
• Overlay Loaders
• Debugging Systems
System Programs – Program Loading & Execution
Unit-I: Introduction 65
• Print
• Dump
• List
• Manipulate Files and Directories
|<<
System Programs – File Management
• Create
• Delete
• Copy
• Rename
Text Editors
To Create and Modify the Contents of Files Stored on Disk or Tape.
Screen Editor – vi
Line Editor – edlin, ed, …
System Programs – File modification
Unit-I: Introduction 66
|<<
Date
Time
Amount of available Memory / Disk Space
No. of users..
•Some ask the system for info - date, time, amount of available memory, disk
space, 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
System Programs – Status information
Unit-I: Introduction 67
|<<
Provide mechanism for creating virtual connections
among processes, users and different computer systems.
Allow users to
Send messages to one another’s Screens.
Browse Web pages.
Send Electronic Mail messages.
Log-in Remotely.
Transfer Files from one machine to another.
System Programs – Communications
Operating System Structure
• General-purpose OS is very large program
• Various ways to structure ones
– Simple structure – MS-DOS
– More complex -- UNIX
– Layered – an abstraction
– Microkernel -Mach
Simple Structure -- MS-DOS
• MS-DOS – written to
provide the most
functionality in the least
space
– So, not divided into
modules carefully
– Although MS-DOS has
some structure, its
interfaces and levels of
functionality are not
well separated
• For instance, application programs are able to access
the basic I/O routines to write directly to the display
and disk drivers. Such freedom leaves MS-DOS
vulnerable to malicious programs, causing entire
system crashes when user programs fail.
• Ms-DOS is also limited by the hardware
Non Simple Structure -- UNIX
UNIX – initially, limited by hardware functionality, the original UNIX
operating system had limited structuring. The UNIX OS consists of two
separable parts
– Systems programs
– The kernel
• Consists of everything below the system-call interface and above
the physical hardware
• Provides the file system, CPU scheduling, memory management,
and other operating-system functions; a large number of functions
for one level
Traditional UNIX System Structure
Beyond simple but not fully layered
Layered Approach
• The operating system is
divided into a number of layers
(levels), each built on top of
lower layers. The bottom layer
(layer 0), is the hardware; the
highest (layer N) is the user
interface.
• With modularity, layers are
selected such that each uses
functions (operations) and
services of only lower-level
layers
Microkernel System Structure
• Moves as much from the kernel into user space. This method structures
the OS by removing all nonessential components from the kernel and
implementing them as system and user-level programs.
• Provide minimal process and memory management.
• Mach example of microkernel
– Mac OS X kernel (Darwin) partly based on Mach
• Communication takes place between user modules using message
passing
• Benefits:
– Easier to extend a microkernel
– Easier to port the operating system to new architectures
– More reliable (less code is running in kernel mode)
– More secure
• Detriments:
– Performance overhead of user space to kernel space communication
Microkernel System Structure
Application
Program
File
System
Device
Driver
Interprocess
Communication
memory
managment
CPU
scheduling
messages
messages
microkernel
hardware
user
mode
kernel
mode
Modules
• The best current methodology for operating-system design
involves object-oriented programming techniques to create a
modular kernel.
• Here the kernel has a set of core components and links in
additional services during boot time or during run time.
• Many modern operating systems implement loadable kernel
modules
– Uses object-oriented approach
– Each core component is separate
– Each talks to the others over known interfaces
– Each is loadable as needed within the kernel
• Overall, similar to layers but with more flexible
– Linux, Solaris, etc
Solaris Modular Approach
Hybrid Systems
• Most modern operating systems are actually not one pure model
– Hybrid combines multiple approaches to address
performance, security, usability needs
– Linux and Solaris kernels in kernel address space, so
monolithic, plus modular for dynamic loading of
functionality
– Windows mostly monolithic
• Apple Mac OS X uses hybrid structure. It is a layered system in
which one layer consists of the Mach microkernel.
• The top layers include application environments and a set of
services providing GI to applications. Below is the kernel
environment which consists Mach(memory management,
RPC, IPC,Thread scheduling, message passing).
BSD : provides CL interface, networking and file systems
Mac OS X Structure
iOS
• Apple mobile OS for iPhone, iPad
– Structured on Mac OS X, added
functionality
– Does not run OS X applications natively
• Also runs on different CPU architecture
(ARM vs. Intel)
– Cocoa Touch Objective-C API for
developing apps
– Media services layer for graphics, audio,
video
– Core services provides cloud computing,
databases
– Core operating system, based on Mac OS X
kernel
Android
• Developed by Open Handset Alliance (mostly Google)
– Open Source
• Similar stack to IOS
• Based on Linux kernel but modified
– Provides process, memory, device-driver management
– Adds power management
• Runtime environment includes core set of libraries and Dalvik
virtual machine
– Apps developed in Java plus Android API
• Java class files compiled to Java bytecode then translated
to executable than runs in Dalvik VM
• Libraries include frameworks for web browser (webkit), database
(SQLite), multimedia, smaller libc
Android Architecture
Applications
Application Framework
Android runtime
Core Libraries
Dalvik
virtual machine
Libraries
Linux kernel
SQLite openGL
surface
manager
webkit libc
media
framework
Exam Questions
1. Define OS.
2. Write about Evolution of Operating Systems.
3. Explain basic Structure of a Computer System & also Explain
its basic elements.
4. Discuss the basic components of a virtual computer.
5. What are OS Objectives?
6. What is an Operating System? Explain the functions of OS.
7. Discuss the various approaches of designing an operating
system.
8. Write about Multitasking.
9. Explain the concept of Multiprogramming.
Unit-I: Introduction 83
Exam Questions
10. What are the multi-tasking, multi-programming and multi-
threading?
11. Explain the following:
a. Multiprogramming
b. Timesharing
c. Virtual Memory
12. What are Distributed Operating Systems?
13. What are the types of real-time systems?
14. What is dispatcher?
15. What is a system call? Explain the categories of system calls.
16. What is a system program? Explain different types of system
programs.
|<<
Unit-I: Introduction 84

More Related Content

PPT
Memory Management in OS
PPTX
Introduction of Memory Management
PDF
Operating systems system structures
PDF
Deadlock Avoidance - OS
PPTX
Threads in Operating System | Multithreading | Interprocess Communication
PPTX
Distributed operating system
PDF
Semaphores
PDF
Monitors
Memory Management in OS
Introduction of Memory Management
Operating systems system structures
Deadlock Avoidance - OS
Threads in Operating System | Multithreading | Interprocess Communication
Distributed operating system
Semaphores
Monitors

What's hot (20)

PPTX
File system structure
PPT
Chapter 9 - Virtual Memory
PDF
Lecture 1 introduction to parallel and distributed computing
PPT
Chapter 1: Introduction to Operating System
PPTX
Virtual machine security
PDF
CS9222 ADVANCED OPERATING SYSTEMS
PPS
Interrupts
PPTX
Semaphore
PDF
Distributed Operating System_1
PPT
File models and file accessing models
PDF
Process Scheduling in OS
PPTX
Pram model
PPTX
Distributed computing
PDF
Slide05 Message Passing Architecture
PPT
Os Swapping, Paging, Segmentation and Virtual Memory
PDF
Lecture 3 parallel programming platforms
PPTX
Distributed Shared Memory
PPTX
Linux file system
PPTX
Memory management in operating system | Paging | Virtual memory
File system structure
Chapter 9 - Virtual Memory
Lecture 1 introduction to parallel and distributed computing
Chapter 1: Introduction to Operating System
Virtual machine security
CS9222 ADVANCED OPERATING SYSTEMS
Interrupts
Semaphore
Distributed Operating System_1
File models and file accessing models
Process Scheduling in OS
Pram model
Distributed computing
Slide05 Message Passing Architecture
Os Swapping, Paging, Segmentation and Virtual Memory
Lecture 3 parallel programming platforms
Distributed Shared Memory
Linux file system
Memory management in operating system | Paging | Virtual memory
Ad

Similar to OS-01.ppt (20)

PPTX
CSE3120- Module1 part 1 v1.pptx
PPT
cs-intro-os.ppt
PPT
Os concepts
PDF
4 Module - Operating Systems Configuration and Use by Mark John Lado
PDF
OS_MD_1.pdffffffffffffffffffffffffffffffffffffff
PDF
OS_MD_1.pdf
PPTX
chapter 1 introduction to operating system
PPT
EMBEDDED OS
PDF
Operating System Overview.pdf
PPT
unit1 part1.ppt
PDF
Unit I OS.pdf
PPTX
OperatingSystemFeature.pptx
PPTX
Unit_2_CSE111.pptx computer orientation project
PPTX
Unit 2.pptx
PPTX
Unit 2.pptx
PPTX
Unit_2_CSE111.pptx ctse cse 111f unit 2
PPTX
Operating System Unit 1
PPTX
The Fundamentals of Operating Systems .pptx
PPTX
Unit 1 ppt os jkhiutufyhfhtjdtrsdcjgnhb,
CSE3120- Module1 part 1 v1.pptx
cs-intro-os.ppt
Os concepts
4 Module - Operating Systems Configuration and Use by Mark John Lado
OS_MD_1.pdffffffffffffffffffffffffffffffffffffff
OS_MD_1.pdf
chapter 1 introduction to operating system
EMBEDDED OS
Operating System Overview.pdf
unit1 part1.ppt
Unit I OS.pdf
OperatingSystemFeature.pptx
Unit_2_CSE111.pptx computer orientation project
Unit 2.pptx
Unit 2.pptx
Unit_2_CSE111.pptx ctse cse 111f unit 2
Operating System Unit 1
The Fundamentals of Operating Systems .pptx
Unit 1 ppt os jkhiutufyhfhtjdtrsdcjgnhb,
Ad

Recently uploaded (20)

PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
Big Data Technologies - Introduction.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Electronic commerce courselecture one. Pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
A Presentation on Artificial Intelligence
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Encapsulation_ Review paper, used for researhc scholars
PPT
Teaching material agriculture food technology
PPTX
MYSQL Presentation for SQL database connectivity
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Big Data Technologies - Introduction.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Dropbox Q2 2025 Financial Results & Investor Presentation
The AUB Centre for AI in Media Proposal.docx
Unlocking AI with Model Context Protocol (MCP)
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
“AI and Expert System Decision Support & Business Intelligence Systems”
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Electronic commerce courselecture one. Pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
A Presentation on Artificial Intelligence
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Empathic Computing: Creating Shared Understanding
Encapsulation_ Review paper, used for researhc scholars
Teaching material agriculture food technology
MYSQL Presentation for SQL database connectivity

OS-01.ppt

  • 1. OPERATING SYSTEMS Course Objectives:  Learn basics of operating Systems.  Understand the process management and synchronization that take place in the operating system.  Learn the principles of memory, I/O and file management in a secured environment 12/21/2022 Unit-I: Introduction 1
  • 2. COURSE OUTCOMES: At the end of this course the student will be able to  Outline the basic functionalities and structure of the Operating System  Analyze various Process Scheduling algorithms, distinguish between various types of Operating systems like Windows and Linux.  Solve issues related to process Synchronization and Deadlocks in the Operating System  Demonstrate the concepts of Memory Management(Physical and Virtual memory)  Infer the directory structure and analyze disk management algorithms.  understand the concepts of I/O systems, protection and security 12/21/2022 Unit-I: Introduction 2
  • 3. Syllabus • UNIT I : Introduction to Operating System • UNIT II: Process Management • UNIT III: Process-Synchronization & Deadlocks • UNIT IV: Memory Management • UNIT V: File System • UNIT VI: I/O Systems 12/21/2022 Unit-I: Introduction 3
  • 4. UNIT–I: Introduction 1. Introduction to Operating System Concepts • Multitasking • Multiprogramming • Multiuser • Multithreading • Multi processing 2. Types of Operating Systems • Batch Operating System • Time–sharing Systems • Distributed OS • Network OS • Real–Time OS 3. Various Operating System Services 4. Architecture 5. System Calls and Programs Exam Questions Unit-I: Introduction 4
  • 5. |<< Introduction to Operating System Concepts • Prerequisites • Operating System (OS) • Resources of a Computer System • User View • System View • Objectives and Functions of OS • Multiprogramming • Multitasking • Multiuser • Multithreading Unit-I: Introduction 5
  • 6. • Data Structures • Computer Organisation • Any High–Level Language (C, …) Unit-I: Introduction 6 |<< Prerequisites
  • 7. Defn1: OS is software that manages computer hardware and software resources and provides common services for computer programs. (source: Wiki) Defn2: Controls and coordinates use of Hardware among Various Applications and Users Defn3:Collection of System Software (Programs), which makes it User friendly and Most efficient Kernel Program running at all times on the Computer Unit-I: Introduction 7 Operating System (OS)
  • 8. Kernel • Central module and Part of the OS that loads first, and it remains in main memory. • So, it has to be as small as possible while still providing all the essential services required by other parts of the operating system and applications. • Its loaded into a protected area of memory to prevent it from being overwritten by programs or other parts of the operating system. • Responsible for memory management, – process and task management, and – disk management. – The kernel connects the system hardware to the application software. • Every OS has a kernel. • For example the Linux kernel is used in numerous operating systems including Linux, FreeBSD, Android and others. Unit-I: Introduction 8
  • 9. • AT & T / BSD Unix • Sun Microsystems’ Solaris 2 Linux • Microsoft MS-DOS Windows 95 / 98 / NT Windows 2000 (Windows Me) Windows XP Windows Vista Windows 7 / Windows 8 Windows 10 • DEC VMS (Virtual Memory System) TOPS–20 (Total Operations Processing System) • IBM OS/2 • Apple Macintosh Unit-I: Introduction 9 |<< Most Popular Operating Systems
  • 10. • Hardware • Operating System • Application Programs • Users Unit-I: Introduction 10 Basic Structure/Components of a Computer System 1. Central Processing Unit (CPU) 2. Memory 3. Input–Output (I/O) / Peripheral Devices • Provides basic Computing Resources.
  • 11. Hardware and Software required to solve a problem CPU Time Memory Space File Storage Space I/O Devices … Unit-I: Introduction 11 |<< Resources of a Computer System Four Components of Computer System
  • 12. Varies according to the interface used Goal To maximize the work, the user is performing • Ease of use • Performance • Resource utilization Mainframe / Minicomputer • Share Resources • Exchange Information • Designed to maximize Resource utilization All Available CPU Time, Memory and I/O used efficiently Unit-I: Introduction 12 User View
  • 13. • Workstations (Perform Effective Resource Sharing) • Connected to Networks of other workstations and Servers • Dedicated Resources at disposal • Also Share Resources such as Networking and Servers (File, Compute, Print Servers) • Handheld Computers (Ease of use) • Standalone units for Individual users • Connected to Networks (Directly by wire / through wireless Modems and Networking) • Perform relatively few remote operations (Power, Speed, Interface limitations) • Designed mostly for individual usability • Embedded Computers in Home Devices and Automobiles (Performance) • Have Numeric Keypads • May turn indicator lights on or off to show status • Designed primarily to run without user intervention Unit-I: Introduction 13 User View (contd.)
  • 14. Most intimately involved with Hardware • Resource Allocator •Acts as Manager of Resources. •Decides to allocate Resources to Specific Programs and Users so that OS operates the Computer System Efficiently and Fairly •Important as many Users access the same Mainframe / Minicomputer • Control Program •Manages Execution of User Programs to prevent Errors and Improper use of Computer •Concerned with Operation and Control of I/O Devices Unit-I: Introduction 14 System View
  • 15. Essential part of a Computer System • Purpose: To provide an environment in which a User can Execute Programs in a Convenient and Efficient manner • Program that acts as an intermediary between the User of a Computer and the Computer Hardware • Must Ensure Correct Operation of Computer System • Provides Certain Services to Programs and users of those programs in order to make their Tasks Easier • Controls and Coordinates the use of Hardware among Various Application Programs for the Various users • Primary Goals- User friendly Efficient Operation of the Computer System Unit-I: Introduction 15 Objectives and Functions of Operating System
  • 16. Computer System Organization • Computer-system operation – One or more CPUs, device controllers connect through common bus providing access to shared memory – Concurrent execution of CPUs and devices competing for memory cycles
  • 17. Storage-Device Hierarchy •The higher levels are expensive, but are fast. •As we move down the hierarchy, the cost per bit decreases, where as Access time generally increases.
  • 18. Computer-System Architecture 1.Single-Processor Systems 2.Multi-Processor Systems 3.Clustered Systems Unit-I: Introduction 18
  • 19. Computer-System Architecture • Single Processor Systems – One CPU – May have other special-purpose processors (such as disk controllers) • Run a limited instruction set • Do not run user processes • Sometimes managed by OS • For example a disk controller processor receives a sequence of requests from the main CPU and implements its own disk queue and scheduling algorithm to relieve the main CPU of the overhead of disk scheduling.
  • 20. Multiprocessor systems • Two or more processors in close communication, sharing the computer bus and sometimes the clock, memory, and peripherals. • Advantages: – Increased throughput • The speed-up ratio with N processors is not N however, it is less than N. – Economy of scale • Sharing of peripherals, mass storage, power supplies. • Can cost less than multiple single-processor systems – Increased reliability • Graceful degredation(The ability to continue providing service proportional to the level of surviving hardware) • Fault tolerance – Failure detection, diagnose and correction – Hardware duplication(HP NonStop system)
  • 21. Multiprocessor Systems • Two types: – Asymmetric multiprocessing in which each processor is assigned a specific task. A master processor controls the system, scheduling and allocating work to slave processors. – Symmetric multiprocessing (SMP) in which each processor performs all tasks within the operating system. All processors are peers.
  • 23. Clustered Systems • Gather together multiple CPUs to accomplish computation • Composed of two or more individual systems coupled together. • High availability service. – Each node can monitor one or more of the others over the LAN. – If the monitored machine fails, the monitoring machine can take ownership of its storage and restart the applications that were running on the failed machine. • Structure – Asymmetric clustering: One machine is in hot-standby mode while the other is running applications. Hot-standby machine only monitors the active server. – Symmetric clustering:Two or more hosts are running applications and are monitoring each other • Parallel Clusters allow multiple hosts to access the same data on the shared storage. May need a distributed lock manager (DLM).
  • 24. • Single User System • Single Program in execution. Unit-I: Introduction 24 Uniprogramming
  • 25. Unit-I: Introduction 25 Multiprogramming Systems Multiprogramming is also the ability of an operating system to execute more than one program on a single processor machine. More than one task/program/job/process can reside into the main memory at one point of time. A computer running excel and firefox browser simultaneously is an example of multiprogramming.
  • 26. Time sharing is a logical extension of multiprogramming. In this, the CPU executes multiple jobs by switching among them, but the switches occur so frequently that the users can interact with each program while it is running. Response time should be < 1 second Each user has at least one program executing in memory process Job scheduling: Which jobs to bring to memory from job pool on disk. 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 (physical memory versus logical memory) Unit-I: Introduction 26 |<< Time Sharing
  • 27. • Multiple Tasks are performed during the Same period of time. • Tasks Share Common Processing Resources such as CPU and Main Memory. • In Uniprocessor Systems, Multitasking Solves the problem by Scheduling which task may be the one running at any given time, and when another waiting task gets a turn. Context Switch • Act of reassigning a CPU from one task to another one. Unit-I: Introduction 27 |<< Multitasking / Multiprocessing Allows for Multiple users to use the Same Computer in timely manner. Multiuser
  • 28. Unit-I: Introduction 28 Multitasking Multitasking is the ability of an operating system to execute more than one task simultaneously on a single processor machine. Though we say so but in reality no two tasks on a single processor machine can be executed at the same time. Actually CPU switches from one task to the next task so quickly that appears as if all the tasks are executing at the same time. More than one task/program/job/process can reside into the same CPU at one point of time.
  • 29. Unit-I: Introduction 29 Multiprocessing Multiprocessing is the ability of an operating system to execute more than one process simultaneously on a multi processor machine. In this, a computer uses more than one CPU at a time.
  • 30. Unit-I: Introduction 30 Multithreading Multithreading is the ability of an operating system to execute the different parts of a program called threads at the same time. Threads are the light wait processes which are independent part of a process or program. In multithreading system, more than one threads are executed parallely on a single CPU.
  • 31. • Batch Processing Systems • Interactive Systems • Time Sharing • Time Slicing • Distributed Systems • Network Systems • Real–Time Systems • Evolution of OS Unit-I: Introduction 31 Types of Operating Systems |<<
  • 32. Computer runs one and only one application at a time. In Batch processing same type of jobs batch (BATCH- a set of jobs with similar needs) together and execute at a time. The OS was simple, its major task was to transfer control from one job to the next. The job was submitted to the computer operator in form of punch cards. At some later time the output appeared. The OS was always resident in memory. Common Input devices were card readers and tape drives. Common output devices were Line printers ,Tape drives Card punches Unit-I: Introduction 32 Batch Processing Systems
  • 34. OS always resident in memory. CPU is often idle. User did not interact directly with computer systems. User prepared a job and submitted to computer operator. Operators batched together jobs with similar needs and run them through the computer as a group. Programmers would leave their programs with the operator. The operator would sort the programs into batches with similar requirements and as the computer became available would run each job. Unit-I: Introduction 34 |<< Batch Processing (during earlier days)
  • 36. • The User interacts directly with OS to supply commands and data as the application program executes and the user receives results of processing immediately. • User and Computer System interact. • User Requests. • System Responds. • The process goes on. Unit-I: Introduction 36 |<< Interactive Processing
  • 37. •There will be an user interface in place to allow all these to happen •It can be CLI or GUI Unit-I: Introduction 37
  • 38. Variable CPU Time to different processes. Once CPU Time is allocated to a process, will not be interrupted till it completes its execution, or waiting for an I/O, or cannot continue its execution. Unit-I: Introduction 38 |<< Time Sharing Equal Amount of CPU time allocated among Various Processes. Time Slicing
  • 39. • Distribute the Computation among Several Physical Processors Loosely Coupled System •Each Processor has its Own Local Memory. •Processors Communicate with one another through Various Communications lines, such as High–Speed buses or Telephone lines •Enables Parallelism but speed up is not the goal Advantages of Distributed Systems • Resources Sharing • Computation Speed up–load Sharing • Reliability • Communications Unit-I: Introduction 39 Distributed Systems
  • 44. Special purpose OS. Used when rigid time requirements have been placed on the operation of a processor or the flow of data. Used as control device in a dedicated application. Sensors bring data to the computer. The computer analyses the data and possibly adjust controls to modify the sensor inputs. Well-defined, Fixed-time constraints. Processing must be done within the defined constraints. Ex: Systems controlling scientific experiments Medical imaging systems Industrial control systems Certain display systems Automobile-engine fuel-injection systems Home-appliance controllers Weapon systems Unit-I: Introduction 44 Real–Time Systems
  • 45. Hard real-time systems Guarantee critical tasks be completed on time. Soft real-time systems Critical real-time task gets priority over other tasks and retains the priority until it completes. Ex: Multimedia Advanced scientific projects Undersea exploration Planetary rovers Unit-I: Introduction 45 |<< Types of Real–Time Systems
  • 47. Evolution of Operating Systems Unit-I: Introduction 47 |<<
  • 48. |<< Various Operating System Services Provides No. of Services. Lowest level – System Calls Allow running program to make requests from the OS directly. Higher level – Command Interpreter or Shell User issues request without writing program. Categories 1. Program Control 2. Status Requests 3. I/O Requests Unit-I: Introduction 48
  • 49. Operating System Services 1. User Interface 2. Program Execution 3. I/O Operations 4. File-System Manipulation 5. Communications 6. Error Detection Unit-I: Introduction 49 |<< – Other Services 1. Resource Allocation 2. Accounting 3. Protection and Security
  • 50. • All Operating Systems have User Interface (UI) • Command-Line Interface (CLI) • Graphics User Interface (GUI) Unit-I: Introduction 50 |<< User Interface • Load Program into Memory • Run the Program • End Execution, either Normally or Abnormally (indicating Error) Program Execution
  • 51. Running Program may require I/O, which may involve File or I/O Device. Unit-I: Introduction 51 I/O Operations |<< Programs need to Read and Write Files and Directories, Create and Delete Files and Directories, Search Files and Directories, List File Information, Permission Management. File–System Manipulation
  • 52. Processes may exchange information, on the Same Computer or between Computers over a Network Communications may be via – Shared Memory or – thru Message Passing (Packets moved by the Operating System) Unit-I: Introduction 52 Communications |<< Two ways of passing data between programs.
  • 53. • May occur in – the CPU and Memory Hardware, – I / O Devices, – 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 Unit-I: Introduction 53 Error Detection |<< When Multiple Users or Multiple Jobs running Concurrently, Resources must be Allocated to each of them. Resource Allocation
  • 54. To Keep Track of Which Users use How much What Kinds of Computer Resources To know Usage statistics. Unit-I: Introduction 54 Accounting |<< • 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 Protection and Security
  • 55. System Calls • Provides Interface between Running Program and the Operating System. • It provides as an interface to the services made available by an OS – These calls are generally available as routines written in C and C++, although certain low-level tasks, may need to be written using assembly-language instructions. • Methods used to Pass Parameters between a Running Program and the Operating System. 1. Pass Parameters in Registers. 2. Store the Parameters in a Table in Memory, and the Table Address is passed as a Parameter in a Register. 3. Push (store) the Parameters onto the Stack by the Program, and Pop off the Stack by Operating System. Unit-I: Introduction 55 |<< System Calls • System Calls • Types of System Calls • System Programs
  • 56. System Call Sequence to Copy the contents of One file to another file. Dr. D. S. R. Murthy 56 Unit-I: Introduction |<< Example of System Calls
  • 57. 12/21/2022 Unit-I: Introduction 57 The handling of a user application invoking the open() system call
  • 58. 12/21/2022 Unit-I: Introduction 58 Passing of Parameters as a table
  • 59. Types of System Calls 1. Process Control 2. File Management 3. Device Management 4. Information Maintenance 5. Communications Example Unit-I: Introduction 59 |<<
  • 60. • End, Abort • Load, Execute • Create Process, Terminate Process • Get Process Attributes, Set Process Attributes • Wait for time • Wait Event, Signal Event • Allocate and Free Memory Unit-I: Introduction 60 |<< System Calls – Process Control
  • 61. • Create File, Delete File • Open, Close • Read, Write, Reposition • Get File attributes, Set File attributes Unit-I: Introduction 61 |<< System Calls – File Management • Request Device, Release Device • Read, Write, Reposition • Get Device attributes, Set Device attributes • Logically Attach or Detach Devices System Calls – Device Management
  • 62. Unit-I: Introduction 62 • Get Time or Date, Set Time or Date • Get System Data, Set System Data • Get Process, File, or Device attributes • Set Process, File, or Device attributes |<< System Calls – Information Maintenance Message Passing Vs Shared Memory • Create, Delete Communication connection • Send, Receive Messages • Transfer Status information • Attach or Detach Remote Devices System Calls – Communications
  • 63. Unit-I: Introduction 63 System programs provide a convenient environment for program development and execution. They can be divided into: Categories 1. Programming Language Support 2. Program Loading and Execution 3. File Management 4. File Modification 5. Status information 6. Communications |<< System Programs System Calls 1. Process Control 2. File Management 3. Device Management 4. Information Maintenance 5. Communications
  • 64. Unit-I: Introduction 64 |<< • Compilers • Assemblers • Interpreters System Programs – Programming Language Support • Absolute Loaders • Relocatable Loaders • Linkage Editors • Overlay Loaders • Debugging Systems System Programs – Program Loading & Execution
  • 65. Unit-I: Introduction 65 • Print • Dump • List • Manipulate Files and Directories |<< System Programs – File Management • Create • Delete • Copy • Rename Text Editors To Create and Modify the Contents of Files Stored on Disk or Tape. Screen Editor – vi Line Editor – edlin, ed, … System Programs – File modification
  • 66. Unit-I: Introduction 66 |<< Date Time Amount of available Memory / Disk Space No. of users.. •Some ask the system for info - date, time, amount of available memory, disk space, 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 System Programs – Status information
  • 67. Unit-I: Introduction 67 |<< Provide mechanism for creating virtual connections among processes, users and different computer systems. Allow users to Send messages to one another’s Screens. Browse Web pages. Send Electronic Mail messages. Log-in Remotely. Transfer Files from one machine to another. System Programs – Communications
  • 68. Operating System Structure • General-purpose OS is very large program • Various ways to structure ones – Simple structure – MS-DOS – More complex -- UNIX – Layered – an abstraction – Microkernel -Mach
  • 69. Simple Structure -- MS-DOS • MS-DOS – written to provide the most functionality in the least space – So, not divided into modules carefully – Although MS-DOS has some structure, its interfaces and levels of functionality are not well separated
  • 70. • For instance, application programs are able to access the basic I/O routines to write directly to the display and disk drivers. Such freedom leaves MS-DOS vulnerable to malicious programs, causing entire system crashes when user programs fail. • Ms-DOS is also limited by the hardware
  • 71. Non Simple Structure -- UNIX UNIX – initially, limited by hardware functionality, the original UNIX operating system had limited structuring. The UNIX OS consists of two separable parts – Systems programs – The kernel • Consists of everything below the system-call interface and above the physical hardware • Provides the file system, CPU scheduling, memory management, and other operating-system functions; a large number of functions for one level
  • 72. Traditional UNIX System Structure Beyond simple but not fully layered
  • 73. Layered Approach • The operating system is divided into a number of layers (levels), each built on top of lower layers. The bottom layer (layer 0), is the hardware; the highest (layer N) is the user interface. • With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers
  • 74. Microkernel System Structure • Moves as much from the kernel into user space. This method structures the OS by removing all nonessential components from the kernel and implementing them as system and user-level programs. • Provide minimal process and memory management. • Mach example of microkernel – Mac OS X kernel (Darwin) partly based on Mach • Communication takes place between user modules using message passing • Benefits: – Easier to extend a microkernel – Easier to port the operating system to new architectures – More reliable (less code is running in kernel mode) – More secure • Detriments: – Performance overhead of user space to kernel space communication
  • 76. Modules • The best current methodology for operating-system design involves object-oriented programming techniques to create a modular kernel. • Here the kernel has a set of core components and links in additional services during boot time or during run time. • Many modern operating systems implement loadable kernel modules – Uses object-oriented approach – Each core component is separate – Each talks to the others over known interfaces – Each is loadable as needed within the kernel • Overall, similar to layers but with more flexible – Linux, Solaris, etc
  • 78. Hybrid Systems • Most modern operating systems are actually not one pure model – Hybrid combines multiple approaches to address performance, security, usability needs – Linux and Solaris kernels in kernel address space, so monolithic, plus modular for dynamic loading of functionality – Windows mostly monolithic • Apple Mac OS X uses hybrid structure. It is a layered system in which one layer consists of the Mach microkernel. • The top layers include application environments and a set of services providing GI to applications. Below is the kernel environment which consists Mach(memory management, RPC, IPC,Thread scheduling, message passing). BSD : provides CL interface, networking and file systems
  • 79. Mac OS X Structure
  • 80. iOS • Apple mobile OS for iPhone, iPad – Structured on Mac OS X, added functionality – Does not run OS X applications natively • Also runs on different CPU architecture (ARM vs. Intel) – Cocoa Touch Objective-C API for developing apps – Media services layer for graphics, audio, video – Core services provides cloud computing, databases – Core operating system, based on Mac OS X kernel
  • 81. Android • Developed by Open Handset Alliance (mostly Google) – Open Source • Similar stack to IOS • Based on Linux kernel but modified – Provides process, memory, device-driver management – Adds power management • Runtime environment includes core set of libraries and Dalvik virtual machine – Apps developed in Java plus Android API • Java class files compiled to Java bytecode then translated to executable than runs in Dalvik VM • Libraries include frameworks for web browser (webkit), database (SQLite), multimedia, smaller libc
  • 82. Android Architecture Applications Application Framework Android runtime Core Libraries Dalvik virtual machine Libraries Linux kernel SQLite openGL surface manager webkit libc media framework
  • 83. Exam Questions 1. Define OS. 2. Write about Evolution of Operating Systems. 3. Explain basic Structure of a Computer System & also Explain its basic elements. 4. Discuss the basic components of a virtual computer. 5. What are OS Objectives? 6. What is an Operating System? Explain the functions of OS. 7. Discuss the various approaches of designing an operating system. 8. Write about Multitasking. 9. Explain the concept of Multiprogramming. Unit-I: Introduction 83
  • 84. Exam Questions 10. What are the multi-tasking, multi-programming and multi- threading? 11. Explain the following: a. Multiprogramming b. Timesharing c. Virtual Memory 12. What are Distributed Operating Systems? 13. What are the types of real-time systems? 14. What is dispatcher? 15. What is a system call? Explain the categories of system calls. 16. What is a system program? Explain different types of system programs. |<< Unit-I: Introduction 84