SlideShare a Scribd company logo
Computer System
Architecture (Software)
Chapter 2. Operating System structure

Spring 2008
Guo Xunhua
Operating System Structure

  Computer hardware structure

  System calls

  System programs

  Operating system components




Guo, Xunhua         2
Computer hardware structure
Computer hardware




Guo, Xunhua   4
Hardware Architecture
(Storage Centric)




Guo, Xunhua    5
Hardware Architecture
(Bus-based)
                                CPU
                        Arithmetric-Logic Unit    Secondary
       Input Devices
                             Control Unit          Storage
              ... ...                                ... ...
              ... ...                                ... ...
              ... ...                                ... ...

                                                 Communication
                                 BUS
       Output Devices
                                                   Devices
              ... ...                                ... ...
              ... ...                                ... ...
              ... ...                                ... ...
                          Primary Storage



Guo, Xunhua                            6
Hardware components
  Central Processing Unit (CPU)
      Control Unit
      Arithmetic-Logic Unit
  Storage
      Primary Storage
      Secondary Storage
  Input/Output Devices (Including
  Communication Devices)




Guo, Xunhua                   7
Computer hardware operation
                         M t or
                          oni




                                                          Bus
  I/O devices and the CPU can execute concurrently.
  Each device controller is in charge of a particular device type.
  Each device controller has a local buffer.
  CPU moves data from/to main memory to/from the local buffers.
  I/O is from the device to local buffer of controller.
  Device controller informs CPU that it has finished its operation by
  causing an interrupt.
Guo, Xunhua                         8
Common Functions of Interrupts
  Interrupt transfers control to the interrupt service
  routine
     interrupt vector 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.

Guo, Xunhua                9
Interrupts




              (a)                   (b)


(a) Steps in starting an I/O device and getting
  interrupt
(b) How the CPU is interrupted

Guo, Xunhua            10
Interrupt time line




Guo, Xunhua      11
Synchronous I/O interrupts
  After I/O starts,
  control returns to user
  program only upon I/O
  completion.
      wait instruction idles
      the CPU until the next
      interrupt.
      wait loop (contention
      for memory access).
      at most one I/O request
      is outstanding at a
      time; no simultaneous
      I/O processing.
Guo, Xunhua               12
Asynchronous I/O interrupts
  After I/O starts, control returns to
  user program without waiting
      System call – request to the
      operating system
      Device-status table contains
      entry for each I/O device
      indicating its type, address,
      and state (not functioning,
      idle or busy)
      Multiple requests for the
      same device are maintained
      in a wait queue.
      Operating system indexes
      into I/O device table to
      determine device status and
      to modify table entry to
      include interrupt.

Guo, Xunhua                         13
DMA Structure
  Used for high-speed I/O devices able to
  transmit information at close to memory
  speeds.
  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.




Guo, Xunhua           14
Storage Structure
  Main memory
      The only large storage media that the CPU can
      access directly.
  Secondary storage
      extension of main memory that provides large
      nonvolatile storage capacity.
      Magnetic disks
      Optical disks
      Magnetic tapes




Guo, Xunhua               15
Typical memory hierarchy
  Storage systems organized in hierarchy:
      Speed, cost, volatility
  Caching
      copying information into faster storage system;
      main memory can be viewed as a fast cache for
      secondary storage.




Guo, Xunhua                 16
Structure of a large Pentium
system




Guo, Xunhua     17
Hardware protection
  Dual-Mode Operation
  I/O Protection
  Memory Protection
  CPU Protection




Guo, Xunhua         18
Dual-mode operation
  Sharing system resources requires
  operating system to ensure that an
  incorrect program cannot cause other
  programs to execute incorrectly.
  Provide hardware support to differentiate
  between at least two modes of operations.
      User mode – execution done on behalf of a user.
      Monitor mode (also supervisor mode, kernel
      mode, or system mode) – execution done on
      behalf of operating system.



Guo, Xunhua               19
Dual-mode operation




Guo, Xunhua    20
User mode and monitor mode




  Mode bit added to computer hardware to indicate the
  current mode
     monitor (0) or user (1).
  When an interrupt or fault occurs hardware switches to
  monitor mode
  Privileged instructions can be issued only in monitor
  mode.
Guo, Xunhua                21
I/O protection
  All I/O instructions are privileged
  instructions.
  Must ensure that a user program could
  never gain control of the computer in
  monitor mode
      i.e., a user program that, as part of its
      execution, stores a new address in the interrupt
      vector




