SlideShare a Scribd company logo
Introduction to OS
•   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


                   Loganathan R, CSE,HKBKCE   1
1. What Operating System Do
• 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



                      Loganathan R, CSE,HKBKCE                      2
Components of a Computer System




        Loganathan R, CSE,HKBKCE   3
OS Role from 2 Viewpoints
• 1.1 User View
       •   Varies according to the Inter Face Used
       •   Single User I/F: Ease of Use
       •   Terminal User I/F: Resource(shared) Utilization
       •   Workstation User I/F: Dedicated & Shared Resource
       •   Handheld System User I/F : Individual Usability
       •   Embedded Computers : Little/No user view
• 1.2 System View
  – OS is a resource allocator
    –Manages all resources (CPU time, memory space, file-storage space, I/O devices)
    –Decides between conflicting requests for efficient and fair resource use
  – OS is a control program
    –Manages the execution of user programs to prevent errors and
    improper use of the computer
    –Concerned with the operation and control of I/O devices.

                             Loganathan R, CSE,HKBKCE                            4
1.3. OS Definition
  No universally accepted definition
• An operating system is a program that manages the
   computer hardware, provides a basis for application
   programs and acts as an intermediary between the
   computer user and the computer hardware
  “Everything a vendor ships when you order an
   operating system” is good approximation
  ◦ But varies wildly
 “The one program running at all times on the
  computer” is the kernel. Everything else is either a
  system program (ships with the operating system) or
  an application program

                        Loganathan R, CSE,HKBKCE    5
2. Computer System Organization
• 2.1 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
   – During Power up/ Reboot, it needs to have a initial program to run
     called Bootstrap Program




                       Loganathan R, CSE,HKBKCE                      6
Bootstrap Program
  Typically stored in ROM or EPROM, generally known as firmware
  Initializes all aspects of the system from CPU registers to device controllers
   to memory contents
  Loads operating system kernel and starts execution and waits for an Event
• An event is usually signaled by an interrupt from either the hardware or
   the software
• Hardware may trigger an interrupt at any time by sending a signal to the
   CPU
• Software may trigger an interrupt by executing a special operation called a
   system call (also called a monitor call)




                             Loganathan R, CSE,HKBKCE                         7
Functions of Interrupts
  When interrupted, CPU stops what it is doing and immediately
   transfers execution to a fixed location, which contains the starting
   address where the service routine for the interrupt is located
• The interrupt service routine executes, on completion, the CPU
   resumes the interrupted computation.
• A time line of this operation is shown




                          Loganathan R, CSE,HKBKCE                        8
Interrupt Handling
• Table of pointers is stored in low memory locations hold the addresses
   of the interrupt service routines for the various devices.
• This array, or interrupt vector, of addresses is then indexed by a unique
   device number, given with the interrupt request, to provide the address
   of the interrupt service routine for the interrupting device
  Interrupt architecture must save the address of the interrupted
   instruction on the system stack.
• After the interrupt is serviced, the saved return address is loaded into
   the program counter, and the interrupted computation resumes as
   though the interrupt had not occurred
  A trap is a software-generated interrupt caused either by an error or a
   user request.
  An operating system is interrupt driven.




                           Loganathan R, CSE,HKBKCE                           9
2.2 Storage Structure
• Computer programs to be executed must be in main memory RAM,
  Which is the only large storage area that the CPU can access directly
• It is implemented in a semiconductor technology called dynamic
  random-access memory (DRAM)
• Each word has its own address & interaction is through a load or store
  instructions
• A typical instruction-execution cycle, fetches an instruction from
  memory and stores in the instruction register, then decoded and may
  cause operands to be fetched from memory and has been executed,
  the result may be stored back in memory
• To reside the programs and data in main memory permanently is not
  possible for the following two reasons:
    – 1. Main memory is usually too small to store all needed programs and data
      permanently.
    – 2. Main memory is a volatile storage device that loses its contents when
      power is turned off or otherwise lost
 Secondary storage(Magnetic disks, CD-ROM, Magnetic tapes) – is
  extension of main memory that provides large nonvolatile storage
  capacity.


                           Loganathan R, CSE,HKBKCE                           10
Storage-Device Hierarchy
   Storage systems organized in hierarchy according to
    speed, cost and volatility



                                                Volatile


      N
      o
      n
      v
      o
      l
      a
      t
      i
      l
      e              Loganathan R, CSE,HKBKCE              11
2.3 I/O Structure
• A general-purpose computer system consists of CPUs and
  multiple device controllers that are connected through a
  common bus.
• Depending on the controller, there may be more than one
  attached device SCSI -8
• The device controller is responsible for moving the data
  between the peripheral devices that it controls and its local
  buffer storage
• device driver for each device controller presents a uniform
  interface to the device to the rest of the operating system




                       Loganathan R, CSE,HKBKCE                   12
