SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
Operating System Organization

    COMP 229 (Section PP) Week 7

        Prof. Richard Zanibbi
        Concordia University
            Feb. 27, 2006
Last Week...
• Classic Processes (e.g. in “Old” UNIX)
• Multithreaded Processes (e.g. in Linux, Windows)
• File (e.g. open()) and Process (e.g. fork(),
  CreateThread()) System Calls
• Creating Processes and Threads
• Resource Management
• Resource Descriptors (file and process)
• Overview of Writing Concurrent Programs
• Objects and Operating Systems
• Why do shells run commands and programs
  in child processes?                                2
(Initial Process, after turning computer on)

                           Bootstrap Loader
Child Process of             (Loads OS)                           Parent Process of



                                 OS (UNIX)
                                                                   Sibling Processes

          Login Shell 1         Login Shell 2           Login Shell 3



                                Bash Shell


               Email Program                    Web Browser
COMP229-PP-Week7                                                                       3
This week...
       Operating System Organization
  Basic OS Functions (pp. 89-94)
      1.   Device Management
      2.   Process and Resource Management
      3.   Memory Management
      4.   File Management

  Implementation Issues (pp. 94-103)
      Processor Modes
      Kernels
      Requesting OS Services
      Software Modularization

  Contemporary OS Kernels (pp. 104-110)
      UNIX Kernels
      Windows NT Executive Kernel
COMP229-PP-Week7                             4
Basic OS Functions

  (pp. 89-94, Part II)
Basic OS Functions
  As Approximate Notion....
      –        There is no formal definition of the functions of an operating
               system.
      –        OS designs influenced by engineering issues,
               workplace/marketplace demands
           •     Is the OS for a cell phone or desk-top?
           •     For a research lab or home user?
           •     “What will help us get a grant/sell copies”?


  A Traditional View of Basic Functions:
      1.       Process, thread, and resource management
      2.       Memory Management
      3.       File Management
      4.       Device Management
COMP229-PP-Week7                                                                6
1. Device Management
Concerned With:
  – Allocation, isolation, and sharing of ‘generic devices’ (i.e. not
    including the processor and memory)
  – Most OS’s treat generic devices roughly the same
  – Applies policies chosen by the designer or system administrator

Device-Dependent Component
  Contains device drivers (unique for a device)
  Implement device functionality, software interface
     • e.g. drivers for monitors, keyboards, mp3 players...


Device-Independent Component
  A software environment in which device-dependent drivers execute;
    provided in the basic OS
     • Includes system call interface to read/write any registered device
     • Also include a mechanism to forward calls to devices
     • Small part of the device manager                                     7
Example

  See Figure 3.2
      – Note that “Device Dependent Clouds” are
        drivers
      – Example devices: keyboard, monitor, mp3
        player




COMP229-PP-Week7                                  8
Adding a Device to a System Using the
 Device Manager (Simplified Version)
 1. Inform device-independent
    component to register the new device
 2. Device-independent component
    makes the device system call
    interface available for the new device
 3. Device Driver is installed (loaded onto
    a storage device in the system)
 4. When system call for the new device
    is later made, the driver implements
    the system call interface actions         9
2. Process, Thread, and Resource
              Management
  Implements Abstract Machines
      ...including scheduling processes/threads and managing
         their associated resources
      – usually implemented as a single module, defining the
         abstract machine environment as a whole
      – If OS allows threaded processes, then processes and
         threads must be managed separately

  Resource Manager
      – Allocates and book-keeps available and utilized
        resources
      – Change in resource often related to change in a
        process: so resource management often discussed as
        part of process management
COMP229-PP-Week7                                               10
Process, Thread, and Resource
            Management, Cont’d
  Process Manager
      – Provides multiple abstract machines (execution
        contexts)
      – Allows multiple users, processes and/or threads to
        share the processor
      Key issue: how will processor time be allocated between
        processes?


  See Fig. 3.3
      Abstract Resource example: a File

COMP229-PP-Week7                                                11
3. Memory Management
  Functions
      – Cooperates with Process Manager to allocate
        main (“primary”) memory to processes
      – Applies allocation policy given by system
        administrator

  Resource Isolation
      – Enforces resource isolation for memory
      – Provides means to bypass isolation so
        processes can share memory