Guo, Xunhua                22
Memory protection
  Must provide memory protection at least for
  the interrupt vector and the interrupt
  service routines.
  In order to have memory protection, add
  two registers that determine the range of
  legal addresses a program may access:
      base register – holds the smallest legal physical
      memory address.
      limit register – contains the size of the range.
  Memory outside the defined range is
  protected.
Guo, Xunhua                23
Example of memory protection




Guo, Xunhua    24
Protection hardware




Guo, Xunhua    25
Question
  Given that I/O instructions are privileged,
  how does the user program perform I/O?




Guo, Xunhua            26
System calls
System calls
  The method used by a process to request
  action by the operating system.
  Usually takes the form of a trap to a
  specific location in the interrupt vector.
  Control passes through the interrupt vector
  to a service routine in the OS, and the
  mode bit is set to monitor mode.
  The monitor verifies that the parameters
  are correct and legal, executes the request,
  and returns control to the instruction
  following the system call.
Guo, Xunhua           28
System calls
 System calls provide the interface between
 a running program and the operating
 system.
 Three general methods are used to pass
 parameters between a running program
 and the operating system:
       Pass parameters in registers.
       Store the parameters in a table in memory, and
       the table address is passed as a parameter in a
       register.
       Push (store) the parameters onto the stack by
       the program, and pop off the stack by the
       operating system.
Guo, Xunhua                  29
Steps in making a system call




Guo, Xunhua      30
Some System Calls For Process
Management




                31
Some System Calls For File
Management




                32
Some System Calls For Directory
Management




                33
Some System Calls For
Miscellaneous Tasks




                34
System call interface

           User
         Interface




      The layers of a UNIX system.




                      35
System programs
System (utility) programs
  Solve common problems or perform
  common operations
      File manipulation: e.g., cp, mv, chmod, ls
      Status information: e.g., date, ps, df
      File modification: e.g., vi
      Programming-language support: e.g., gcc, asm
      Program loading and execution: e.g., ld, gdb
      Communications: e.g., telnet
  System programs are invoked from the
  shell whereas system calls are invoked
  from programs.
Guo, Xunhua               37
UNIX utility programs




Guo, Xunhua     38
Operating system components
Common system components
  Process Management
  Main-Memory Management
  File Management
  I/O System Management
  Protection System
  Networking
  Command-Interpreter System




Guo, Xunhua         40
Process management
  program (passive) vs. process (active)
      A process is a program in execution. A process needs
      certain resources, including CPU time, memory, files,
      and I/O devices, to accomplish its task.
  The operating system is responsible for:
      process creation and deletion.
      process suspension and resumption.
      provision of mechanisms for:
          process synchronization
          process communication
          Deadlock handling



Guo, Xunhua                    41
Main memory management
  Memory is a large array of words or bytes,
  each with its own address.
  It is a repository of quickly accessible data
  shared by the CPU and I/O devices.
  Main memory is a volatile storage device
  The operating system is responsible for:
      Keep track of which parts of memory are
      currently being used and by whom.
      Decide which processes to load when memory
      space becomes available.
      Allocate and deallocate memory space as
      needed.
Guo, Xunhua              42
File Management
  The OS through the file system provides a
  uniform logical view of information storage.
  The operating system is responsible for:
      File creation and deletion.
      Directory creation and deletion.
      Support of primitives for manipulating files and
      directories.
      Mapping files onto secondary storage.
      File backup on stable (nonvolatile) storage
      media.


Guo, Xunhua                43
I/O system management
  The peculiarities of the various I/O devices
  are hidden from the bulk of the operating
  system itself by the I/O subsystem
  The I/O system consists of:
      A buffer-caching system
      A general device-driver interface
      Drivers for specific hardware devices




Guo, Xunhua                44
Secondary-Storage Management
  Most modern computer systems use disks
  as the principle on-line storage medium, for
  both programs and data.
  The operating system is responsible for:
      Free-space management
      Storage allocation
      Disk scheduling




Guo, Xunhua             45
Protection system
  Protection refers to a mechanism for
  controlling access by programs, processes,
  or users to both system and user resources.
  The protection mechanism must:
      distinguish between authorized and
      unauthorized usage.
      specify the controls to be imposed.
      provide a means of enforcement.




Guo, Xunhua               46
Networking
  A distributed system is a collection of
  processors that do not share memory or a
  clock. Each processor has its own local
  memory.
  The processors in the system are connected
  through a communication network.
  A distributed system provides user access
  to various system resources.
      Computation speed-up
      Increased data availability
      Enhanced reliability

Guo, Xunhua                47
Command-Interpreter System
  User interface which deals with:
      process creation and management
      I/O handling
      secondary-storage management
      main-memory management
      file-system access
      protection
      Networking
  Command-line and GUI



