2014年3月16日 星期日

作業系統(恐龍本) 第一章整理(1)

整理1.1~1.3

-------------------------------------------------------------------------------------
1 Introduction

01.作業系統的目標(Operating system goals):
     -執行使用者的程式、解決使用者的問題
     -讓電腦系統方便的被使用
     -有效率的管理電腦硬體

-------------------------------------------------------------------------------------
1.1 What Operating Systems Do

02.電腦系統可被分為四個構成要素(Computer system can be divided into four components):
     -硬體
     -作業系統
     -應用程式
     -使用者(包含人、機器或其他電腦)

-------------------------------------------------------------------------------------
1.1.1 User View
1.1.2 System View

03.作業系統做什麼(What Operating Systems Do)
     -Depends on the point of view
           +User View
                 -Users want convenience, ease of use,Don’t care about resource utilization
                 -Handheld computers are resource poor, optimized for usability and
                   battery life
                 -......
           +System View
                 -作業系統是一個資源分配者(OS is a resource allocator)
                       +管理所有的資源
                       +當需求互相衝突時,決定資源要配給何者
                 -作業系統是一個控制程式(OS is a control program)
                       +管理使用者程式的執行,避免錯誤與不合適(errors and improper)的使用電腦

-------------------------------------------------------------------------------------
1.1.3 Defining Operating Systems

04.定義作業系統(Operating System Definition)
     -In general, we have no completely adequate definition of an operating system.
           +In addition,wehave no universally accepted definition of what is part of
              the operating system.
           +operating system is the one program running at all times on the computer
              called the kernel

-------------------------------------------------------------------------------------
1.2 Computer-System Organization

-------------------------------------------------------------------------------------
1.2.1 Computer-System Operation

05.電腦啟動
     -電腦啟動時bootstrap program會被載入到記憶體中
     -bootstrap program通常放在ROM或EPROM,作為韌體(firmware)存在
     -初始化系統的各個層面
           +初始化CPU的暫存器(CPU registers)
           +初始化裝置控制器(device controllers)
           +初始化記憶體的內容(memory contents)
     -載入並執行作業系統的核心(kernel)

06.中斷(interrupt) (p8)
     -軟體發出中斷
           +executing a special operation called a system call
     -硬體發出中斷
           +sending a signal to the CPU, usually by way of the system bus
     -中斷向量(interruptvector)

-------------------------------------------------------------------------------------
1.2.2 Storage Structure

07.Memory的種類
     -DRAM(dynamic random-access memory)
     -ROM(read-only memory)
           +因為ROM不能被修改,只有static的程式,像是開機程式被存在那
     -EEPROM(electrically erasable programmable read-only memory)
           +EEPROM無法被頻繁的修改,通常放著不易改變的程式,以智慧型手機來說,
            EEPROM存著原廠安裝的程式

08.Storage-device hierarchy
     -根據速度價錢以及volatile/nonvolatile,可由高到低排成這樣的層級
           +Register
           +Cache
           +Main memory(DRAM)
           +SSD(solid-state disk)
           +Magnetic disk
           +Optical disk
           +Magnitic tapes
                 -

09.volatile storage 與 nonvolatile storage
     -volatile storage 在停止供電後,會失去所有儲存的資料
     -nonvolatile storage 在停止供電後,不會失去儲存的資料

10.其他特殊設備
     -NVRAM(nonvolatile random-access memory)
           +透過DRAM+電池,擁有DRAM的速度,並能在斷電後保有資料(看電池能用多久)
   
-------------------------------------------------------------------------------------
1.2.3 I/O Structure

11.device controller 與 device driver (p12)
     -每個device driver都是特定用於某個device controller上的
     -device controller位於硬體上,擁有自己的Buffer與Register
     -device driver會去適當的讀取device controller的Register,判斷要做甚麼
      (such as “read a character from the keyboard”
     -作業系統針對不同的device controller擁有不同的device driver

12.DMA(direct memory access)
     -device controller不透CPU,直接把自己整個Block的Buffer傳輸到Main memory的某部分,
      每傳完一個Block丟出一個interupt,通知device driver操作已經完成

-------------------------------------------------------------------------------------
1.3 Computer-System Architecture

-------------------------------------------------------------------------------------
1.3.1 Single-Processor Systems

13.Single-Processor Systems
     -僅具有一個用來處理Instruction set的主CPU
     -幾乎所有的Single-Processor Systems架構仍具有其他.special-purpose processors,
      不過並不會因為有這些special-purpose processors,讓架構變成Multiprocessor systems

14.special-purpose processors
     -They may come in the form of device-specific processors
           +disk controllers
                 -a disk-controller microprocessor receives a sequence of requests
 fromthe main CPU and implements its own disk queue and scheduling algorithm
           +keyboard controllers
           +graphics controllers

-------------------------------------------------------------------------------------
1.3.2 Multiprocessor Systems

15.Multiprocessor systems have three main advantages (p14)
     -提高吞吐量(Increased throughput)
     -更經濟(Economy of scale)
     -增加可靠性(Increased reliability)

16.The multiple-processor systems in use today are of two types.
     -不對稱多處理(Asymmetric multiprocessing)
           +A boss–worker relationship. The boss processor schedules
            and allocates work to the worker processors.
     -對稱多處理(Symmetric multiprocessing , SMP)
           +Each processor performs all tasks within the operating system





沒有留言:

張貼留言