COMP229-PP-Week7                                      12
Memory Management, Cont’d
  Virtual Memory
      –    an Abstract Resource which allows abstract machines to
           request more memory than is physically available
      –    Achieved by writing/retrieving memory blocks on storage
           devices (e.g. disk)

  Distributed Shared Memory Abstraction
      –    allows a thread on a machine to access and share physical
           memory on another machine
      –    Achieved using message-passing over a network

  See Figure 3.4
      –    Remember that the Process Manager and Memory Manager
           co-operate (i.e. communicate) extensively: in class, there was
           an error added to indicate this.
COMP229-PP-Week7                                                            13
4. File Manager
Files as Abstract Resource
 – Recall: files allow storage devices to be represented in
   a simple, uniform way
 – Memory is volatile, and may be overwritten as new
   processes have their turn on the processor
 – File manager implements the file system (e.g. directory
   tree), used to store memory when it needs to be stored

File Manager
 – Interacts with the device manager and memory
   manager
 – Modern era: may be distributed over a network of
   machines, to allow systems to read/write files on
   remote machines                                            14
Implementation Issues

   (pp. 94-103, Part II)
Implementation Mechanisms
  Recurring Issues
      1. Performance (“speed”, maximize use of resources)
      2. Resource Isolation
         –    esp. to allow processes to save data without a risk it will be
              corrupted


  Implementation Mechanisms
      1. Processor modes: user vs. supervisor modes
      2. Kernels (trusted software module used to support all
         other software)
      3. Invoking system services: either through system
         functions, or sending messages to a system process
COMP229-PP-Week7                                                               16
Abstraction vs. Overhead
  OS-provided Abstractions
      Simplify programming and system management
      Use resources (e.g. “takes time”)


  OS Design Trade-offs
      – Designers need to balance the benefit of OS features
        for users/programmers against the resources needed
        to implement the feature
      – As hardware improves, more abstraction becomes
        reasonable (e.g. graphics, windows)

COMP229-PP-Week7                                               17
Resource Isolation
Purpose (again)
  Roughly, we want to prevent processes from interfering with one
   another (e.g. overwriting one another’s data in memory or on disk)


Protection Mechanisms, Security Policies
  – OS provides protection mechanisms (e.g. file access policies) for
    implementing a security policy on a machine
  – Security policy is chosen by sys. admin.

Kernel
  – Implements all secure operations (and is trusted)
  – Provides a barrier between between “trusted” routines in the
    kernel that manage system operation, and all other system and
    application software
  – All software outside of the kernel is untrusted,                    18
Processor Modes
Mode Bit
  – Provided in modern processors to determine which instructions
    and memory locations are available to an executing program
  – Allows resource isolation to be enforced

Trusted Software (e.g. Kernel)
  – Uses processor in supervisor mode (all operations)
  – Operations run only in supervisor mode: supervisor, privileged, or
    protected
     • e.g. I/O operations are protected
  – Can access all memory (system space)

Untrusted Software
  – Uses processor in user mode (restricted operation set)
     • e.g. to perform I/O, applications must request the OS to perform the
       operation
  – Can access restricted portion of memory (user space)
                                                                              19
Examples
  See Fig 3.5
      – processor is using register accessible only to the
        executing process
      – Only a privileged instruction run by a program running
        in supervisor mode can load the contents of object
        pointer register shown


  See Fig 3.6
      Memory accessible in user mode (“user space”) is a
       subset of the supervisor space (“system space”)

COMP229-PP-Week7                                                 20
Mode Bits, cont’d

  Older Systems (e.g. 8088/8086)
      Did not have a supervisor mode
      Made it hard to provide robust isolation (lots of
       rebooting)




COMP229-PP-Week7                                          21
User Programs Requesting OS
          Services from the Kernel:
              Trap Instructions
  Trap Instructions
       – similar to a hardware interrupt
       – used by programs running in user mode to request
         OS services
       – OS services in the kernel are run in supervisor mode


  Only kernel functions have access to kernel
   data structures (e.g. resource descriptors)

COMP229-PP-Week7                                                22
Two Methods for Using Traps
                (see Fig 3.7)
  System Calls (e.g. Figures 3.8, 3.9)
      – User process issues a “trap” instruction; results in a
        reference into a trap table
      – “Stub” functions are provided to hide some details of
        the trap call (e.g. fork())


  Message Passing
      – User process issues a send() system call that
        communicates with an OS process
      – OS process executes the trap instruction in supervisor
        mode, returns a message to the calling user process