Guo, Xunhua              48
Common system components
  Process Management
  Main-Memory Management
  File Management
  I/O System Management
  Protection System
  Networking
  Command-Interpreter System




Guo, Xunhua       49
Simple structure: MS DOS




Guo, Xunhua    50
Monolithic kernel vs. Microkernel




Guo, Xunhua     51
The client-server model in a
distributed system




Guo, Xunhua      52
Operating-System Services
  Program execution
  I/O operations
  File-system manipulation
  Communications
  Error detection
  Additional functions for ensuring efficient
  system operation.
      Resource allocation, Accounting, Protection




Guo, Xunhua                53
UNIX Structure




Guo, Xunhua      54
Basic characteristics of modern
operating systems
   Concurrency ( 并发 )
   Sharing ( 共享 )
   Virtualization ( 虚拟 )
   Asynchronism ( 异步 )




Guo, Xunhua            55
Concurrency
  Concurrency
      Several events take places in a same time
      period
      Several programs (processes) run in the same
      time
  A modern operating system is a
  concurrency system
      The co-existence of multi events and processes
      is managed by the OS




Guo, Xunhua               56
Sharing
  Sharing: several processes share the
  limited computer system resource
      An OS shall manage the system resource for
      proper sharing
      Resources are used alternatively by multi
      processes
  Exclusive sharing: e.g. printers
  Non-exclusive sharing: e.g. harddisks




Guo, Xunhua               57
Virtualization
  Virtualization:
      A physical entity is map to several logical
      entities with time or space
      An important way to improve the utilization
      effectiveness of resources
  Virtual processor
  Virtual storage
  Virtual device




Guo, Xunhua                58
Virtual Machines




Guo, Xunhua    59
Asynchronism
  Conditions
      Several processes execute concurrently
      The execution sequence and time of processes
      are uncertain
      The speed of process execution is not pre-
      determined
  Target
      No matter how the processes are executed, the
      results must be the sam




Guo, Xunhua               60
Exercises
  Reading:
      Chapter 2 and 3, Textbook
  Questions:
      Why is the distinction between monitor mode
      and user mode important?
      What are different between system calls and
      library functions?




Guo, Xunhua               61

More Related Content

What's hot

Operating systems
Operating systemsOperating systems
Operating systemsJoshuaIgo
 
2 operating system structures
2 operating system structures2 operating system structures
2 operating system structures
Dr. Loganathan R
 
Operating System Concepts Presentation
Operating System Concepts PresentationOperating System Concepts Presentation
Operating System Concepts Presentation
Nitish Jadia
 
Operating system
Operating systemOperating system
Operating systemmak120
 
System Z operating system
System Z operating systemSystem Z operating system
System Z operating system
Arpana shree
 
Operating System / System Operasi
Operating System / System Operasi                   Operating System / System Operasi
Operating System / System Operasi
seolangit4
 
OPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTESOPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTES
suthi
 
Operating System Structure (documentation)
Operating System Structure (documentation)Operating System Structure (documentation)
Operating System Structure (documentation)
Navid Daneshvaran
 
What is operating system
What is operating systemWhat is operating system
What is operating system
Suvithak
 
Operating system notes ch1
Operating system notes ch1Operating system notes ch1
Operating system notes ch1
Emmanuel Damka
 
M.c.a. (sem ii) operating systems
M.c.a. (sem   ii) operating systemsM.c.a. (sem   ii) operating systems
M.c.a. (sem ii) operating systems
Tushar Rajput
 
OS - Operating System
OS - Operating System OS - Operating System
OS - Operating System
MaqdamYasir
 
Cs8493 unit 1
Cs8493 unit 1Cs8493 unit 1
Cs8493 unit 1
Kathirvel Ayyaswamy
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works.
Fahad Farooq
 

What's hot (18)

OS_Ch2
OS_Ch2OS_Ch2
OS_Ch2
 
Operating systems
Operating systemsOperating systems
Operating systems
 
2 operating system structures
2 operating system structures2 operating system structures
2 operating system structures
 
Operating System Concepts Presentation
Operating System Concepts PresentationOperating System Concepts Presentation
Operating System Concepts Presentation
 
Operating system
Operating systemOperating system
Operating system
 
System Z operating system
System Z operating systemSystem Z operating system
System Z operating system
 
Ch1
Ch1Ch1
Ch1
 
Operating System / System Operasi
Operating System / System Operasi                   Operating System / System Operasi
Operating System / System Operasi
 
OPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTESOPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTES
 