I/O operation
• Interrupt-driven I/O
   – For moving small amount of data
   – The device controller, examines the contents of the registers to
     determine what action to take.
   – The controller starts the transfer of data from the device to its
     local buffer
   – Once the transfer of data is complete, the device controller
     informs the device driver via an interrupt that it has finished its
     operation
 Direct memory access
   – For bulk data movement such as disk I/O
   – After setting up buffers, pointers, and counters for the I/O
     device, the device controller transfers an entire block of data
     directly to or from its own buffer storage to memory, with no
     intervention by the CPU
   – Only one interrupt is generated per block, rather than the one
     interrupt per byte.
                         Loganathan R, CSE,HKBKCE                     13
Direct memory access




   Loganathan R, CSE,HKBKCE   14
3. Computer-System Architecture
• 3.1 Single-Processor Systems
  – Most systems are single processor and range from PDAs
    through mainframes
  – One main CPU capable of executing a general-purpose
    instruction set
  – Special-purpose processors are device-specific processors,
    such as disk, keyboard, and graphics controllers with
    Limited Instruction Set
  – Example:
     • PCs contain a microprocessor in the keyboard to convert the
       keystrokes into codes to be sent to the CPU
  – If there is only one general-purpose CPU, then the system is
    a single-processor system.

                     Loganathan R, CSE,HKBKCE                 15
3.2 Multiprocessor Systems
• Multiprocessor systems also known as parallel systems or
  tightly coupled systems have two or more processors in close
  communication, sharing the computer bus and sometimes the
  clock, memory, and peripheral devices
• Advantages
   – 1. Increased throughput: speed-up ratio with N processors is less than
     N due to overhead in keeping all the parts working
   – 2. Economy of scale :            Multiprocessor systems can cost less than
     equivalent multiple single-processor systems, because they can share
     peripherals, mass storage, and power supplies
   – 3. Increased reliability :The failure of one processor will not halt the
     system




                           Loganathan R, CSE,HKBKCE                       16
Reliability
• The ability to continue providing service
  proportional to the level of surviving hardware is
  called graceful degradation
• Some systems go beyond graceful degradation and
  are called fault tolerant, because they can suffer a
  failure of any single component and still continue
  operation
• Fault tolerance requires a mechanism to allow the
  failure to be detected, diagnosed, and, if possible,
  corrected

                  Loganathan R, CSE,HKBKCE         17
Types of Multiprocessor Systems
• Asymmetric multiprocessing
 – A master processor controls the system; the other processors
   either look to the master for instruction or have predefined
   tasks
 – The master processor schedules and allocates work to the slave
   processors
• Symmetric multiprocessing (SMP)
 – Each processor performs all tasks within the operating system,
   all processors are peers
 – SMP architecture:




                       Loganathan R, CSE,HKBKCE                18
Types of Multiprocessor Systems
• Multiple cores
 – Multiple compute cores on a single chip
 – Multi-core CPUs look to the OS just as N standard processors
• Blade servers
 – Multiple processor boards, I/O boards, and networking boards are
   placed in the same chassis
 – Each blade-processor board boots independently and runs its own OS
• Difference between SMP and asymmetric
  multiprocessing
   – Special hardware can differentiate the multiple processors,
     or the software can be written to allow only one master
     and multiple slaves

                         Loganathan R, CSE,HKBKCE                 19
3.3 Clustered Systems
• Gather together multiple CPUs to accomplish computational work
• Composed of two or more individual systems coupled together
• Accepted definition
    – Clustered computers share storage and are closely linked via a local-area
      network (LAN) or a faster interconnect such as InfiniBand
• provides high-availability service through a level of redundancy
• Asymmetric clustering, one machine is in hot-standby mode while the
  other is running the applications
• Symmetric mode, two or more hosts are running applications, and are
  monitoring each other
• Parallel clusters and clustering over a wide-area network (WAN) allow
  multiple hosts to access the same data on the shared storage, to provide
  this, the system needs an access control and locking to ensure that no
  conflicting operations occur and this function is known as distributed lock
  manager (DLM)
• Storage-area networks (SANs), which allow many systems to attach to a
  pool of storage
                           Loganathan R, CSE,HKBKCE                        20
4. Operating System Structure
 Single user cannot keep CPU and I/O
  devices busy at all times
• Multiprogramming         needed    for
  efficiency
 – 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
                      Loganathan R, CSE,HKBKCE   21
Operating System Structure contd..
• Timesharing / Multitasking in which CPU switches jobs so
  frequently that users can interact with each job while it is
  running, creating interactive computing
   – Response time should be < 1 second
   – Each user has at least one program executing in memory process
   – If several jobs ready to run at the same time  CPU scheduling
   – If several jobs are ready to be brought into memory, and if there is
     not enough room for all of them Job 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
   – advantage of the virtual-memory scheme is it enables to run
     programs that are larger than actual physical memory



                         Loganathan R, CSE,HKBKCE                    22
5. Operating-System Operations
 OS are Interrupt driven and Events are signaled by Interrupt or trap (or exception)
  ◦ Division by zero, request for operating system service
 Other process problems include infinite loop, processes modifying each other or the
  operating system
 5.1 Dual-mode operation allows OS to protect itself and other system components
 ◦ User mode - Executing user application
 ◦ kernel mode ( Supervisor / System / Privileged) – Boot time / System call
 ◦ Mode bit indicates current mode (0-Kernal, 1-User) provided by hardware




                             Loganathan R, CSE,HKBKCE                           23
