2015年12月8日 星期二

Operating System - CH1 Introduction

User View of OS
  • mainframe view: 最大化resource utilization
  • workstation or server view: individual usability and resource utilization 的取捨
  • PC view: ease of use, performance
  • handheld: individual usability and performance per amount of battery

bootstrap program: 一開機時會載入的
  • 存在 ROM、EEPROM 就是 firmware
  • load OS kernel and starts execution

Interrupt
  • hardware: sending a signal to CPU
  • software: system call
  • functions:
    • (1) Trap, Exception: from software ex: devided by zero, illegal memory access
    • (2) interrupt: from hardware  ex: I/O complete
  • OS會查詢 interrupt vector 確認何種中斷發生,並找出對應interrupt service routine的address

Multiprocessor systems
  • parallel system、 tightly-coupled system
  • 多顆CPU存在於同一部機器,所有cpu共享memory, I/O devices, bus etc.
  • 優點: 
    • increase throughput
    • economy of scale
    • increase reliability- graceful degradation(無視硬體的錯誤,而持續運作的能力,稱適度的降級) or fault tolerance
  • two types
    • asymmetric: 有主從架構,有一個master CPU, 其餘為 slave CPU, 效能較差(Master 是瓶頸),reliability較差。
    • symmetric: load balance,有一個break, 其他可以馬上補上。

Clustered systems: like multiprocessor, 但他是集結許多CPU來完成工作
  • high-availability
  • asymmetric: one machine in standby mode, 監督工作用。 
  • symmetric: multiple nodes run app and monitoring each other。



Multuprogramming System
允許多個processes執行,透過CPU scheduling, 讓許多在各個不同process之間切換執行,只要processes夠多,cpu utilization就會夠高。
organize jobs so CPU always has one to execute.

Timesharing(Multitasking)
CPU switch jobs very frequently that user can interact with each job while it is running, creating interactive computing

Process: 執行中的program
  • program is passive, process is active
Program counter: 為下一個執行指令的位置

Concurrent: 同時間下 只有處理一個process
Parallel: 同時間下 處理多個process (多顆CPU)

Distributed systems: 
  • loosely-coupled system
  • 以network相互串聯
  • process之間構通都以 message passing
  • 優點
    • resource sharing
    • computation speed up
    • reliability

Dual-mode
  • 對硬體重要的resource實施保護,把可能危害機器的指令設為privieged instruction,可防止user program去使用
  • 需要硬體支援,提供mode bit 來區分
  • user mode
  • kernel mode

buffering: store data 暫時的 while it is being transferred
cashing: store data in faster storage for performance
spooling: the overlapping of output of one job with input of the other jobs. 可以允許某個工作的CPU運算與另一個工作I/O同步執行。

Computing environment:
  • compute server: provide an interface for client to request service
  • file server: store and retrieve file, provide service

peer-to-peer
  • node must join P2P network
    • register its service with central lookup service
    • broadcast request service and respond to via discovery protocol


Batch system (批次系統)
將一些非急迫性或具周期性的工作累積成堆,再整批送入系統處理,過程中通常不跟user互動。 ex: 報稅 普查 


用於冷門時段,提高resource utlization

沒有留言:

張貼留言