Operating System Structure (documentation)
Operating System Structure (documentation)Operating System Structure (documentation)
Operating System Structure (documentation)
 
What is operating system
What is operating systemWhat is operating system
What is operating system
 
Operating system notes ch1
Operating system notes ch1Operating system notes ch1
Operating system notes ch1
 
Presentation1 cc
Presentation1 ccPresentation1 cc
Presentation1 cc
 
Os1
Os1Os1
Os1
 
M.c.a. (sem ii) operating systems
M.c.a. (sem   ii) operating systemsM.c.a. (sem   ii) operating systems
M.c.a. (sem ii) operating systems
 
OS - Operating System
OS - Operating System OS - Operating System
OS - Operating System
 
Cs8493 unit 1
Cs8493 unit 1Cs8493 unit 1
Cs8493 unit 1
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works.
 

Viewers also liked

Operating System Structure
Operating System StructureOperating System Structure
Operating System Structure
Navid Daneshvaran
 
Developing Technology-Enhanced Learning at DMU
Developing Technology-Enhanced Learning at DMUDeveloping Technology-Enhanced Learning at DMU
Developing Technology-Enhanced Learning at DMU
Richard Hall
 
Beginner's guide to drupal
Beginner's guide to drupalBeginner's guide to drupal
Beginner's guide to drupal
mayank.grd
 
Course and Module Introduction
Course and Module IntroductionCourse and Module Introduction
Course and Module Introduction
sekaminski
 
Operating system concepts
Operating system conceptsOperating system concepts
Operating system concepts
Starlee Lathong
 
Banking In Tally.ERP 9
Banking In Tally.ERP 9Banking In Tally.ERP 9
Banking In Tally.ERP 9
TallyERP9
 
Three Central Processing Unit
Three   Central Processing UnitThree   Central Processing Unit
Three Central Processing UnitMISY
 
Introduction Oracle Database 11g Release 2 for developers
Introduction Oracle Database 11g Release 2 for developersIntroduction Oracle Database 11g Release 2 for developers
Introduction Oracle Database 11g Release 2 for developers
Lucas Jellema
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
Eddy Reyes
 
Chuong6 hoạt động ngắt
Chuong6 hoạt động ngắtChuong6 hoạt động ngắt
Chuong6 hoạt động ngắt
Đinh Công Thiện Taydo University
 
Release note: Scan&Paint 2.0
Release note:   Scan&Paint 2.0Release note:   Scan&Paint 2.0
Release note: Scan&Paint 2.0
Microflown Technologies
 
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting , PO...
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting ,  PO...SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting ,  PO...
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting , PO...
Soumya De
 
Chapter 2: Operating System Structures
Chapter 2: Operating System StructuresChapter 2: Operating System Structures
Chapter 2: Operating System Structures
Shafaan Khaliq Bhatti
 
Introducing Co3's Security Incident Response Module
Introducing Co3's Security Incident Response ModuleIntroducing Co3's Security Incident Response Module
Introducing Co3's Security Incident Response Module
Resilient Systems
 

Viewers also liked (20)

Operating System Structure
Operating System StructureOperating System Structure
Operating System Structure
 
Ch2
Ch2Ch2
Ch2
 
Developing Technology-Enhanced Learning at DMU
Developing Technology-Enhanced Learning at DMUDeveloping Technology-Enhanced Learning at DMU
Developing Technology-Enhanced Learning at DMU
 
Beginner's guide to drupal
Beginner's guide to drupalBeginner's guide to drupal
Beginner's guide to drupal
 
Course and Module Introduction
Course and Module IntroductionCourse and Module Introduction
Course and Module Introduction
 
OSCh2
OSCh2OSCh2
OSCh2
 
Operating system concepts
Operating system conceptsOperating system concepts
Operating system concepts
 
Banking In Tally.ERP 9
Banking In Tally.ERP 9Banking In Tally.ERP 9
Banking In Tally.ERP 9
 
Three Central Processing Unit
Three   Central Processing UnitThree   Central Processing Unit
Three Central Processing Unit
 
Introduction Oracle Database 11g Release 2 for developers
Introduction Oracle Database 11g Release 2 for developersIntroduction Oracle Database 11g Release 2 for developers
Introduction Oracle Database 11g Release 2 for developers
 
OCT
OCTOCT
OCT
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
 
Chuong6 hoạt động ngắt
Chuong6 hoạt động ngắtChuong6 hoạt động ngắt
Chuong6 hoạt động ngắt
 
08 Operating System Support
08  Operating  System  Support08  Operating  System  Support
08 Operating System Support
 