5.2 Timer
• Timer to prevent infinite loop / process hogging resources
   – Set interrupt after specific period
   – A variable timer is generally implemented by a fixed-rate
     clock and a counter
   – Operating system decrements counter
   – When counter reach zero an interrupt generated
   – Set up before scheduling process to regain control or
     terminate program that exceeds allotted time




                      Loganathan R, CSE,HKBKCE             24
6. Process Management
• A process is a program in execution. It is a unit of work within the
  system i.e. a job or a time-shared program
• 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 process, some are OS
  process running concurrently on one or more CPUs
   – Concurrency by multiplexing the CPUs among the processes /
      threads


                        Loganathan R, CSE,HKBKCE                     25
Process Management Activities
The operating system activities                       in
connection with process management:
   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




                   Loganathan R, CSE,HKBKCE           26
7. Memory Management
• All data in memory before and after processing
• All instructions in memory in order to execute
• Memory management determines what is in memory 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




                     Loganathan R, CSE,HKBKCE             27
8.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)
 8.1 File-System management
  •   A File is a collection of information defined by its creator usually
      organized into directories
  •   The OS implements the abstract concept of a file by managing mass
      storage media and the devices that control them
  •   OS activities in connection with file management
         • Creating and deleting files
         • Creating and deleting directories to organize files
         • Primitives to manipulate files and directories
         • Mapping files onto secondary storage
         • Backup files onto stable (non-volatile) storage media
                         Loganathan R, CSE,HKBKCE                    28
8.2 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 in connection with disk management
   – Free-space management
   – Storage allocation
   – Disk scheduling
• Some storage need not be fast for backup of disk data
   – Tertiary storage includes optical storage, magnetic tape, platters
   – Varies between WORM (write-once, read-many-times) and RW (read-
      write)
   – It is not crucial to system performance, but it still must be managed

                         Loganathan R, CSE,HKBKCE                      29
8.3 Caching
• Important principle, performed at many levels in a computer
  (in hardware, operating system, software)
• Information in use copied from slower to faster storage
  temporarily
• Faster storage (cache) checked first to determine if
  information is there
   – If it is, information used directly from the cache (fast)
   – else, data copied to cache and used there
• Cache smaller than storage being cached
   – Cache management important design problem
   – Cache size and replacement policy


                     Loganathan R, CSE,HKBKCE              30
Performance of Various Levels of Storage
• Movement between levels of storage hierarchy can
  be explicit or implicit




                 Loganathan R, CSE,HKBKCE        31
Migration of 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



                      Loganathan R, CSE,HKBKCE                32
8.4 I/O Subsystem
  One purpose of OS is to hide peculiarities of
   hardware devices from the user
• Peculiarities of I/O devices are hidden from the
   operating system itself by the I/O subsystem
  I/O subsystem components
  ◦ A Memory management component that includes
    buffering, caching and spooling
  ◦ A General device-driver interface
  ◦ Drivers for specific hardware devices
 Only the device driver knows the peculiarities of
  the specific device

                Loganathan R, CSE,HKBKCE        33
9. 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

                        Loganathan R, CSE,HKBKCE                     34
10 Distributed Systems
•   A distributed system is a collection of physically separate, possibly
    heterogeneous computer systems that are networked to provide the users with
    access to the various resources
•   Access to a shared resource increases computation speed, functionality, data
    availability, and reliability
•   Distributed systems functionality depend on networking
•   Networks vary by the protocols used, the distances between nodes and the
    transport media
•   TCP/IP is the most common network protocol, although ATM and other
    protocols (UDP) are in widespread use
•   Networks are characterized based on the distances between their nodes such
    as LAN,WAN, MAN and Small-Area Network(home)
•   The media to carry networks are equally varied that include copper wires, fiber
    strands, and wireless transmissions between satellites, microwave dishes, and
    radios
•   A network OS provides features such as file sharing across the network and
    that includes a communication scheme that allows different processes on
    different computers to exchange messages
                             Loganathan R, CSE,HKBKCE                         35
11 Special-Purpose Systems
• 11.1 Real-Time Embedded Systems
   – Embedded computers found everywhere, from car engines and manufacturing robots to
     VCRs and microwave ovens and expanding
   – Embedded systems almost always run real-time OS, which is used when there is a rigid
     time requirements, i.e. processing must be done within the defined constraints
   – used as a control device in sensors, scientific experiment, medical imaging, industrial
     control, display, automobile-engine fuel-injection, home-appliance, weapon systems
• 11.2 Multimedia Systems
   – Multimedia data consist of audio and video files as well as conventional files
   – Multimedia data, live webcasts, must be streamed according to certain time restrictions
     eg. 30 frames per second
   – A stock trader may have stock quotes delivered wirelessly and in real time to his PDA.
