操作系统课程摘要第一章:导论

1. Chapter 1: Introduction

1.1. What Operating Systems Do

A program that acts as an intermediary between a user of a computerand the computer hardware

1.1.1. Operating system goals

  1. Execute user programs and make solving user problems easier

  2. Make the computer system convenient to use

  3. Use the computer hardware in an efficient manner

1.1.2. Computer System Structure

Four components:

  1. Hardware

  2. Operating system

  3. Application programs

  4. Users

1.1.3. What Operating Systems Do

1.1.3.1. User View ( Interactivity )

  1. Users isolated at home want convenience, ease of use! Do not care about resource utilization!

  2. Shared computer such as mainframe or minicomputer must keep allusers happy.

  3. Handheld computers are resource poor, optimized for usability and battery life, for more portable.

  4. Some computers have little or no user interface, such as embedded computers in devices and automobiles, for more automatic.

1.1.3.2. System View ( organizational)

  1. OS is a resource allocator

    The operating system manages all resources, and it must decide how to allocate them to specific programs and users so that it can operate the computer system efficiently and fairly.

  2. OS is a control program

    Controls execution of programs to prevent errors and improper use of the computer

1.1.4. Operating System Definition

No universally accepted definition, A more common definition is that the operating system is the one program running at all times on the computer (usually called the kernel), with all else being systems programs and application programs.

1.2. Computer-System Organization

A modern general-purpose computer system consists of one or more CPUs and a number of device controllers connected through a common bus that provides access to shared memory

1.2.1. Computer-system operation

  1. Some Operations:
    • 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 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
  2. Computer Startup
    bootstrap program is loaded at power-up or reboot

    • Typically stored in ROM or EPROM, generally known as firmware!
    • Initializes all aspects of system, from CPU registers to device controllers to memory contents.
    • Locate and load into memory the operatingsystem kernel. Then OS starts executing the first process, such as “init,” and waits for some event to occur.

      1.2.1.1. Interrupts

      An operating system is interrupt driven
  3. Interrupts by hardware ( Interrupts )

    • Interrupt transfers control to the interrupt service routine generally, through the interrupt vector, which contains the addresses of all the service routines.

    • Interrupt architecture must save the address of the interrupted instruction. ( After the interrupt is serviced, the saved return address is loaded into the program counter, and the interrupted computation resumes as though the interrupt had not occurred. )

  4. interrupts by software ( trap or exception )

    • A trap (or an exception) is a software-generated interrupt caused either by an error (for example, division by zero or invalid memory access) or by a specific request from a user program that an operating-system service be performed.

    • Software may trigger an interrupt by executing a special operation called a system call ( also called a monitor call ). System call is kind of trap.

1.2.1.2. Interrupt Handling

  1. The operating system preserves the state of the CPU by storing registers and the program counter

  2. Determines which type of interrupt has occurred by polling and vectored interrupt system

  3. Then, separate segments of code determine what action should be taken for each type of interrupt

1.2.2. Storage Structure

……

1.2.3. I/O Structure

1.3. Computer-System Architecture

1.4. Operating-System Structure

1.5. Operating-System Operations

1.6. Process Management

1.7. Memory Management

1.8. Storage Management

1.9. Protection and Security

1.10. Kernel Data Structures

1.11. Computing Environments

1.12. Open-Source Operating Systems