GM OS Week1

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 34

• OPERATING SYSTEMS

(BCS303)

Dr Geetha C Megharaj
Prof. & HOD
Department of CSE(AI&ML)
Dr. T. Thimmaiah Institute of
Technology

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


• SYLLABUS

• LESSON PLAN

• TEXT BOOK

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Chapter 1: Introduction
Chapter 1: Introduction
• What Operating Systems Do
• Computer-System Organization
• Computer-System Architecture
• Operating-System Structure
• Operating-System Operations
• Process Management
• Memory Management
• Storage Management
• Protection and Security
• Distributed Systems
• Special-Purpose Systems
• Computing Environments
• Open-Source Operating Systems
Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024
What is an Operating System?
• A system program acts as an intermediary between
a user and the computer hardware
• Operating system goals:
• Execute user programs, ensures user problems
solved easily
• Make the computer system convenient to use
• Use the computer hardware in an efficient
manner
Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024
Computer System Structure
• Components of Computer system:
• Hardware –basic computing resources -CPU, memory,
I/O devices
• Operating system
• Controls and coordinates use of hardware among
various applications and users
• Application programs –the system resources are used to
solve users computing problems - Word processors,
compilers, web browsers, database systems, video games
• Users
Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024
Components of Computer System

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


What Operating Systems Do
• OS can be viewed from two viewpoints– User views &
System views

• User Views:-The user’s view of the OS depends on the type of


user.
• Users of standalone system, OS is designed for ease of use
and high performances. Resource utilization is not given
importance.
• Users working on terminals connected to a mainframe or
minicomputers, sharing information and resources, the OS is
designed to maximize resource utilization.
• OS is designed to use CPU time, memory and i/o efficiently.
Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024
What Operating Systems Do

• Users are in workstations, connected to networks and


servers, having their own system and shares resources
and files with other systems, OS is designed for ease of
use and resource availability (files).
• Embedded systems like washing M/C & automobiles do
not have any user interaction. LEDs/Beep sound to show
the status of its work
• OS for hand held systems designed for ease of use and
performance per amount of battery life

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


What Operating Systems Do
• System Views:- Operating system can be viewed as a resource
allocator and control program.

• Resource allocator - Manages of hardware and software


resources.
• Such as CPU time, memory space, file-storage space, I/O devices,
shared files etc..
• The OS assigns the resources to the requesting program depending
on the priority, avoids conflicts

• Control Program – OS is a control program, manage execution of


user program to prevent errors and improper use of the computer.

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Operating System Definition

• OS is a resource allocator
• Manages all resources
• Decides between conflicting requests for efficient and fair
resource use
• OS is a control program
• Controls execution of programs to prevent errors and improper
use of the computer

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Operating System Definition (Cont.)

• “The one program running at all times on the


computer” is the kernel.

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Computer Startup

• bootstrap program is loaded at power-up or


reboot
• Stored in ROM known as firmware
Initializes the registers, memory and I/O
devices
Locates & loads kernel into memory
Starts the first process ‘init’ process , Waits
for interrupt from user

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


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
• Memory controller synchronize access to memory

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Computer-System Operation
• I/O devices and the CPU can execute concurrently
• Each device has device controller
• Device controller has a local buffer
• CPU moves data from/to main memory to/from local
buffers
• Device controller communicates CPU through an interrupt

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Functions of Interrupts
• Interrupt transfers control to the interrupt service routine,
through the interrupt vector, which contains the
addresses of all the service routines
• Interrupt architecture must save the address of the
interrupted instruction
• Incoming interrupts are disabled while another interrupt
is being processed to prevent a lost interrupt
• A trap is a software-generated interrupt caused either by
an error or a user request
• An operating system is interrupt driven

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Interrupt Handling
• The operating system preserves the state of the CPU by
storing registers and the program counter

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Storage Structure
• Main memory – only large storage that the CPU can
access directly
• Random access
• Volatile
• Semiconductor Technology
• Each Byte/word addressable
• Load/Store Instructions [Registers/Main memory]
• Von Neumann Architecture: Instruction Execution cycle: 1. Fetch
Instruction
• 2. Decode
• 3. Fetch operands from memory to registers
• 4 Execution
• 5. Store results back to memory
Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024
Storage Structure
• Secondary storage –
• extension of main memory
• provides large nonvolatile storage capacity
• Magnetic disks –Disk surface is logically divided
into tracks, which are subdivided into sectors
• The disk controller determines the interaction
between the device and the computer

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Storage Hierarchy
• Storage systems organized in hierarchy
• Speed
• Cost
• Volatility