COMP229-PP-Week7                                                 23
Basic Operating System Organization

  See Figure 3.10
      Notice that the only two OS managers we’ve
       looked at that don’t communicate extensively
       are the Memory and Device managers.




COMP229-PP-Week7                                      24
Interaction of Basic OS Components:
     Modularity vs. Performance
  Modularity of Components
      Would allow modules to keep relevant data structures separate from other
       modules

  Performance
      Using additional functions to modify OS data structures slows performance
        down
      Traditionally, components implemented in one module (e.g. the Unix kernel)

  Monolithic Kernel
      All components implemented in one module (e.g. Unix)

  Microkernels
      – Only operations that must be trusted are implemented in the kernel (e.g.
        thread scheduling, hardware device management)
      – Goal: minimize trusted code size
      – Results in many system calls into the micokernel
COMP229-PP-Week7                                                                   25
Contemporary OS Kernels

           (pp. 104-110, Part II)

         ** See Figures 3.11, 3.12

Note that the Windows NT/2000/XP Kernel is
           similar to a microkernel
Next Week...

    Process and Resource Management
        read pages 199-228 (Part II, Chapter 6)




COMP229-PP-Week7                                  27

Contenu connexe

Tendances

5. spooling and buffering
5. spooling and buffering 5. spooling and buffering
5. spooling and buffering
myrajendra
 
Lecture6 memory hierarchy
Lecture6 memory hierarchyLecture6 memory hierarchy
Lecture6 memory hierarchy
li12x
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
Ravindra Raju Kolahalam
 
Internet control message protocol
Internet control message protocolInternet control message protocol
Internet control message protocol
asimnawaz54
 

Tendances (20)

chapter 1 introduction to operating system
chapter 1 introduction to operating systemchapter 1 introduction to operating system
chapter 1 introduction to operating system
 
OS Memory Management
OS Memory ManagementOS Memory Management
OS Memory Management
 
5. spooling and buffering
5. spooling and buffering 5. spooling and buffering
5. spooling and buffering
 
TCP/IP and UDP protocols
TCP/IP and UDP protocolsTCP/IP and UDP protocols
TCP/IP and UDP protocols
 
Memory management
Memory managementMemory management
Memory management
 
Lecture6 memory hierarchy
Lecture6 memory hierarchyLecture6 memory hierarchy
Lecture6 memory hierarchy
 
Application Layer
Application LayerApplication Layer
Application Layer
 
Linux booting process - Linux System Administration
Linux booting process - Linux System AdministrationLinux booting process - Linux System Administration
Linux booting process - Linux System Administration
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
Computer security overview
Computer security overviewComputer security overview
Computer security overview
 
Data Backup (IT) Lecture Slide # 5
Data Backup (IT) Lecture Slide # 5Data Backup (IT) Lecture Slide # 5
Data Backup (IT) Lecture Slide # 5
 
Input output in linux
Input output in linuxInput output in linux
Input output in linux
 
Internet control message protocol
Internet control message protocolInternet control message protocol
Internet control message protocol
 
operating system structure
operating system structureoperating system structure
operating system structure
 
CS6551 COMPUTER NETWORKS
CS6551 COMPUTER NETWORKSCS6551 COMPUTER NETWORKS
CS6551 COMPUTER NETWORKS
 
Simple Network Management Protocol by vikas jagtap
Simple Network Management Protocol by vikas jagtapSimple Network Management Protocol by vikas jagtap
Simple Network Management Protocol by vikas jagtap
 
Ch03 system administration
Ch03 system administration Ch03 system administration
Ch03 system administration
 
1.prallelism
1.prallelism1.prallelism
1.prallelism
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Structure of operating system
Structure of operating systemStructure of operating system
Structure of operating system
 

En vedette

Functions of OS Computer Application in Business
Functions of OS Computer Application in BusinessFunctions of OS Computer Application in Business
Functions of OS Computer Application in Business
Nethan P
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)
Vaibhav Bajaj
 
Functions Of Operating Systems
Functions Of Operating SystemsFunctions Of Operating Systems
Functions Of Operating Systems
Akshay Kurup
 
Operating system introduction to operating system
Operating system   introduction to operating systemOperating system   introduction to operating system
Operating system introduction to operating system
jaydeesa17
 

