CHAPTER 3 OPERATING SYSTEM STRUCTURES - PowerPoint PPT Presentation

About This Presentation
Title:

CHAPTER 3 OPERATING SYSTEM STRUCTURES

Description:

Deadlock handling Providing ... hard to modify MS DOS Early UNIX Systems Later divided into kernel & system programs Kernel consists of everything ... – PowerPoint PPT presentation

Number of Views:82
Avg rating:3.0/5.0
Slides: 26
Provided by: HalS88
Learn more at: http://www.cs.ucf.edu
Category:

less

Transcript and Presenter's Notes

Title: CHAPTER 3 OPERATING SYSTEM STRUCTURES


1
CHAPTER 3OPERATING SYSTEM STRUCTURES
  • CGS 3763 - Operating System Concepts
  • UCF, Spring 2004

2
OVERVIEW
  • OS can be viewed from various perspectives
  • Historical
  • Hardware/Software Integration
  • Services Provided by OS
  • User/Programmer Interfaces
  • Components
  • How Components Are Assembled

3
OVERVIEW (cont.)
  • Service - a task performed by the operating
    system
  • Explicit Services - those services performed at
    the request of the user (Command Interpreter or
    System Program) or application (System Call)
  • List Files (CI), Compile a program (SP)
  • Read data from disk, Output to printer (SC)
  • Implicit Services - those services performed by
    the OS behind the scenes to manage system
    resources or facilitate execution of a program
  • Allocate memory, trap errors, CPU scheduling
  • Component - a portion of the operating system
    program which performs a specific set of services
  • Structure - The way in which components are
    organized to create an operating system

4
OS SERVICES
  • Some services provided to programmer, user or
    application through explicit requests (SP/SC)
  • Program execution system capability to load a
    program into memory and to run it.
  • I/O operations since user programs cannot
    execute I/O operations directly, the operating
    system must provide some means to perform I/O.
  • File-system manipulation program capability to
    read, write, create, and delete files.
  • Communications exchange of information between
    processes executing either on the same computer
    or on different systems tied together by a
    network. Implemented via shared memory or
    message passing.

5
OS SERVICES (cont.)
  • Additional services provided not for helping the
    user, but rather for ensuring efficient system
    operations (implicit services)
  • Resource allocation allocating resources to
    multiple users or multiple jobs running at the
    same time.
  • Accounting keep track of and record which users
    use how much and what kinds of computer resources
    for account billing or for accumulating usage
    statistics.
  • Protection ensuring that all access to system
    resources is controlled.
  • Error detection ensure correct computing by
    detecting errors in the CPU and memory hardware,
    in I/O devices, or in user programs.

6
OS COMPONENTS
  • Process Management
  • Main Memory Management
  • File Management
  • I/O Management
  • Secondary/Tertiary Storage Management
  • Networking
  • Protection
  • Command Interpreter

7
COMPONENTS Process Management
  • 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 the
    following activities in connection with process
    management.
  • Process creation and deletion.
  • Process suspension and resumption.
  • Deadlock handling
  • Providing mechanisms for
  • process synchronization
  • interprocess communication

8
Interprocess Communication Models
Msg Passing
Shared Memory
9
COMPONENTS 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. It
    loses its contents in the case of system failure.
  • The operating system is responsible for the
    following activities in connections with memory
    management
  • 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.

10
COMPONENTS File Management
  • A file is a collection of related information
    defined by its creator. Commonly, files
    represent programs (both source and object forms)
    and data.
  • The operating system is responsible for the
    following activities in connections with file
    management
  • 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.

11
COMPONENTS I/O System Management
  • The I/O system consists of
  • A buffer-caching system
  • A general device-driver interface
  • Drivers for specific hardware devices
  • Operating System is responsible for hiding the
    peculiarities of I/O devices from the user or
    application
  • Keyboard Mouse
  • Monitor, Printer
  • Network Interface Card or Modem
  • Joystick, webcam, sound cards
  • Disks and other storage devices

12
COMPONENTS Secondary Storage Management
  • Since main memory (primary storage) is volatile
    and too small to accommodate all data and
    programs permanently, the computer system must
    provide secondary storage to back up main memory.
  • Most modern computer systems use disks as the
    principle on-line storage medium, for both
    programs and data.
  • The operating system is responsible for the
    following activities in connection with disk
    management
  • Free space management
  • Storage allocation
  • Disk scheduling

