SlideShare una empresa de Scribd logo
1 de 61
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

Operating systems
Operating systemsOperating systems
Operating systemsJoshuaIgo
 
2 operating system structures
2 operating system structures2 operating system structures
2 operating system structuresDr. Loganathan R
 
Operating System Concepts Presentation
Operating System Concepts PresentationOperating System Concepts Presentation
Operating System Concepts PresentationNitish Jadia
 
Operating system
Operating systemOperating system
Operating systemmak120
 
System Z operating system
System Z operating systemSystem Z operating system
System Z operating systemArpana 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 NOTESsuthi
 
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 systemSuvithak
 
Operating system notes ch1
Operating system notes ch1Operating system notes ch1
Operating system notes ch1Emmanuel 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 systemsTushar Rajput
 
OS - Operating System
OS - Operating System OS - Operating System
OS - Operating System MaqdamYasir
 
How Operating system works.
How Operating system works. How Operating system works.
How Operating system works. Fahad Farooq
 

La actualidad más candente (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.
 

Destacado

Developing Technology-Enhanced Learning at DMU
Developing Technology-Enhanced Learning at DMUDeveloping Technology-Enhanced Learning at DMU
Developing Technology-Enhanced Learning at DMURichard Hall
 
Beginner's guide to drupal
Beginner's guide to drupalBeginner's guide to drupal
Beginner's guide to drupalmayank.grd
 
Course and Module Introduction
Course and Module IntroductionCourse and Module Introduction
Course and Module Introductionsekaminski
 
Operating system concepts
Operating system conceptsOperating system concepts
Operating system conceptsStarlee Lathong
 
Banking In Tally.ERP 9
Banking In Tally.ERP 9Banking In Tally.ERP 9
Banking In Tally.ERP 9TallyERP9
 
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 developersLucas Jellema
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modulesEddy Reyes
 
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 StructuresShafaan 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 ModuleResilient Systems
 

Destacado (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 a 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.pptxhasanbashar400
 
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 Systemprakash 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.pptxiloveyoucarlo0923
 
Chap1_Introduction.pdf
Chap1_Introduction.pdfChap1_Introduction.pdf
Chap1_Introduction.pdfYuChianWu1
 
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.pptxPannaBushratul
 
Computer System Class - 9
Computer System Class - 9Computer System Class - 9
Computer System Class - 9NehaRohtagi1
 
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.pdfAsst.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 NOTESKopinathMURUGESAN
 
Chapter 1 - Introduction
Chapter 1 - IntroductionChapter 1 - Introduction
Chapter 1 - IntroductionWayne Jones Jnr
 
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
 
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 IntroductionArnoyKhan
 
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 sysyemsJyoReddy9
 
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.pptxPannaBushratul
 
Operating System and related questions
Operating System and related questionsOperating System and related questions
Operating System and related questionsimdurgesh
 
IO SYSTEM AND CASE STUDY STRUCTURE
IO SYSTEM AND CASE STUDY STRUCTUREIO SYSTEM AND CASE STUDY STRUCTURE
IO SYSTEM AND CASE STUDY STRUCTUREHariharan Anand
 

Similar a 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
 
Chapter 1 - Introduction
Chapter 1 - IntroductionChapter 1 - Introduction
Chapter 1 - Introduction
 
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
 
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 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
 
Microcontroller part 1
Microcontroller part 1Microcontroller part 1
Microcontroller part 1
 

Último

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

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