En vedette (20)

Functions of OS Computer Application in Business
Functions of OS Computer Application in BusinessFunctions of OS Computer Application in Business
Functions of OS Computer Application in Business
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)
 
Operating system overview concepts ppt
Operating system overview concepts pptOperating system overview concepts ppt
Operating system overview concepts ppt
 
08 Operating System Support
08  Operating  System  Support08  Operating  System  Support
08 Operating System Support
 
Security & protection in operating system
Security & protection in operating systemSecurity & protection in operating system
Security & protection in operating system
 
Functions Of Operating Systems
Functions Of Operating SystemsFunctions Of Operating Systems
Functions Of Operating Systems
 
Os Ds Arch
Os Ds ArchOs Ds Arch
Os Ds Arch
 
Monolithic kernel
Monolithic kernelMonolithic kernel
Monolithic kernel
 
Monolithic kernel vs. Microkernel
Monolithic kernel vs. MicrokernelMonolithic kernel vs. Microkernel
Monolithic kernel vs. Microkernel
 
Threads concept in java
Threads concept in javaThreads concept in java
Threads concept in java
 
Operating system introduction to operating system
Operating system   introduction to operating systemOperating system   introduction to operating system
Operating system introduction to operating system
 
Unit 4 Java
Unit 4 JavaUnit 4 Java
Unit 4 Java
 
Java And Multithreading
Java And MultithreadingJava And Multithreading
Java And Multithreading
 
Unit 1 Java
Unit 1 JavaUnit 1 Java
Unit 1 Java
 
Threads in JAVA
Threads in JAVAThreads in JAVA
Threads in JAVA
 
Operating system
Operating system Operating system
Operating system
 
Unit 2 Java
Unit 2 JavaUnit 2 Java
Unit 2 Java
 
Google app engine
Google app engineGoogle app engine
Google app engine
 
Java Basic Oops Concept
Java Basic Oops ConceptJava Basic Oops Concept
Java Basic Oops Concept
 

Similaire à Os organization

User level view of os
User level view of osUser level view of os
User level view of os
Mohd Arif
 
chapter 3 opreating system lecture note and its is impaortamt concept for mn
chapter 3 opreating system  lecture note and its is impaortamt concept for mnchapter 3 opreating system  lecture note and its is impaortamt concept for mn
chapter 3 opreating system lecture note and its is impaortamt concept for mn
dejenehundaol91
 
Process management
Process managementProcess management
Process management
Mohd Arif
 
Ch3 OS
Ch3 OSCh3 OS
Ch3 OS
C.U
 

Similaire à Os organization (20)

User level view of os
User level view of osUser level view of os
User level view of os
 
Operating system.pptx
Operating system.pptxOperating system.pptx
Operating system.pptx
 
Section02-Structures.ppt
Section02-Structures.pptSection02-Structures.ppt
Section02-Structures.ppt
 
chapter 3 opreating system lecture note and its is impaortamt concept for mn
chapter 3 opreating system  lecture note and its is impaortamt concept for mnchapter 3 opreating system  lecture note and its is impaortamt concept for mn
chapter 3 opreating system lecture note and its is impaortamt concept for mn
 
Process management
Process managementProcess management
Process management
 
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
 
cs-intro-os.ppt
cs-intro-os.pptcs-intro-os.ppt
cs-intro-os.ppt
 
Basics of Operating System
Basics of Operating SystemBasics of Operating System
Basics of Operating System
 
Ch3
Ch3Ch3
Ch3
 
Advanced_OS_Unit 1 & 2.ppt
Advanced_OS_Unit 1 & 2.pptAdvanced_OS_Unit 1 & 2.ppt
Advanced_OS_Unit 1 & 2.ppt
 
Bsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsBsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systems
 
Bsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systemsBsc cs 1 fit u-3 operating systems
Bsc cs 1 fit u-3 operating systems
 
Introduction to computer_lec_06
Introduction to computer_lec_06Introduction to computer_lec_06
Introduction to computer_lec_06
 
Bca i-fundamental of computer-u-3-functions operating systems
Bca  i-fundamental of  computer-u-3-functions operating systemsBca  i-fundamental of  computer-u-3-functions operating systems
Bca i-fundamental of computer-u-3-functions operating systems
 
EMBEDDED OS
EMBEDDED OSEMBEDDED OS
EMBEDDED OS
 