Release note: Scan&Paint 2.0
Release note:   Scan&Paint 2.0Release note:   Scan&Paint 2.0
Release note: Scan&Paint 2.0
 
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting , PO...
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting ,  PO...SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting ,  PO...
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting , PO...
 
SAP mm module
SAP mm moduleSAP mm module
SAP mm module
 
operating system structure
operating system structureoperating system structure
operating system structure
 
Chapter 2: Operating System Structures
Chapter 2: Operating System StructuresChapter 2: Operating System Structures
Chapter 2: Operating System Structures
 
Introducing Co3's Security Incident Response Module
Introducing Co3's Security Incident Response ModuleIntroducing Co3's Security Incident Response Module
Introducing Co3's Security Incident Response Module
 

Similar to 02.Os Structure

What does your computer consists of?
What does your computer consists of?What does your computer consists of?
What does your computer consists of?quantess
 
Basic Organisation and fundamental Of Computer.pptx
Basic Organisation and fundamental Of Computer.pptxBasic Organisation and fundamental Of Computer.pptx
Basic Organisation and fundamental Of Computer.pptx
hasanbashar400
 
Operating System Case Study and I/O System
Operating System Case Study and I/O SystemOperating System Case Study and I/O System
Operating System Case Study and I/O System
prakash ganesan
 
Ch2 OS
Ch2 OSCh2 OS
Ch2 OSC.U
 
Basic-Role-of-Operating-System-send.pptx
Basic-Role-of-Operating-System-send.pptxBasic-Role-of-Operating-System-send.pptx
Basic-Role-of-Operating-System-send.pptx
iloveyoucarlo0923
 
Chap1_Introduction.pdf
Chap1_Introduction.pdfChap1_Introduction.pdf
Chap1_Introduction.pdf
YuChianWu1
 
Comp App Lect 2.pptx
Comp App Lect 2.pptxComp App Lect 2.pptx
Comp App Lect 2.pptx
MehwishKanwal14
 
computer science and enginnering fundamental organisation.pptx
computer science and enginnering fundamental organisation.pptxcomputer science and enginnering fundamental organisation.pptx
computer science and enginnering fundamental organisation.pptx
PannaBushratul
 
Computer System Class - 9
Computer System Class - 9Computer System Class - 9
Computer System Class - 9
NehaRohtagi1
 
CS403: Operating System : Unit I _merged.pdf
CS403: Operating System :  Unit I _merged.pdfCS403: Operating System :  Unit I _merged.pdf
CS403: Operating System : Unit I _merged.pdf
Asst.prof M.Gokilavani
 
Operating system (BCS303) MODULE 1 NOTES
Operating system (BCS303) MODULE 1 NOTESOperating system (BCS303) MODULE 1 NOTES
Operating system (BCS303) MODULE 1 NOTES
KopinathMURUGESAN
 
Operating systems. replace ch1 with numbers for next chapters
Operating systems. replace ch1 with numbers for next chaptersOperating systems. replace ch1 with numbers for next chapters
Operating systems. replace ch1 with numbers for next chapterssphs
 
Chapter 1 - Introduction
Chapter 1 - IntroductionChapter 1 - Introduction
Chapter 1 - IntroductionWayne Jones Jnr
 
Ise iv-computer organization [10 cs46]-notes new
Ise iv-computer  organization [10 cs46]-notes newIse iv-computer  organization [10 cs46]-notes new
Ise iv-computer organization [10 cs46]-notes newdilshad begum
 
Lecture_01 Operating System Course Introduction
Lecture_01 Operating System Course IntroductionLecture_01 Operating System Course Introduction
Lecture_01 Operating System Course Introduction
ArnoyKhan
 
operating system introduction- basics of operating system, definition, meanin...
operating system introduction- basics of operating system, definition, meanin...operating system introduction- basics of operating system, definition, meanin...
operating system introduction- basics of operating system, definition, meanin...
DEVIRAJAM
 
operating system over view.ppt operating sysyems
operating system over view.ppt operating sysyemsoperating system over view.ppt operating sysyems
operating system over view.ppt operating sysyems
JyoReddy9
 
FANDAMENTAL OF COMPUTER SCIENCE FOR ENGINEERING.pptx
FANDAMENTAL OF COMPUTER SCIENCE FOR ENGINEERING.pptxFANDAMENTAL OF COMPUTER SCIENCE FOR ENGINEERING.pptx
FANDAMENTAL OF COMPUTER SCIENCE FOR ENGINEERING.pptx
PannaBushratul
 
Operating System and related questions
Operating System and related questionsOperating System and related questions
Operating System and related questions
imdurgesh
 
