Operating System Concepts 9th Chapter 1 - Introduction

Introduction

目录

  • Introduction
        • 1.What Operating Systems Do
        • 2.Computer-System Organization
            • 2.1 Storage Structure
            • 2.2 I/O Structure
        • 3.Computer-System Architectur
            • 3.1 Single-Processor Systems
            • 3.2 Multiprocessor Systems
            • 3.3 Clustered System
        • 4. Operating-System Operations
            • 4.1 Dual-Mode and Multimode Operation
            • 4.2 Trap
            • 4.3 Exception
            • 4.4 Timer
        • 5. Process Management
        • 6. Memory Management
        • 7. Storage Management
            • 7.1 File-System Management
            • 7.2 Mass-Storage Management
            • 7.3 Caching
            • 7.4 I/O System
        • 8. Protection and Security
        • 9. Kernel Data Structures
        • 10. Computing Environments
        • 11. Open-Source Operating Systems

1.What Operating Systems Do

Operating System Concepts 9th Chapter 1 - Introduction_第1张图片

  • Computer = HW(硬件) + OS(操作系统) + Apps + Users
  • OS provides services for Apps & Users
    Make the computer system convenient to use
  • OS manages resources (computing, storage, networking)
    Use the computer hardware in an efficient manner
  • Debates about what is included in the OS - Just the kernel, or everything the vendor ships? ( Consider the distinction between system applications and 3rd party or user apps. )
2.Computer-System Organization

Operating System Concepts 9th Chapter 1 - Introduction_第2张图片

  • Shared memory(共享内存) between CPU and I/O cards
  • Bootstrap program (BIOS)
  • Interrupt handling
    HW
    SW,Implementation of system calls
2.1 Storage Structure

Operating System Concepts 9th Chapter 1 - Introduction_第3张图片

  • Main memory ( RAM )
    Programs must be loaded into RAM to run.
    Instructions and data fetched from RAM into registers.
    RAM is volatile
    “Medium” size and speed
  • Other electronic ( volatile ) memory is faster, smaller, and more expensive per bit:
    Registers
    CPU Cache
  • Non-volatile memory ( “permanent” storage ) is slower, larger, and less expensive per bit:
    Electronic disks
    Magnetic disks
    Optical disks
    Magnetic Tapes
2.2 I/O Structure

Operating System Concepts 9th Chapter 1 - Introduction_第4张图片

  • Polling
  • Interrupt
  • DMA
3.Computer-System Architectur
  • Different Operating Systems for Different Kinds of Computer Environments
    Single-Processor Systems
    Multiprocessor System
    Clustered System
3.1 Single-Processor Systems
  • One main CPU which manages the computer and runs user apps.
  • Other specialized processors ( GPUs, etc. ) do not run user apps
3.2 Multiprocessor Systems
  • Increased throughput - Faster execution, but not 100% linear speedup.
  • Economy of scale - Peripherals, disks, memory, shared among processors.
    Operating System Concepts 9th Chapter 1 - Introduction_第5张图片
3.3 Clustered System
  • Independent systems (nodes), with shared common storage and connected by a high-speed LAN
  • Cluster software runs on the cluster nodes
    Asymmetric clustering
    Symmetric clustering
  • HA (high-availability)
  • High-performance computing
    Operating System Concepts 9th Chapter 1 - Introduction_第6张图片
4. Operating-System Operations
  • Modern operating systems are interrupt driven.
    Hardware interrupt
    Software interrupt (trap or exception)

  • Dual-Mode and Multimode Operation

  • Timer

4.1 Dual-Mode and Multimode Operation
  • Dual-mode operation allows OS to protect itself and other system components
  • Modern computers support dual-mode operation in hardware (CPU, mode bit)•
  • User mode when executing harmless code in user applications
  • Kernel mode ( a.k.a. system mode, supervisor mode, privileged mode ) when executing potentially dangerous (critical) code in the system kernel.
    privileged instructions (I/O, enable/disable interrupt) can only be executed in kernel mode.