13
COMPONENTS Networking
  • A distributed or loosely coupled 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.
  • Access to a shared resource allows
  • Computation speed-up
  • Increased data availability
  • Enhanced reliability

14
OS COMPONENTS Protection
  • 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.

15
COMMUNICATING WITH THE OS
  • System Calls (by Application Program)
  • aka Supervisor Calls (SVC)
  • Interface between a process and the OS
  • Are placed into code by programmer using
  • Assembly language instructions
  • Application Programmer Interface (API)
  • Five major call types
  • Process Control
  • File Management
  • Device Management
  • Information Maintenance
  • Communications

16
COMMUNICATING WITH THE OS (cont.)
  • System Software (by End User)
  • Provide for convenient program development and
    execution
  • Sometimes referred to as system utilities
  • Major Categories
  • File Management
  • Status Information
  • File Modification (text editors)
  • Programming Language Support (e.g., compilers)
  • Program loading and execution
  • Communications
  • Different from application programs which perform
    a business, scientific or entertainment function
  • Accessed through the command interpreter

17
COMMUNICATING WITH THE OS (cont.)
  • Command-Interpreter
  • A program that reads and interprets control
    statements. Sometimes referred to as
  • control-card interpreter
  • command-line interpreter
  • shell (in UNIX)
  • graphical user interface (in Windows/Mac OS)
  • Its function is to get and execute the next
    command statement or system program requested by
    the user
  • Most users view of the operation system is
    defined by system programs and the command
    interpreter, not the actual system calls or
    components.

18
OS STRUCTURE
  • Simple (monolithic) Approach
  • Majority of OS written as one program
  • OS resident at all times and runs as single
    process
  • Hard to debug, hard to modify
  • MS DOS
  • Early UNIX Systems
  • Later divided into kernel system programs
  • Kernel consists of everything below the
    system-call interface (API) and above the
    physical hardware
  • Kernel provided the file system, CPU scheduling,
    memory management, and other operating-system
    functions.

19
UNIX System Structure
20
OS STRUCTURE (cont.)
  • Layered Approach
  • OS is divided into a number of layers (levels)
  • Each higher layer built on top of lower layers.
  • The bottom layer (layer 0), is the hardware the
    highest (layer N) is the user interface.
  • Layers are ordered such that each uses functions
    (operations) and services of only lower-level
    layers.
  • Advantages
  • Modularity of design, hides lower level details
  • Simplifies debugging and verification
  • Disadvantages
  • Difficult to decide order of layers
  • Less efficient, lots of calls between layers

21
OS STRUCTURE (cont.)
  • Kernel Approach
  • Select subset of OS services and components for a
    Kernel
  • Kernel process stays resident and runs at all
    times
  • Other OS services provided through separate
    programs loaded only when required. These run as
    separate processes.
  • Microkernel
  • Reduce subset of services and components to bare
    minimum
  • Process Management
  • Memory Management
  • Interprocess Communication/Synchronization
  • Microkernel functions primarily as communication
    facility between users program and rest of OS
    processes
  • Advantages
  • Easy to modify extend OS
  • Improved security reliability

22
DESIGNING AN OPERATING SYSTEM
  • User goals operating system should be
    convenient to use, easy to learn, reliable, safe,
    and fast.
  • System goals operating system should be easy to
    design, implement, and maintain, as well as
    flexible, reliable, error-free, and efficient.

23
MECHANISMS VS. POLICIES
  • Mechanisms determine how to do something,
    policies decide what will be done.
  • The separation of policy from mechanism is a very
    important principle, it allows maximum
    flexibility if policy decisions are to be changed
    later.

24
OS IMPLEMENTATION
  • Traditionally written in assembly language,
    operating systems can now be written in
    higher-level languages.
  • Code written in a high-level language
  • can be written faster.
  • is more compact.
  • is easier to understand and debug.
  • An operating system is far easier to port (move
    to some other hardware) if it is written in a
    high-level language.

25
SYSTEM GENERATION START UP
  • Operating systems are designed to run on any of a
    class of machines the system must be configured
    for each specific computer site.
  • SYSGEN program obtains information concerning the
    specific configuration of the hardware system.
  • Booting starting a computer by loading the
    kernel.
  • Bootstrap program code stored in ROM that is
    able to locate the kernel, load it into memory,
    and start its execution.
Write a Comment
User Comments (0)
About PowerShow.com