IO SYSTEM AND CASE STUDY STRUCTURE
IO SYSTEM AND CASE STUDY STRUCTUREIO SYSTEM AND CASE STUDY STRUCTURE
IO SYSTEM AND CASE STUDY STRUCTURE
Hariharan Anand
 

Similar to 02.Os Structure (20)

What does your computer consists of?
What does your computer consists of?What does your computer consists of?
What does your computer consists of?
 
Basic Organisation and fundamental Of Computer.pptx
Basic Organisation and fundamental Of Computer.pptxBasic Organisation and fundamental Of Computer.pptx
Basic Organisation and fundamental Of Computer.pptx
 
Operating System Case Study and I/O System
Operating System Case Study and I/O SystemOperating System Case Study and I/O System
Operating System Case Study and I/O System
 
Ch2 OS
Ch2 OSCh2 OS
Ch2 OS
 
Basic-Role-of-Operating-System-send.pptx
Basic-Role-of-Operating-System-send.pptxBasic-Role-of-Operating-System-send.pptx
Basic-Role-of-Operating-System-send.pptx
 
Chap1_Introduction.pdf
Chap1_Introduction.pdfChap1_Introduction.pdf
Chap1_Introduction.pdf
 
Comp App Lect 2.pptx
Comp App Lect 2.pptxComp App Lect 2.pptx
Comp App Lect 2.pptx
 
computer science and enginnering fundamental organisation.pptx
computer science and enginnering fundamental organisation.pptxcomputer science and enginnering fundamental organisation.pptx
computer science and enginnering fundamental organisation.pptx
 
Computer System Class - 9
Computer System Class - 9Computer System Class - 9
Computer System Class - 9
 
CS403: Operating System : Unit I _merged.pdf
CS403: Operating System :  Unit I _merged.pdfCS403: Operating System :  Unit I _merged.pdf
CS403: Operating System : Unit I _merged.pdf
 
Operating system (BCS303) MODULE 1 NOTES
Operating system (BCS303) MODULE 1 NOTESOperating system (BCS303) MODULE 1 NOTES
Operating system (BCS303) MODULE 1 NOTES
 
Operating systems. replace ch1 with numbers for next chapters
Operating systems. replace ch1 with numbers for next chaptersOperating systems. replace ch1 with numbers for next chapters
Operating systems. replace ch1 with numbers for next chapters
 
Chapter 1 - Introduction
Chapter 1 - IntroductionChapter 1 - Introduction
Chapter 1 - Introduction
 
Ise iv-computer organization [10 cs46]-notes new
Ise iv-computer  organization [10 cs46]-notes newIse iv-computer  organization [10 cs46]-notes new
Ise iv-computer organization [10 cs46]-notes new
 
Lecture_01 Operating System Course Introduction
Lecture_01 Operating System Course IntroductionLecture_01 Operating System Course Introduction
Lecture_01 Operating System Course Introduction
 
operating system introduction- basics of operating system, definition, meanin...
operating system introduction- basics of operating system, definition, meanin...operating system introduction- basics of operating system, definition, meanin...
operating system introduction- basics of operating system, definition, meanin...
 
operating system over view.ppt operating sysyems
operating system over view.ppt operating sysyemsoperating system over view.ppt operating sysyems
operating system over view.ppt operating sysyems
 
FANDAMENTAL OF COMPUTER SCIENCE FOR ENGINEERING.pptx
FANDAMENTAL OF COMPUTER SCIENCE FOR ENGINEERING.pptxFANDAMENTAL OF COMPUTER SCIENCE FOR ENGINEERING.pptx
FANDAMENTAL OF COMPUTER SCIENCE FOR ENGINEERING.pptx
 
Operating System and related questions
Operating System and related questionsOperating System and related questions
Operating System and related questions
 
IO SYSTEM AND CASE STUDY STRUCTURE
IO SYSTEM AND CASE STUDY STRUCTUREIO SYSTEM AND CASE STUDY STRUCTURE
IO SYSTEM AND CASE STUDY STRUCTURE
 

Recently uploaded

Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 

Recently uploaded (20)

Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 