• 11.3 Handheld Systems
   – personal digital assistants (PDAs), such as Palm and Pocket-PCs, and cellular phones,
   – Limitation
        • Physical memory in a handheld is typically 512 KB to 128 MB
        • Speed of the processor , Faster processors require more power
        • I/O lack of physical space limits I/O methods to small keyboards, handwriting recognition, or
          small screen-based keyboards and small screens (web clipping is used)




                                  Loganathan R, CSE,HKBKCE                                        36
12. Computing Environments
• 12.1Traditional computing
   – Office environment
    • PCs connected to a network, terminals attached to mainframe or minicomputers
      providing batch and timesharing, awkward Remote access and portability
    • Now portals allowing networked and remote systems access to same resources
   – Home networks
    • Used to be single system, then modems and now firewalled, networked
   – Traditional time-sharing systems are uncommon
• 12.2 Client-Server Computing
   –    Dump Terminals are supplemented for PCs
   –    Server systems to satisfy requests generated by client systems
    •   Compute-server provides an interface to client to request services (i.e. database)
    •   File-server provides interface for clients to store and retrieve files




                                   Loganathan R, CSE,HKBKCE                                  37
12. Computing Environments contd..
• 12.3 Peer-to-Peer Computing
  – Another model of distributed system
  – P2P does not distinguish clients and servers
   • Instead all nodes are considered peers
   ◦ May each act as client, server or both
   ◦ Node must join P2P network and
     – Registers its service with central lookup service on network, or
     – Broadcast request for service and respond to requests for service via
       discovery protocol
   ◦ Examples include Napster and Gnutella
• 1.12.4 Web-Based Computing
  – Web has become everywhere and PCs most common devices
  – More devices becoming networked to allow web access
  – New category of devices to manage web traffic among similar servers:
    load balancers
  – Use of operating systems like Windows 95, client-side, have evolved into
    Linux and Windows XP, which can be clients and servers

                            Loganathan R, CSE,HKBKCE                           38

More Related Content

PPT
Kernel mode vs user mode in linux
PPTX
What is Kernel, basic idea of kernel
PDF
Linux for embedded_systems
PPT
Kernal
PPT
Driver development – memory management
PPT
Windows kernel
PDF
2 operating system structures
PPT
Introduction to System Calls
Kernel mode vs user mode in linux
What is Kernel, basic idea of kernel
Linux for embedded_systems
Kernal
Driver development – memory management
Windows kernel
2 operating system structures
Introduction to System Calls

What's hot (20)

PPTX
Operating system 11 system calls
PPT
System programs in o.s. for bca and bscit students by hardik nathani
PPTX
Operating system kernal
PDF
Board support package_on_linux
PPT
Device Driver in WinCE 6.0 R2
PPT
Windows Kernel-
PDF
Cs8493 unit 5
PPTX
Windows Architecture Explained by Stacksol
PPT
PDF
Enhanced Embedded Linux Board Support Package Field Upgrade – A Cost Effectiv...
PPT
PPTX
Linux kernel
PPT
system calls, single user, multiuser os ...
PPTX
Kernel (computing)
PPT
linux device driver
PPT
Operating System 2
PDF
CS6401 Operating Systems
PDF
Linux advanced concepts - Part 1
PPTX
Operating Systems A-Z
Operating system 11 system calls
System programs in o.s. for bca and bscit students by hardik nathani
Operating system kernal
Board support package_on_linux
Device Driver in WinCE 6.0 R2
Windows Kernel-
Cs8493 unit 5
Windows Architecture Explained by Stacksol
Enhanced Embedded Linux Board Support Package Field Upgrade – A Cost Effectiv...
Linux kernel
system calls, single user, multiuser os ...
Kernel (computing)
linux device driver
Operating System 2
CS6401 Operating Systems
Linux advanced concepts - Part 1
Operating Systems A-Z
Ad

Viewers also liked (20)

PPT
Chapter01
PPT
Chapter 2 - Operating System Structures
PPT
Chapter 5 - Electron Configurations
PPT
Chapter 4 Lecture- Solution Stoich
PDF
Chapter 24- Seeds & Flowers
DOC
2010 05 02 10 Dr Daniel C Tsui Physics Nobel Prize King Carl Xvi Gustaf Of S...
PDF
Chapter One- Intro to Biology
PPTX
Introduction 2 linux
ODP
Web Application Lunacy
PDF
005 skyeye
PPTX
Operating system ppt
PPT
UNIX(Essential needs of administration)
PDF
Chapter 1 Lecture- Matter & Measurement
PPT
Chapter 2 - Matter and Change
PPT
Introduction to xml
PDF
سه فیزیک دان برنده نوبل ۲۰۱۶
PPTX
PPT
Chapter 4 notes
PPT
Chapter 6 - The Periodic Table
PPT
Chapter 40 Lecture- The Immune System
Chapter01
Chapter 2 - Operating System Structures
Chapter 5 - Electron Configurations
Chapter 4 Lecture- Solution Stoich
Chapter 24- Seeds & Flowers
2010 05 02 10 Dr Daniel C Tsui Physics Nobel Prize King Carl Xvi Gustaf Of S...
Chapter One- Intro to Biology
Introduction 2 linux
Web Application Lunacy
005 skyeye
Operating system ppt
UNIX(Essential needs of administration)
Chapter 1 Lecture- Matter & Measurement
Chapter 2 - Matter and Change
Introduction to xml
سه فیزیک دان برنده نوبل ۲۰۱۶
Chapter 4 notes
Chapter 6 - The Periodic Table
Chapter 40 Lecture- The Immune System
Ad