4.2 Trap
  • System calls is typically treated by the hardware as a software interrupt, which causes the interrupt handler to transfer control over to an appropriate service routine, which is part of the operating system, switching the mode bit to kernel mode in the process.
  • The service routine checks exactly which system call was requested, checks additional parameters (generally passed through registers ) if appropriate, and then calls the appropriate kernel service routine to handle the service requested by the system call.
4.3 Exception
  • User programs’ attempts to execute illegal instructions ( privileged or non-existent instructions), or to access forbidden memory areas, also generate software interrupts, which are trapped by the interrupt handler and control is transferred to the OS.
    1.issues an appropriate error message.
    2.possibly dumps data to a log ( core ) file for later analysis.
    3.possibly dumps data to a log ( core ) file for later analysis.

  • The concept of modes can be extended beyond two, requiring more than a single mode bit

  • CPUs that support virtualization use one of these extra bits to indicate when the virtual machine manager, VMM, is in control of the system.

4.4 Timer
  • assure that no user process can take over the system (get stuck in an infinite loop, never return control to the operating system).
  • Before the kernel begins executing user code, a timer is set to generate an interrupt after a specified period.
  • The timer interrupt handler reverts control back to the kernel.
  • Instructions of Timer control is a privileged instruction (requiring kernel mode)
5. Process Management
  • Typically system has many processes (some user, some operating system) running concurrently on one or more CPUs

    Concurrency by multiplexing the CPUs among the processes / threads

  • Creating and deleting both user and system processes (threads)

  • Ensuring that each process receives its necessary resources, without interfering with other processes.

  • Suspending and resuming processes.

  • Process ManagementProcess synchronization and communication

  • Deadlock handling

6. Memory Management
  • Allocating and deallocating memory as needed. ( E.g. new, malloc, free )
  • Keeping track of which blocks of memory are currently in use, and by which processes.
  • Determining which processes (or parts of processes) and data to move into and out of memory, and when. (virtual memory management)
7. Storage Management
  • File-System Management
  • Mass-Storage Management
  • Caching
  • I/O System
7.1 File-System Management
  • Creating and deleting files and directories
  • Supporting primitives for manipulating files and directories. ( open, flush, etc. )
  • Mapping files onto secondary storage
  • Backing up files onto stable permanent storage media
7.2 Mass-Storage Management
  • Free disk space management
  • Storage allocation
  • Disk scheduling
7.3 Caching
  • There are many cases in which a smaller higher-speed storage space serves as a cache, or temporary storage, for some of the most frequently needed portions of larger slower storage areas.
  • Cache in CPU is outside the control of OS
  • Main memory can be viewed as a fast cache for secondary storage
  • The OS is responsible for determining what information to store in what level of cache, and when to transfer data from one level to another.
  • The OS is responsible for determining what information to store in what level of cache, and when to transfer data from one level to another.
7.4 I/O System
  • A memory-management component that includes buffering, caching, and spooling.
  • A general device-driver interface.
    Character device
    Block device
  • Drivers for specific hardware devices
8. Protection and Security
  • Protection – any mechanism for controlling access of processes or users to resources defined by the OS
    User ID/Group ID is associated with all of the user’s processes and threads

  • Security – defense of the system against internal and externalattacks
    Huge range, including denial-of-service, worms, viruses, identity theft, theft of service

9. Kernel Data Structures
  • Lists, Stacks and Queues
  • Trees
  • Hash Functions and Maps
  • Bitmaps
  • Reading source code in kernel
  • Kernel Programming
10. Computing Environments
  • Traditional Computing
  • Mobile Computing
  • Distributed Systems
  • Client-Server Computing
  • Peer-to-Peer Computing
  • Virtualizatio
  • Cloud Computing
  • Real-Time Embedded Systems
11. Open-Source Operating Systems
  • BSD UNIX
    ATT Bell labs, UCB
    The core of the Mac operating system is Darwin, derived from BSD UNIX
  • Linux
    Developed by Linus Torvalds in Finland in 1991
    http://distrowatch.com
  • Solaris
    open solaris
  • Utility
    http://freshmeat.net
    http://sourceforge.net
    https://github.com

你可能感兴趣的:(操作系统)