02.Os Structure

  • 1. Computer System Architecture (Software) Chapter 2. Operating System structure Spring 2008 Guo Xunhua
  • 2. Operating System Structure Computer hardware structure System calls System programs Operating system components Guo, Xunhua 2
  • 6. Hardware Architecture (Bus-based) CPU Arithmetric-Logic Unit Secondary Input Devices Control Unit Storage ... ... ... ... ... ... ... ... ... ... ... ... Communication BUS Output Devices Devices ... ... ... ... ... ... ... ... ... ... ... ... Primary Storage Guo, Xunhua 6
  • 7. Hardware components Central Processing Unit (CPU) Control Unit Arithmetic-Logic Unit Storage Primary Storage Secondary Storage Input/Output Devices (Including Communication Devices) Guo, Xunhua 7
  • 8. Computer hardware operation M t or oni Bus I/O devices and the CPU can execute concurrently. Each device controller is in charge of a particular device type. Each device controller has a local buffer. CPU moves data from/to main memory to/from the local buffers. I/O is from the device to local buffer of controller. Device controller informs CPU that it has finished its operation by causing an interrupt. Guo, Xunhua 8
  • 9. Common Functions of Interrupts Interrupt transfers control to the interrupt service routine interrupt vector 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. Guo, Xunhua 9
  • 10. Interrupts (a) (b) (a) Steps in starting an I/O device and getting interrupt (b) How the CPU is interrupted Guo, Xunhua 10
  • 12. Synchronous I/O interrupts After I/O starts, control returns to user program only upon I/O completion. wait instruction idles the CPU until the next interrupt. wait loop (contention for memory access). at most one I/O request is outstanding at a time; no simultaneous I/O processing. Guo, Xunhua 12
  • 13. Asynchronous I/O interrupts After I/O starts, control returns to user program without waiting System call – request to the operating system Device-status table contains entry for each I/O device indicating its type, address, and state (not functioning, idle or busy) Multiple requests for the same device are maintained in a wait queue. Operating system indexes into I/O device table to determine device status and to modify table entry to include interrupt. Guo, Xunhua 13
  • 14. DMA Structure Used for high-speed I/O devices able to transmit information at close to memory speeds. 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. Guo, Xunhua 14
  • 15. Storage Structure Main memory The only large storage media that the CPU can access directly. Secondary storage extension of main memory that provides large nonvolatile storage capacity. Magnetic disks Optical disks Magnetic tapes Guo, Xunhua 15
  • 16. Typical memory hierarchy Storage systems organized in hierarchy: Speed, cost, volatility Caching copying information into faster storage system; main memory can be viewed as a fast cache for secondary storage. Guo, Xunhua 16
  • 17. Structure of a large Pentium system Guo, Xunhua 17
  • 18. Hardware protection Dual-Mode Operation I/O Protection Memory Protection CPU Protection Guo, Xunhua 18
  • 19. Dual-mode operation Sharing system resources requires operating system to ensure that an incorrect program cannot cause other programs to execute incorrectly. Provide hardware support to differentiate between at least two modes of operations. User mode – execution done on behalf of a user. Monitor mode (also supervisor mode, kernel mode, or system mode) – execution done on behalf of operating system. Guo, Xunhua 19
  • 21. User mode and monitor mode Mode bit added to computer hardware to indicate the current mode monitor (0) or user (1). When an interrupt or fault occurs hardware switches to monitor mode Privileged instructions can be issued only in monitor mode. Guo, Xunhua 21
  • 22. I/O protection All I/O instructions are privileged instructions. Must ensure that a user program could never gain control of the computer in monitor mode i.e., a user program that, as part of its execution, stores a new address in the interrupt vector Guo, Xunhua 22
  • 23. Memory protection Must provide memory protection at least for the interrupt vector and the interrupt service routines. In order to have memory protection, add two registers that determine the range of legal addresses a program may access: base register – holds the smallest legal physical memory address. limit register – contains the size of the range. Memory outside the defined range is protected. Guo, Xunhua 23
  • 24. Example of memory protection Guo, Xunhua 24
  • 26. Question Given that I/O instructions are privileged, how does the user program perform I/O? Guo, Xunhua 26
  • 28. System calls The method used by a process to request action by the operating system. Usually takes the form of a trap to a specific location in the interrupt vector. Control passes through the interrupt vector to a service routine in the OS, and the mode bit is set to monitor mode. The monitor verifies that the parameters are correct and legal, executes the request, and returns control to the instruction following the system call. Guo, Xunhua 28
  • 29. System calls System calls provide the interface between a running program and the operating system. Three general methods are used to pass parameters between a running program and the operating system: Pass parameters in registers. Store the parameters in a table in memory, and the table address is passed as a parameter in a register. Push (store) the parameters onto the stack by the program, and pop off the stack by the operating system. Guo, Xunhua 29
  • 30. Steps in making a system call Guo, Xunhua 30
  • 31. Some System Calls For Process Management 31
  • 32. Some System Calls For File Management 32
  • 33. Some System Calls For Directory Management 33
  • 34. Some System Calls For Miscellaneous Tasks 34
  • 35. System call interface User Interface The layers of a UNIX system. 35
  • 37. System (utility) programs Solve common problems or perform common operations File manipulation: e.g., cp, mv, chmod, ls Status information: e.g., date, ps, df File modification: e.g., vi Programming-language support: e.g., gcc, asm Program loading and execution: e.g., ld, gdb Communications: e.g., telnet System programs are invoked from the shell whereas system calls are invoked from programs. Guo, Xunhua 37
  • 40. Common system components Process Management Main-Memory Management File Management I/O System Management Protection System Networking Command-Interpreter System Guo, Xunhua 40
  • 41. Process management program (passive) vs. process (active) A process is a program in execution. A process needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish its task. The operating system is responsible for: process creation and deletion. process suspension and resumption. provision of mechanisms for: process synchronization process communication Deadlock handling Guo, Xunhua 41
  • 42. Main memory management Memory is a large array of words or bytes, each with its own address. It is a repository of quickly accessible data shared by the CPU and I/O devices. Main memory is a volatile storage device The operating system is responsible for: Keep track of which parts of memory are currently being used and by whom. Decide which processes to load when memory space becomes available. Allocate and deallocate memory space as needed. Guo, Xunhua 42
  • 43. File Management The OS through the file system provides a uniform logical view of information storage. The operating system is responsible for: File creation and deletion. Directory creation and deletion. Support of primitives for manipulating files and directories. Mapping files onto secondary storage. File backup on stable (nonvolatile) storage media. Guo, Xunhua 43
  • 44. I/O system management The peculiarities of the various I/O devices are hidden from the bulk of the operating system itself by the I/O subsystem The I/O system consists of: A buffer-caching system A general device-driver interface Drivers for specific hardware devices Guo, Xunhua 44
  • 45. Secondary-Storage Management Most modern computer systems use disks as the principle on-line storage medium, for both programs and data. The operating system is responsible for: Free-space management Storage allocation Disk scheduling Guo, Xunhua 45
  • 46. Protection system Protection refers to a mechanism for controlling access by programs, processes, or users to both system and user resources. The protection mechanism must: distinguish between authorized and unauthorized usage. specify the controls to be imposed. provide a means of enforcement. Guo, Xunhua 46
  • 47. Networking A distributed system is a collection of processors that do not share memory or a clock. Each processor has its own local memory. The processors in the system are connected through a communication network. A distributed system provides user access to various system resources. Computation speed-up Increased data availability Enhanced reliability Guo, Xunhua 47
  • 48. Command-Interpreter System User interface which deals with: process creation and management I/O handling secondary-storage management main-memory management file-system access protection Networking Command-line and GUI Guo, Xunhua 48
  • 49. Common system components Process Management Main-Memory Management File Management I/O System Management Protection System Networking Command-Interpreter System Guo, Xunhua 49
  • 50. Simple structure: MS DOS Guo, Xunhua 50
  • 51. Monolithic kernel vs. Microkernel Guo, Xunhua 51
  • 52. The client-server model in a distributed system Guo, Xunhua 52
  • 53. Operating-System Services Program execution I/O operations File-system manipulation Communications Error detection Additional functions for ensuring efficient system operation. Resource allocation, Accounting, Protection Guo, Xunhua 53
  • 55. Basic characteristics of modern operating systems Concurrency ( 并发 ) Sharing ( 共享 ) Virtualization ( 虚拟 ) Asynchronism ( 异步 ) Guo, Xunhua 55
  • 56. Concurrency Concurrency Several events take places in a same time period Several programs (processes) run in the same time A modern operating system is a concurrency system The co-existence of multi events and processes is managed by the OS Guo, Xunhua 56
  • 57. Sharing Sharing: several processes share the limited computer system resource An OS shall manage the system resource for proper sharing Resources are used alternatively by multi processes Exclusive sharing: e.g. printers Non-exclusive sharing: e.g. harddisks Guo, Xunhua 57
  • 58. Virtualization Virtualization: A physical entity is map to several logical entities with time or space An important way to improve the utilization effectiveness of resources Virtual processor Virtual storage Virtual device Guo, Xunhua 58
  • 60. Asynchronism Conditions Several processes execute concurrently The execution sequence and time of processes are uncertain The speed of process execution is not pre- determined Target No matter how the processes are executed, the results must be the sam Guo, Xunhua 60
  • 61. Exercises Reading: Chapter 2 and 3, Textbook Questions: Why is the distinction between monitor mode and user mode important? What are different between system calls and library functions? Guo, Xunhua 61