Ch3 OS
Ch3 OSCh3 OS
Ch3 OS
 
OSCh3
OSCh3OSCh3
OSCh3
 
OS_Ch3
OS_Ch3OS_Ch3
OS_Ch3
 
Introduction to computer_lec_06_fall_2018
Introduction to computer_lec_06_fall_2018Introduction to computer_lec_06_fall_2018
Introduction to computer_lec_06_fall_2018
 
Mca i-fundamental of computer-u-3-functions operating systems
Mca  i-fundamental of  computer-u-3-functions operating systemsMca  i-fundamental of  computer-u-3-functions operating systems
Mca i-fundamental of computer-u-3-functions operating systems
 

Plus de Mohd Arif

Bootp and dhcp
Bootp and dhcpBootp and dhcp
Bootp and dhcp
Mohd Arif
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarp
Mohd Arif
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocol
Mohd Arif
 
Project identification
Project identificationProject identification
Project identification
Mohd Arif
 
Project evalaution techniques
Project evalaution techniquesProject evalaution techniques
Project evalaution techniques
Mohd Arif
 
Presentation
PresentationPresentation
Presentation
Mohd Arif
 
Pointers in c
Pointers in cPointers in c
Pointers in c
Mohd Arif
 
Peer to-peer
Peer to-peerPeer to-peer
Peer to-peer
Mohd Arif
 
Overview of current communications systems
Overview of current communications systemsOverview of current communications systems
Overview of current communications systems
Mohd Arif
 
Overall 23 11_2007_hdp
Overall 23 11_2007_hdpOverall 23 11_2007_hdp
Overall 23 11_2007_hdp
Mohd Arif
 
Objectives of budgeting
Objectives of budgetingObjectives of budgeting
Objectives of budgeting
Mohd Arif
 
Network management
Network managementNetwork management
Network management
Mohd Arif
 
Networing basics
Networing basicsNetworing basics
Networing basics
Mohd Arif
 
Iris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platformIris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platform
Mohd Arif
 
Ip sec and ssl
Ip sec and  sslIp sec and  ssl
Ip sec and ssl
Mohd Arif
 
Ip security in i psec
Ip security in i psecIp security in i psec
Ip security in i psec
Mohd Arif
 
Intro to comp. hardware
Intro to comp. hardwareIntro to comp. hardware
Intro to comp. hardware
Mohd Arif
 

Plus de Mohd Arif (20)

Bootp and dhcp
Bootp and dhcpBootp and dhcp
Bootp and dhcp
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarp
 
User datagram protocol
User datagram protocolUser datagram protocol
User datagram protocol
 
Project identification
Project identificationProject identification
Project identification
 
Project evalaution techniques
Project evalaution techniquesProject evalaution techniques
Project evalaution techniques
 
Presentation
PresentationPresentation
Presentation
 
Pointers in c
Pointers in cPointers in c
Pointers in c
 
Peer to-peer
Peer to-peerPeer to-peer
Peer to-peer
 
Overview of current communications systems
Overview of current communications systemsOverview of current communications systems
Overview of current communications systems
 
Overall 23 11_2007_hdp
Overall 23 11_2007_hdpOverall 23 11_2007_hdp
Overall 23 11_2007_hdp
 
Objectives of budgeting
Objectives of budgetingObjectives of budgeting
Objectives of budgeting
 
Network management
Network managementNetwork management
Network management
 
Networing basics
Networing basicsNetworing basics
Networing basics
 
Loaders
LoadersLoaders
Loaders
 
Lists
ListsLists
Lists
 
Iris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platformIris ngx next generation ip based switching platform
Iris ngx next generation ip based switching platform
 
Ip sec and ssl
Ip sec and  sslIp sec and  ssl
Ip sec and ssl
 
Ip security in i psec
Ip security in i psecIp security in i psec
Ip security in i psec
 
Intro to comp. hardware
Intro to comp. hardwareIntro to comp. hardware
Intro to comp. hardware
 