• Caching – Information stored into cache for faster access.

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Storage-Device Hierarchy

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Caching
• Information in use copied from slower to cache
temporarily
• Cache checked first for the required information
• If present, information used directly from the cache
(fast)
• If not, data copied to cache and used
• Cache smaller than storage being cached
• Cache management important design problem
• Cache size and replacement policy

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


How a Modern Computer Works

A von Neumann architecture

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


I/O Structure
• Computer system has many CPUs, multiple device
controllers connected through common Bus
• Each device controller is in charge of specific device
• A device controller maintains local buffer and few
special purpose registers
• Device controller responsible for moving data between
device and local buffer
• OS has device driver for each device controller

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Interrupt driven I/O Operation

• Device driver loads appropriate registers within device


controller
• Device controller examines contents of the registers to
determine action to be taken
• Controller starts transferring data from device to local buffer
• Once transfer is complete , device controller informs device
driver via interrupt
• The device driver returns control to OS returning data read
• Causes overhead for bulk data transfer
• To solve DMA used

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Direct Memory Access Structure
• Used for high-speed I/O devices
• Device controller transfers blocks of data from buffer
storage directly to main memory without CPU intervention
• Only one interrupt is generated per block, rather than the
one interrupt per byte

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Computer-System Architecture
• Single general-purpose processor
• one main CPU capable of executing instructions from
user processes.
• Has special-purpose processors, device-specific
processors, for devices such as disk, keyboard, and
graphics controllers.
• Special-purpose processors run limited instructions and
do not run user processes, managed by the operating
system;
• Ex. Special processors in the keyboard, converts the
keystrokes into codes to be sent to the CPU.
Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024
Computer-System Architecture

• Multiprocessors systems
• Have two or more processors, share the computer bus, the
clock, memory, and peripheral devices are the
multiprocessor systems.

• Also known as parallel systems, tightly-coupled systems


• Advantages include:
1. Increased throughput
2. Economy of scale : cost less than equivalent single processor
system, resources shared
3. Increased reliability – graceful degradation or fault tolerance

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Computer-System Architecture
• Two types:
1. Asymmetric Multiprocessing : (Master/Slave architecture)
Master processor assigns specific task to each of the processors.
Master processor controls the other processors. It
schedules and allocates work to the slave processors.
2. Symmetric Multiprocessing
All the processors are considered as peers. There is no master-
slave relationship. All the processors have its own registers and
CPU, only memory is shared.

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Multiprogramming

• Multiprogramming
• 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 the selected job has to wait (for I/O), OS switches
to another job

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Memory Layout for Multiprogrammed System

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Timesharing
• Timesharing (Multitasking)
• Logical extension of multiprogramming
• Many users share computer simultaneously
• Interactive : Provides direct interaction between users
and the system
• Each user has impression that entire system dedicated
to his use

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024


Dual Mode Operation
• To ensure error free execution OS code and user codes are
differentiated
• The system works in two separate modes of operation:
• Dual-mode
• User mode and kernel mode (supervisor mode, system mode,
or privileged mode).
• A hardware bit, the mode bit, used to indicate the current mode:
kernel (0) or user (1).
• With the mode bit, user tasks and operating system tasks are
distinguished.
• When the computer system is executing a user application, the
system is in user mode. When a user application requests a service
from the operating system (via a system call), the transition from
user to kernel
Dr Geetha C Megharaj mode takes place.
CSE(AI&ML), Dr.TTIT 04/18/2024
Transition from User to Kernel Mode

Dr Geetha C Megharaj CSE(AI&ML), Dr.TTIT 04/18/2024

You might also like