Chp 1 Introduction

tags: 作業系統

Operation System

  • Computer Structure

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

“The one program running at all times on the computer” is the kernel.

Program, Proccese, Thread

Ref: Program/Process/Thread 差異

  • Program: 還尚未load入記憶體的 code (工廠藍圖)

    • 相同 Program 的 Process 可以多個同時存在
    • Passive Entity
  • Process: 已經執行並且 load 到記憶體中的 Program (運作之工廠)

    • Active Entity
    • Process 是電腦中已執行 Program 的實體
    • 一個 CPU 一次只能執行一個 Process,每一個 Process 互相獨立
    • Process 的運行量總量不會少於 CPU 的總量
  • Thread: Process 是 Thread 的容器 (工廠工人)

    • 同一個 Process 可以同時存在多個 Thread
    • 同一個 Process 底下的 Thread 共享資源,不同的Process 則否
    • 兩個以上執行緒若同時存取或改變全域變數(Global Variable),則可能發生同步(Synchronization,恐龍本第六章)問題。
    • 若執行緒之間互搶資源,則可能產生死結(Deadlock,恐龍本第七章)

不同的Process一樣可以共享資源,這可以藉由share memory或是message passing model達成,message passing model可以是socket或是其他的通訊方式
不管是thread或是process之間,要共享資源就要解決互搶資源的現象,如同Thread第3,4點所述,解決的方式可以藉由添加互斥鎖,之後會教。
Neko

  • program counter
    • specifying location of next instruction to execute
    • one program counter per thread

Interrupt

  • Polling

    • Idle 時,固定隔一段時間從Queue檢查是否有interrupt

    說Queue好像有點怪怪的,但是總之就是固定去檢查裝置
    Neko

  • vectored interrupt system

  • vectored v.s. non-vectored interrupt

  • Interrupt v.s Trap(or exception)

    • Interrupt
      • hardware-generated
    • Trap:
      • software-generated

I/O Structure

  • System call

    • request to the OS to allow user to wait for I/O completion.
  • Device-status table

    • 同時有很多I/O運作,儲存各個I/O狀態在此

Storage

  • Storage Hierarchy
    • Speed
    • Cost
    • Volatility (need extra power to store the data)

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

  • Main Memory

    • Random access
    • Volatile
  • Caching

    • Copying information into faster storage system
  • Direct Memory Access(DMA)

    • Transfers blocks of data from buffer storage directly to main memory without CPU.
    • Close to the memory speeds

Computer-System Architecture

  • DEFINITION

    • Core — The basic computation unit of the CPU.
    • CPU — The hardware that executes instructions.
    • Processor — A physical chip that contains one or more CPUs.
  • Multiprocessors

    • parallel systems, tightly-coupled systems
    • Types & Difference
      • Asymmetric Multiprocessor
        • Only Master processor run the tasks of OS
        • Master processor allocate work to slave processor
        • No-shared memory
      • Symmetric Multiprocessor
        • Each processor run the tasks in OS
        • shared memory
  • Multi-chip, Multicores

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  • Multiprocessor VS Multicore

Multicore Multiprocessor
Definition a single CPU with
multiple execution unit
a system that
has two or more CPUs
Advantage execute single program faster execute multiple program faster
Reliablility not reliable more reliable
CPU won't affect the other
  • Multiprogramming (Batch system)

    • organizes jobs to keep CPU executing
    • require job scheduling
  • Timesharing (multitasking)

    • CPU switches jobs frequently to create interactive computing
    • require CPU scheduling
  • Clustered Systems

    • multiple systems working together
    • parallelization required
    • distributed lock manager (DLM) avoid conflict operations
    • Type
      • Asymmetric
        • one machine in hot-standby mode
        • a hot standby node is part of the system . The hot standby node continuously monitors the server and if it fails, the hot standby node takes its place.
      • Symmetric
        • multiple nodes running, monitoring each other

Network 的概念?

Omnom

Dual-Mode

  • Purpose: Allow OS to protect itself and other system components.
  • user mode (mode bit=1) and kernel mode (mode bit=0)
  • Some privileged instructions only excutable in kernel mode
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

Network

  • Distributed Computing (TCP/IP)

    • Local Area Network (LAN)
    • Wide Area Network (WAN)
    • Metropolitan Area Network (MAN)
    • Personal Area Network (PAN)
  • Client-Server

    • Compute-server: clients request services
    • File-server: clients store and retrieve files
  • Peer-to-Peer

    • no distinguish clients and servers
    • Broadcast request via discovery protocol

Virtualization

Simulator and Emulator