Heap sort
Heap sortHeap sort
Heap sort
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Os organization

  • 1. Operating System Organization COMP 229 (Section PP) Week 7 Prof. Richard Zanibbi Concordia University Feb. 27, 2006
  • 2. Last Week... • Classic Processes (e.g. in “Old” UNIX) • Multithreaded Processes (e.g. in Linux, Windows) • File (e.g. open()) and Process (e.g. fork(), CreateThread()) System Calls • Creating Processes and Threads • Resource Management • Resource Descriptors (file and process) • Overview of Writing Concurrent Programs • Objects and Operating Systems • Why do shells run commands and programs in child processes? 2
  • 3. (Initial Process, after turning computer on) Bootstrap Loader Child Process of (Loads OS) Parent Process of OS (UNIX) Sibling Processes Login Shell 1 Login Shell 2 Login Shell 3 Bash Shell Email Program Web Browser COMP229-PP-Week7 3
  • 4. This week... Operating System Organization Basic OS Functions (pp. 89-94) 1. Device Management 2. Process and Resource Management 3. Memory Management 4. File Management Implementation Issues (pp. 94-103) Processor Modes Kernels Requesting OS Services Software Modularization Contemporary OS Kernels (pp. 104-110) UNIX Kernels Windows NT Executive Kernel COMP229-PP-Week7 4
  • 5. Basic OS Functions (pp. 89-94, Part II)
  • 6. Basic OS Functions As Approximate Notion.... – There is no formal definition of the functions of an operating system. – OS designs influenced by engineering issues, workplace/marketplace demands • Is the OS for a cell phone or desk-top? • For a research lab or home user? • “What will help us get a grant/sell copies”? A Traditional View of Basic Functions: 1. Process, thread, and resource management 2. Memory Management 3. File Management 4. Device Management COMP229-PP-Week7 6
  • 7. 1. Device Management Concerned With: – Allocation, isolation, and sharing of ‘generic devices’ (i.e. not including the processor and memory) – Most OS’s treat generic devices roughly the same – Applies policies chosen by the designer or system administrator Device-Dependent Component Contains device drivers (unique for a device) Implement device functionality, software interface • e.g. drivers for monitors, keyboards, mp3 players... Device-Independent Component A software environment in which device-dependent drivers execute; provided in the basic OS • Includes system call interface to read/write any registered device • Also include a mechanism to forward calls to devices • Small part of the device manager 7
  • 8. Example See Figure 3.2 – Note that “Device Dependent Clouds” are drivers – Example devices: keyboard, monitor, mp3 player COMP229-PP-Week7 8
  • 9. Adding a Device to a System Using the Device Manager (Simplified Version) 1. Inform device-independent component to register the new device 2. Device-independent component makes the device system call interface available for the new device 3. Device Driver is installed (loaded onto a storage device in the system) 4. When system call for the new device is later made, the driver implements the system call interface actions 9
  • 10. 2. Process, Thread, and Resource Management Implements Abstract Machines ...including scheduling processes/threads and managing their associated resources – usually implemented as a single module, defining the abstract machine environment as a whole – If OS allows threaded processes, then processes and threads must be managed separately Resource Manager – Allocates and book-keeps available and utilized resources – Change in resource often related to change in a process: so resource management often discussed as part of process management COMP229-PP-Week7 10
  • 11. Process, Thread, and Resource Management, Cont’d Process Manager – Provides multiple abstract machines (execution contexts) – Allows multiple users, processes and/or threads to share the processor Key issue: how will processor time be allocated between processes? See Fig. 3.3 Abstract Resource example: a File COMP229-PP-Week7 11
  • 12. 3. Memory Management Functions – Cooperates with Process Manager to allocate main (“primary”) memory to processes – Applies allocation policy given by system administrator Resource Isolation – Enforces resource isolation for memory – Provides means to bypass isolation so processes can share memory COMP229-PP-Week7 12
  • 13. Memory Management, Cont’d Virtual Memory – an Abstract Resource which allows abstract machines to request more memory than is physically available – Achieved by writing/retrieving memory blocks on storage devices (e.g. disk) Distributed Shared Memory Abstraction – allows a thread on a machine to access and share physical memory on another machine – Achieved using message-passing over a network See Figure 3.4 – Remember that the Process Manager and Memory Manager co-operate (i.e. communicate) extensively: in class, there was an error added to indicate this. COMP229-PP-Week7 13
  • 14. 4. File Manager Files as Abstract Resource – Recall: files allow storage devices to be represented in a simple, uniform way – Memory is volatile, and may be overwritten as new processes have their turn on the processor – File manager implements the file system (e.g. directory tree), used to store memory when it needs to be stored File Manager – Interacts with the device manager and memory manager – Modern era: may be distributed over a network of machines, to allow systems to read/write files on remote machines 14
  • 15. Implementation Issues (pp. 94-103, Part II)
  • 16. Implementation Mechanisms Recurring Issues 1. Performance (“speed”, maximize use of resources) 2. Resource Isolation – esp. to allow processes to save data without a risk it will be corrupted Implementation Mechanisms 1. Processor modes: user vs. supervisor modes 2. Kernels (trusted software module used to support all other software) 3. Invoking system services: either through system functions, or sending messages to a system process COMP229-PP-Week7 16
  • 17. Abstraction vs. Overhead OS-provided Abstractions Simplify programming and system management Use resources (e.g. “takes time”) OS Design Trade-offs – Designers need to balance the benefit of OS features for users/programmers against the resources needed to implement the feature – As hardware improves, more abstraction becomes reasonable (e.g. graphics, windows) COMP229-PP-Week7 17
  • 18. Resource Isolation Purpose (again) Roughly, we want to prevent processes from interfering with one another (e.g. overwriting one another’s data in memory or on disk) Protection Mechanisms, Security Policies – OS provides protection mechanisms (e.g. file access policies) for implementing a security policy on a machine – Security policy is chosen by sys. admin. Kernel – Implements all secure operations (and is trusted) – Provides a barrier between between “trusted” routines in the kernel that manage system operation, and all other system and application software – All software outside of the kernel is untrusted, 18
  • 19. Processor Modes Mode Bit – Provided in modern processors to determine which instructions and memory locations are available to an executing program – Allows resource isolation to be enforced Trusted Software (e.g. Kernel) – Uses processor in supervisor mode (all operations) – Operations run only in supervisor mode: supervisor, privileged, or protected • e.g. I/O operations are protected – Can access all memory (system space) Untrusted Software – Uses processor in user mode (restricted operation set) • e.g. to perform I/O, applications must request the OS to perform the operation – Can access restricted portion of memory (user space) 19
  • 20. Examples See Fig 3.5 – processor is using register accessible only to the executing process – Only a privileged instruction run by a program running in supervisor mode can load the contents of object pointer register shown See Fig 3.6 Memory accessible in user mode (“user space”) is a subset of the supervisor space (“system space”) COMP229-PP-Week7 20
  • 21. Mode Bits, cont’d Older Systems (e.g. 8088/8086) Did not have a supervisor mode Made it hard to provide robust isolation (lots of rebooting) COMP229-PP-Week7 21
  • 22. User Programs Requesting OS Services from the Kernel: Trap Instructions Trap Instructions – similar to a hardware interrupt – used by programs running in user mode to request OS services – OS services in the kernel are run in supervisor mode Only kernel functions have access to kernel data structures (e.g. resource descriptors) COMP229-PP-Week7 22
  • 23. Two Methods for Using Traps (see Fig 3.7) System Calls (e.g. Figures 3.8, 3.9) – User process issues a “trap” instruction; results in a reference into a trap table – “Stub” functions are provided to hide some details of the trap call (e.g. fork()) Message Passing – User process issues a send() system call that communicates with an OS process – OS process executes the trap instruction in supervisor mode, returns a message to the calling user process COMP229-PP-Week7 23
  • 24. Basic Operating System Organization See Figure 3.10 Notice that the only two OS managers we’ve looked at that don’t communicate extensively are the Memory and Device managers. COMP229-PP-Week7 24
  • 25. Interaction of Basic OS Components: Modularity vs. Performance Modularity of Components Would allow modules to keep relevant data structures separate from other modules Performance Using additional functions to modify OS data structures slows performance down Traditionally, components implemented in one module (e.g. the Unix kernel) Monolithic Kernel All components implemented in one module (e.g. Unix) Microkernels – Only operations that must be trusted are implemented in the kernel (e.g. thread scheduling, hardware device management) – Goal: minimize trusted code size – Results in many system calls into the micokernel COMP229-PP-Week7 25
  • 26. Contemporary OS Kernels (pp. 104-110, Part II) ** See Figures 3.11, 3.12 Note that the Windows NT/2000/XP Kernel is similar to a microkernel
  • 27. Next Week... Process and Resource Management read pages 199-228 (Part II, Chapter 6) COMP229-PP-Week7 27