Similar to 1 introduction (20)

PDF
1 introduction
PDF
MK Sistem Operasi.pdf
PPTX
operating system introduction- basics of operating system, definition, meanin...
PPTX
OperatingSystem_Module-1 3rd semester.pptx
PPTX
Operating System PPT for CSE students 2nd yr
PDF
Lect01
PPSX
Operating system
PPT
chapter1.ppt
PDF
Ch1 Introduction Silberschatz 10e OS.pdf
PPT
Operatingsystem
PDF
Cs8493 unit 1
PPTX
Operating system introduction and introduction
PPT
Operating Systems with Storage and Process Management
PPT
Operating Systems _ Process & Storage Management
PPT
Operating Systems Storage & Process Management
PDF
Operating system concepts (notes)
PPT
PDF
PB1MAT_TIF17 - Pertemuan 1-2ghfctrerdxt.pdf
1 introduction
MK Sistem Operasi.pdf
operating system introduction- basics of operating system, definition, meanin...
OperatingSystem_Module-1 3rd semester.pptx
Operating System PPT for CSE students 2nd yr
Lect01
Operating system
chapter1.ppt
Ch1 Introduction Silberschatz 10e OS.pdf
Operatingsystem
Cs8493 unit 1
Operating system introduction and introduction
Operating Systems with Storage and Process Management
Operating Systems _ Process & Storage Management
Operating Systems Storage & Process Management
Operating system concepts (notes)
PB1MAT_TIF17 - Pertemuan 1-2ghfctrerdxt.pdf

More from Dr. Loganathan R (20)

PDF
Ch 6 IoT Processing Topologies and Types.pdf
PDF
IoT Sensing and Actuation.pdf
PDF
Ch 4 Emergence of IoT.pdf
PDF
Program in ‘C’ language to implement linear search using pointers
PDF
Implement a queue using two stacks.
PDF
Bcsl 033 data and file structures lab s5-3
PDF
Bcsl 033 data and file structures lab s5-2
PDF
Bcsl 033 data and file structures lab s4-3
PDF
Bcsl 033 data and file structures lab s4-2
PDF
Bcsl 033 data and file structures lab s3-3
PDF
Bcsl 033 data and file structures lab s3-2
PDF
Bcsl 033 data and file structures lab s3-1
PDF
Bcsl 033 data and file structures lab s2-3
PDF
Bcsl 033 data and file structures lab s2-2
PDF
Bcsl 033 data and file structures lab s2-1
PDF
Bcsl 033 data and file structures lab s1-4
PDF
Bcsl 033 data and file structures lab s1-3
PDF
Bcsl 033 data and file structures lab s1-2
PDF
Bcsl 033 data and file structures lab s1-1
PPT
Introduction to Information Security
Ch 6 IoT Processing Topologies and Types.pdf
IoT Sensing and Actuation.pdf
Ch 4 Emergence of IoT.pdf
Program in ‘C’ language to implement linear search using pointers
Implement a queue using two stacks.
Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s4-3
Bcsl 033 data and file structures lab s4-2
Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-2
Bcsl 033 data and file structures lab s3-1
Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-3
Bcsl 033 data and file structures lab s1-2
Bcsl 033 data and file structures lab s1-1
Introduction to Information Security

Recently uploaded (20)

PDF
Business Ethics Teaching Materials for college
PPTX
Cell Types and Its function , kingdom of life
PDF
Pre independence Education in Inndia.pdf
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PPTX
master seminar digital applications in india
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Institutional Correction lecture only . . .
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Business Ethics Teaching Materials for college
Cell Types and Its function , kingdom of life
Pre independence Education in Inndia.pdf
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Final Presentation General Medicine 03-08-2024.pptx
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
master seminar digital applications in india
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
RMMM.pdf make it easy to upload and study
STATICS OF THE RIGID BODIES Hibbelers.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Microbial diseases, their pathogenesis and prophylaxis
Abdominal Access Techniques with Prof. Dr. R K Mishra
VCE English Exam - Section C Student Revision Booklet
Module 4: Burden of Disease Tutorial Slides S2 2025
Institutional Correction lecture only . . .
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx

1 introduction

  • 1. Introduction to OS • 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 Loganathan R, CSE,HKBKCE 1
  • 2. 1. What Operating System Do • 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 Loganathan R, CSE,HKBKCE 2
  • 3. Components of a Computer System Loganathan R, CSE,HKBKCE 3
  • 4. OS Role from 2 Viewpoints • 1.1 User View • Varies according to the Inter Face Used • Single User I/F: Ease of Use • Terminal User I/F: Resource(shared) Utilization • Workstation User I/F: Dedicated & Shared Resource • Handheld System User I/F : Individual Usability • Embedded Computers : Little/No user view • 1.2 System View – OS is a resource allocator –Manages all resources (CPU time, memory space, file-storage space, I/O devices) –Decides between conflicting requests for efficient and fair resource use – OS is a control program –Manages the execution of user programs to prevent errors and improper use of the computer –Concerned with the operation and control of I/O devices. Loganathan R, CSE,HKBKCE 4
  • 5. 1.3. OS Definition  No universally accepted definition • An operating system is a program that manages the computer hardware, provides a basis for application programs and acts as an intermediary between the computer user and the computer hardware  “Everything a vendor ships when you order an operating system” is good approximation ◦ But varies wildly  “The one program running at all times on the computer” is the kernel. Everything else is either a system program (ships with the operating system) or an application program Loganathan R, CSE,HKBKCE 5
  • 6. 2. Computer System Organization • 2.1 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 – During Power up/ Reboot, it needs to have a initial program to run called Bootstrap Program Loganathan R, CSE,HKBKCE 6
  • 7. Bootstrap Program  Typically stored in ROM or EPROM, generally known as firmware  Initializes all aspects of the system from CPU registers to device controllers to memory contents  Loads operating system kernel and starts execution and waits for an Event • An event is usually signaled by an interrupt from either the hardware or the software • Hardware may trigger an interrupt at any time by sending a signal to the CPU • Software may trigger an interrupt by executing a special operation called a system call (also called a monitor call) Loganathan R, CSE,HKBKCE 7
  • 8. Functions of Interrupts  When interrupted, CPU stops what it is doing and immediately transfers execution to a fixed location, which contains the starting address where the service routine for the interrupt is located • The interrupt service routine executes, on completion, the CPU resumes the interrupted computation. • A time line of this operation is shown Loganathan R, CSE,HKBKCE 8
  • 9. Interrupt Handling • Table of pointers is stored in low memory locations hold the addresses of the interrupt service routines for the various devices. • This array, or interrupt vector, of addresses is then indexed by a unique device number, given with the interrupt request, to provide the address of the interrupt service routine for the interrupting device  Interrupt architecture must save the address of the interrupted instruction on the system stack. • After the interrupt is serviced, the saved return address is loaded into the program counter, and the interrupted computation resumes as though the interrupt had not occurred  A trap is a software-generated interrupt caused either by an error or a user request.  An operating system is interrupt driven. Loganathan R, CSE,HKBKCE 9
  • 10. 2.2 Storage Structure • Computer programs to be executed must be in main memory RAM, Which is the only large storage area that the CPU can access directly • It is implemented in a semiconductor technology called dynamic random-access memory (DRAM) • Each word has its own address & interaction is through a load or store instructions • A typical instruction-execution cycle, fetches an instruction from memory and stores in the instruction register, then decoded and may cause operands to be fetched from memory and has been executed, the result may be stored back in memory • To reside the programs and data in main memory permanently is not possible for the following two reasons: – 1. Main memory is usually too small to store all needed programs and data permanently. – 2. Main memory is a volatile storage device that loses its contents when power is turned off or otherwise lost  Secondary storage(Magnetic disks, CD-ROM, Magnetic tapes) – is extension of main memory that provides large nonvolatile storage capacity. Loganathan R, CSE,HKBKCE 10
  • 11. Storage-Device Hierarchy  Storage systems organized in hierarchy according to speed, cost and volatility Volatile N o n v o l a t i l e Loganathan R, CSE,HKBKCE 11
  • 12. 2.3 I/O Structure • A general-purpose computer system consists of CPUs and multiple device controllers that are connected through a common bus. • Depending on the controller, there may be more than one attached device SCSI -8 • The device controller is responsible for moving the data between the peripheral devices that it controls and its local buffer storage • device driver for each device controller presents a uniform interface to the device to the rest of the operating system Loganathan R, CSE,HKBKCE 12
  • 13. I/O operation • Interrupt-driven I/O – For moving small amount of data – The device controller, examines the contents of the registers to determine what action to take. – The controller starts the transfer of data from the device to its local buffer – Once the transfer of data is complete, the device controller informs the device driver via an interrupt that it has finished its operation  Direct memory access – For bulk data movement such as disk I/O – After setting up buffers, pointers, and counters for the I/O device, the device controller transfers an entire block of data directly to or from its own buffer storage to memory, with no intervention by the CPU – Only one interrupt is generated per block, rather than the one interrupt per byte. Loganathan R, CSE,HKBKCE 13
  • 14. Direct memory access Loganathan R, CSE,HKBKCE 14
  • 15. 3. Computer-System Architecture • 3.1 Single-Processor Systems – Most systems are single processor and range from PDAs through mainframes – One main CPU capable of executing a general-purpose instruction set – Special-purpose processors are device-specific processors, such as disk, keyboard, and graphics controllers with Limited Instruction Set – Example: • PCs contain a microprocessor in the keyboard to convert the keystrokes into codes to be sent to the CPU – If there is only one general-purpose CPU, then the system is a single-processor system. Loganathan R, CSE,HKBKCE 15
  • 16. 3.2 Multiprocessor Systems • Multiprocessor systems also known as parallel systems or tightly coupled systems have two or more processors in close communication, sharing the computer bus and sometimes the clock, memory, and peripheral devices • Advantages – 1. Increased throughput: speed-up ratio with N processors is less than N due to overhead in keeping all the parts working – 2. Economy of scale : Multiprocessor systems can cost less than equivalent multiple single-processor systems, because they can share peripherals, mass storage, and power supplies – 3. Increased reliability :The failure of one processor will not halt the system Loganathan R, CSE,HKBKCE 16
  • 17. Reliability • The ability to continue providing service proportional to the level of surviving hardware is called graceful degradation • Some systems go beyond graceful degradation and are called fault tolerant, because they can suffer a failure of any single component and still continue operation • Fault tolerance requires a mechanism to allow the failure to be detected, diagnosed, and, if possible, corrected Loganathan R, CSE,HKBKCE 17
  • 18. Types of Multiprocessor Systems • Asymmetric multiprocessing – A master processor controls the system; the other processors either look to the master for instruction or have predefined tasks – The master processor schedules and allocates work to the slave processors • Symmetric multiprocessing (SMP) – Each processor performs all tasks within the operating system, all processors are peers – SMP architecture: Loganathan R, CSE,HKBKCE 18
  • 19. Types of Multiprocessor Systems • Multiple cores – Multiple compute cores on a single chip – Multi-core CPUs look to the OS just as N standard processors • Blade servers – Multiple processor boards, I/O boards, and networking boards are placed in the same chassis – Each blade-processor board boots independently and runs its own OS • Difference between SMP and asymmetric multiprocessing – Special hardware can differentiate the multiple processors, or the software can be written to allow only one master and multiple slaves Loganathan R, CSE,HKBKCE 19
  • 20. 3.3 Clustered Systems • Gather together multiple CPUs to accomplish computational work • Composed of two or more individual systems coupled together • Accepted definition – Clustered computers share storage and are closely linked via a local-area network (LAN) or a faster interconnect such as InfiniBand • provides high-availability service through a level of redundancy • Asymmetric clustering, one machine is in hot-standby mode while the other is running the applications • Symmetric mode, two or more hosts are running applications, and are monitoring each other • Parallel clusters and clustering over a wide-area network (WAN) allow multiple hosts to access the same data on the shared storage, to provide this, the system needs an access control and locking to ensure that no conflicting operations occur and this function is known as distributed lock manager (DLM) • Storage-area networks (SANs), which allow many systems to attach to a pool of storage Loganathan R, CSE,HKBKCE 20
  • 21. 4. Operating System Structure  Single user cannot keep CPU and I/O devices busy at all times • Multiprogramming needed for efficiency – 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 Loganathan R, CSE,HKBKCE 21
  • 22. Operating System Structure contd.. • Timesharing / Multitasking in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing – Response time should be < 1 second – Each user has at least one program executing in memory process – If several jobs ready to run at the same time  CPU scheduling – If several jobs are ready to be brought into memory, and if there is not enough room for all of them Job 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 – advantage of the virtual-memory scheme is it enables to run programs that are larger than actual physical memory Loganathan R, CSE,HKBKCE 22
  • 23. 5. Operating-System Operations  OS are Interrupt driven and Events are signaled by Interrupt or trap (or exception) ◦ Division by zero, request for operating system service  Other process problems include infinite loop, processes modifying each other or the operating system  5.1 Dual-mode operation allows OS to protect itself and other system components ◦ User mode - Executing user application ◦ kernel mode ( Supervisor / System / Privileged) – Boot time / System call ◦ Mode bit indicates current mode (0-Kernal, 1-User) provided by hardware Loganathan R, CSE,HKBKCE 23
  • 24. 5.2 Timer • Timer to prevent infinite loop / process hogging resources – Set interrupt after specific period – A variable timer is generally implemented by a fixed-rate clock and a counter – Operating system decrements counter – When counter reach zero an interrupt generated – Set up before scheduling process to regain control or terminate program that exceeds allotted time Loganathan R, CSE,HKBKCE 24
  • 25. 6. Process Management • A process is a program in execution. It is a unit of work within the system i.e. a job or a time-shared program • 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 process, some are OS process running concurrently on one or more CPUs – Concurrency by multiplexing the CPUs among the processes / threads Loganathan R, CSE,HKBKCE 25
  • 26. Process Management Activities The operating system activities in connection with process management:  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 Loganathan R, CSE,HKBKCE 26
  • 27. 7. Memory Management • All data in memory before and after processing • All instructions in memory in order to execute • Memory management determines what is in memory 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 Loganathan R, CSE,HKBKCE 27
  • 28. 8.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) 8.1 File-System management • A File is a collection of information defined by its creator usually organized into directories • The OS implements the abstract concept of a file by managing mass storage media and the devices that control them • OS activities in connection with file management • Creating and deleting files • Creating and deleting directories to organize files • Primitives to manipulate files and directories • Mapping files onto secondary storage • Backup files onto stable (non-volatile) storage media Loganathan R, CSE,HKBKCE 28
  • 29. 8.2 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 in connection with disk management – Free-space management – Storage allocation – Disk scheduling • Some storage need not be fast for backup of disk data – Tertiary storage includes optical storage, magnetic tape, platters – Varies between WORM (write-once, read-many-times) and RW (read- write) – It is not crucial to system performance, but it still must be managed Loganathan R, CSE,HKBKCE 29
  • 30. 8.3 Caching • Important principle, performed at many levels in a computer (in hardware, operating system, software) • Information in use copied from slower to faster storage temporarily • Faster storage (cache) checked first to determine if information is there – If it is, information used directly from the cache (fast) – else, data copied to cache and used there • Cache smaller than storage being cached – Cache management important design problem – Cache size and replacement policy Loganathan R, CSE,HKBKCE 30
  • 31. Performance of Various Levels of Storage • Movement between levels of storage hierarchy can be explicit or implicit Loganathan R, CSE,HKBKCE 31
  • 32. Migration of 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 Loganathan R, CSE,HKBKCE 32
  • 33. 8.4 I/O Subsystem  One purpose of OS is to hide peculiarities of hardware devices from the user • Peculiarities of I/O devices are hidden from the operating system itself by the I/O subsystem  I/O subsystem components ◦ A Memory management component that includes buffering, caching and spooling ◦ A General device-driver interface ◦ Drivers for specific hardware devices  Only the device driver knows the peculiarities of the specific device Loganathan R, CSE,HKBKCE 33
  • 34. 9. 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 Loganathan R, CSE,HKBKCE 34
  • 35. 10 Distributed Systems • A distributed system is a collection of physically separate, possibly heterogeneous computer systems that are networked to provide the users with access to the various resources • Access to a shared resource increases computation speed, functionality, data availability, and reliability • Distributed systems functionality depend on networking • Networks vary by the protocols used, the distances between nodes and the transport media • TCP/IP is the most common network protocol, although ATM and other protocols (UDP) are in widespread use • Networks are characterized based on the distances between their nodes such as LAN,WAN, MAN and Small-Area Network(home) • The media to carry networks are equally varied that include copper wires, fiber strands, and wireless transmissions between satellites, microwave dishes, and radios • A network OS provides features such as file sharing across the network and that includes a communication scheme that allows different processes on different computers to exchange messages Loganathan R, CSE,HKBKCE 35
  • 36. 11 Special-Purpose Systems • 11.1 Real-Time Embedded Systems – Embedded computers found everywhere, from car engines and manufacturing robots to VCRs and microwave ovens and expanding – Embedded systems almost always run real-time OS, which is used when there is a rigid time requirements, i.e. processing must be done within the defined constraints – used as a control device in sensors, scientific experiment, medical imaging, industrial control, display, automobile-engine fuel-injection, home-appliance, weapon systems • 11.2 Multimedia Systems – Multimedia data consist of audio and video files as well as conventional files – Multimedia data, live webcasts, must be streamed according to certain time restrictions eg. 30 frames per second – A stock trader may have stock quotes delivered wirelessly and in real time to his PDA. • 11.3 Handheld Systems – personal digital assistants (PDAs), such as Palm and Pocket-PCs, and cellular phones, – Limitation • Physical memory in a handheld is typically 512 KB to 128 MB • Speed of the processor , Faster processors require more power • I/O lack of physical space limits I/O methods to small keyboards, handwriting recognition, or small screen-based keyboards and small screens (web clipping is used) Loganathan R, CSE,HKBKCE 36
  • 37. 12. Computing Environments • 12.1Traditional computing – Office environment • PCs connected to a network, terminals attached to mainframe or minicomputers providing batch and timesharing, awkward Remote access and portability • Now portals allowing networked and remote systems access to same resources – Home networks • Used to be single system, then modems and now firewalled, networked – Traditional time-sharing systems are uncommon • 12.2 Client-Server Computing – Dump Terminals are supplemented for PCs – Server systems to satisfy requests generated by client systems • Compute-server provides an interface to client to request services (i.e. database) • File-server provides interface for clients to store and retrieve files Loganathan R, CSE,HKBKCE 37
  • 38. 12. Computing Environments contd.. • 12.3 Peer-to-Peer Computing – Another model of distributed system – P2P does not distinguish clients and servers • Instead all nodes are considered peers ◦ May each act as client, server or both ◦ Node must join P2P network and – Registers its service with central lookup service on network, or – Broadcast request for service and respond to requests for service via discovery protocol ◦ Examples include Napster and Gnutella • 1.12.4 Web-Based Computing – Web has become everywhere and PCs most common devices – More devices becoming networked to allow web access – New category of devices to manage web traffic among similar servers: load balancers – Use of operating systems like Windows 95, client-side, have evolved into Linux and Windows XP, which can be clients and servers Loganathan R, CSE,HKBKCE 38