Operating System Concept

前言

OS 號稱資工系三大主修之一, Ray 雖然不是個血統純正的資工人, 可也要來走上一遭! 看誰敢嘴?

上面純粹是壓力大胡說八道一通, 在各位大神之前豈敢妄下狂言…



Questions and Answers

作業系統中, 什麼是 multi-core processor?

processor 上有多個 core

作業系統中, 什麼是 multi-processor?

主機板上有多個 processors 插槽

作業系統中, processor affinity 中的 soft affinity 跟 hard affinity, 差別在於?

soft 容許必要時移到另外一個 processor, hard 不容許

作業系統中, 如果該主機是屬於 symmetric multi-processing, 那當 OS 從眾多的 queue 當中挑選出要被執行的 process 時, 眾多 CPU 競爭一個 process, 會產生 synchronization 的問題, 解法中的 processor affinity 的意思是?

process 跟執行它的 processor 是綁定

作業系統中, 如果該主機是屬於 symmetric multi-processing, 那當 OS 從眾多的 queue 當中挑選出要被執行的 process 時, CPU 的運作模式是?

眾多 CPU 競爭該 process

作業系統中, 如果該主機是屬於 asymmetric multi-processing, 那當 OS 從眾多的 queue 當中挑選出要被執行的 process 時, CPU 的運作模式是?

master 會分配給 slave CPU 去執行該 process

作業系統中, Multilevel Feedback Queue 中, Feedback 的意思是?

job 會根據每一次 runtime 的回饋, 被調整到不同的 queue

作業系統中, Multilevel Feedback Queue 中, 通常, 越吃 CPU 的 process 會被排在上面或是下面的 queue? 為什麼?

越下面, 因為理論上, SJF 演算法是比較理想的

作業系統中, Multilevel Feedback Queue 中, 不同類型的 job 可否在不同的 queue 之間移動, for example, system 類型的 job 並不會單單只被排在特定的 queue 中?

可以哦

作業系統中, Multilevel Feedback Queue, 會在何時決定 job 該進哪一個 queue?

runtime 的時候

作業系統中, Multilevel Feedback Queue, 比較重要的 queue 裡頭的 job 還未全部執行完之前, 會否執行其他 queue 中的 job?

不會

作業系統中, multilevel queue 中, 不同的 queue 之間的優先是用什麼方式實作?

以機率選擇, 比較重要的 queue 的權重較重

作業系統中, multilevel queue 中, 可否讓不同的 queue 擁有不同的 algorithm?

可以

作業系統中, Scheduling method 中的 Round-Robin 的參數 time quantum 指的是?

每個 process 可以使用 CPU 多久

作業系統中, Scheduling method 中的 Round-Robin 的意思是?

每個 process 輪流執行

作業系統中, Scheduling 中的 SJF 全寫是?

Shortest-Job-First

作業系統中, 如果目標是要將 average wait time 降到最低的話, 哪一種 scheduling 會是比較理想的?

Shortest-Job-First Scheduling

作業系統中, Priority Scheduling 中, starvation 的 solution aging 是什麼意思?

當一個 process 隨著時間都沒有被執行的話, 就增加其 priority

作業系統中, Priority Scheduling 中, starvation 是什麼情況?

一個 process 的 priority 太小, 所以一直都沒有被執行

作業系統中, 何謂 Priority Scheduling?

以 priority number 來決定執行順序

作業系統中, scheduling criteria 中, 何謂 response time?

提交一個 process 後, 到該 process 開始第一個 CPU burst 所需的時間

作業系統中, scheduling criteria 中, 何謂 waiting time?

一個 process 在 ready queue 中所等待的時間

作業系統中, scheduling criteria 中, 何謂 turnaround time?

提交一個 process 到該 process 完成耗費的時間

作業系統中, scheduling criteria 中, 何謂 throughput?

每個時間單位內完成的 process 數量

作業系統中, scheduler 跟 dispatcher 的職責分別是?
  • scheduler: 選擇下一個 process
  • dispatcher: 切換 process
作業系統中, preemptive scheduler, 執行 kernel 程式時, Unix OS 是如何避免 Synchronization issue?

disable timer

作業系統中, preemptive scheduler 在 Unix OS 中, 當執行 kernel 程式時, timer 會打斷 kernel process 嗎?

不會

作業系統中, non-preemptive scheduler 唯有在哪兩種狀況下會 scheduling?
  1. from running to waiting state
  2. terminate
作業系統中, scheduling 共有哪四種行為?
  1. from running to waiting state
  2. from running to ready state
  3. from waiting to ready
  4. terminate
作業系統中, 何謂 Non-preemptive scheduler?

process 執行到一半不允許被打斷

作業系統中, 何謂 Preemptive scheduler?

process 執行到一半可以被打斷

作業系統中, 大部分的 CPU burst 都是短的還是長的?

短的

作業系統中, 一個程式實際上就是在哪兩著 burst 之間做交換?

CPU, I/O

作業系統中, 何謂 I/O burst?

一連串的 instruction 都在做 I/O

作業系統中, 何謂 CPU burst?

一連串的 instruction 都在使用 CPU

作業系統中, process 運行過程中, 大致上就只有哪運作兩種行為?

I/O, 計算

作業系統中, 當 fork() 被呼叫, 會單單複製呼叫的 thread, 或是複製所有的 thread?

兩種都有可能

作業系統中, 當一個 thread 被 cancel, main thread 需要 free 該 thread 的 memory, Asynchronous cancellation 跟 Deferred cancellation 的差異在於?
  • Asynchronous 會立即的 terminate, 但是是非同步的
  • Deferred cancellation, thread 會週期性(在特定的點)的 check 是否需要被 terminate
作業系統中, 當一個 thread 被 cancel, main thread free 該 thread 的 memory 主要有哪兩種方式?
  • Asynchronous cancellation
  • Deferred cancellation
作業系統中, Linux 中的 system call fork 以及 clone, 差異在於?

兩者都是建立 process, 但 clone 提供一些 flag 來決定哪些參數要 share

作業系統中, Linux OS 支援 thread 嗎?

不支援

作業系統中, 為什麼 Java threads 的 portability 高?

因為 Java 本身就做了一層 layer, 像是相容於各個 OS 的 virtual machine

作業系統中, Java Threads 有什麼特性?

portability 高

作業系統中, thread_detach 的具體行為是?

結束該 thread, 且不 join 回 main thread

作業系統中, thread_join 的具體行為是?

將 thread_create 的執行結果回傳到指定的 thread

作業系統中, thread_create 的具體行為是?

執行一個 function

作業系統中, 何謂 Pthread?

基於 POSIX 的 thread library

作業系統中, thread programming 是屬於 shared memory programming, 還是 message passing programming?

shared memory programming

作業系統中, 在 shared memory 的資料傳輸方式中, 有哪兩個角色?
  • producer
  • consumer
作業系統中, 大部分的作業系統都是使用 Multi-thread 的哪一種 relation? many-to-one or one-to-one or many-to-many?

one-to-one

作業系統中, Multithreading Models , many to many relation 當中, 假設我有 3 個 user thread 對上 4 個 kernel thread, 當其中一個 user thread 以及 kernel thread 被 block, 剩下的 2 個 user thread 會 share 幾個 kernel thread?

3 個

作業系統中, Multithreading Models , one to one relation 當中, 當 user thread 開太多個, 可能會造成什麼樣的問題? 為什麼?

系統卡住, 因為 kernel thread 通常有其上限

作業系統中, Multithreading Models relation 中, 又分為哪三種?
  • many to one
  • one to one
  • many to many
作業系統中, Multithreading Models 中, many to one 的話, 如果一個 user process 有 4 個 thread 的話, 這 4 個 thread 可以平行同時執行嗎? 為什麼?

不行, 因為這個 process 只對到一個 kernel thread

作業系統中, Multithreading Models 中, many to one 的話, 一個 kernel thread 會對到 user thread 的什麼單位?

一個 process

作業系統中, 如果一個 user thread 被 block, 那其他的 user thread 會受到影響嗎?

不一定

作業系統中, 如果一個 kernel thread 被 block, 那其他的 kernel thread 會受到影響嗎?

不會

作業系統中, 如果我有 multiple user thread, 但是只有 single kernel thread, 那速度會比較快嗎? 為什麼?

不會, 因為就算 user thread 已經 ready, 還是要等待 kernel thread

作業系統中, thread 又分為哪兩大類?
  • user thread
  • kernel thread
作業系統中, API 算是 user level 還是 kernel level?

user level

作業系統中, 同個 process 下得不同 thread, 溝通需要透過 OS 嗎?

不需要

作業系統中, process 跟 process 之間, 溝通需要透過 OS 嗎?

需要

作業系統中, process 的 message passing 跟 thread 的 memory sharing 哪一個傳輸的資料比較多?

thread

作業系統中, thread creation 跟 process creation, 哪一個比較快?

thread

作業系統中, thread 與 thread 之間, 會否 share stack

不會

作業系統中, thread 與 thread 之間, 會否 share data section?

會的

作業系統中, thread 與 thread 之間, 會否 share heap?

會的

作業系統中, 紀錄 thread 資訊的記憶體又叫作?

thread control block

作業系統中, message passing 的 RPC 方式, 位於 server 端的角色叫做?

skeleton

作業系統中, message passing 的 RPC 方式, 位於 client 端的角色叫做?

stub

作業系統中, message passing 的 socket 方式, 當 server 端與 client 端成功建立連線後, server 端會建立一個 thread 來跟 client 端溝通, 這時 server 端的這個 thread 使用的 port 號跟原本的 process listen 的 port 一樣嗎?

不一樣

作業系統中, message passing 的 socket 方式, 當 server 端與 client 端成功建立連線後, server 端會建立什麼來跟 client 端溝通?

thread

作業系統中, message passing 的 synchronization, buffer implementation 當中的 unbounded, 具體的行為是?

永遠不會 block sender

作業系統中, message passing 的 synchronization, buffer implementation 當中的 Bounded, 具體的行為是?

如果 capacity 滿了, block sender

作業系統中, message passing 的 synchronization, buffer implementation 當中的 Zero, 具體的行為是?

如果是 0, 則 block send/receive

作業系統中, message passing 的 synchronization, 如果是使用 non-blocking 方式的話, 這代表 sender 與 receiver 之間還有一個什麼角色?

buffer

作業系統中, message passing 的 indirect communication, 當出現多個 receiver 時, 大略上有哪三種方法來決定 receiver?
  1. 只允許 communication 有兩個 process (最爛, 相當於 direct communication)
  2. 只允許一次一個 process 可以執行 receive operation
  3. 讓 OS 來決定誰是 receiver, 並通知 sender
作業系統中, message passing 的 indirect communication 的 mailbox 是由誰來管理?

OS

作業系統中, message passing 的 indirect communication, 是 one to one, 還是 many to many?

many to many

作業系統中, message passing 的 indirect communication, 是經由什麼服務來傳遞訊息的?

mailbox

one to one

作業系統中, message passing 的 direct communication 的意思是?

雙方都知道對方是誰

作業系統中, message passing 的 IPC 提供了兩種 operation, 分別是?
  • Send
  • Receive
作業系統中, shared memory 可以做到 synchronization 嗎?

不行

作業系統中, OS 會提供一塊什麼樣的 buffer 供 shared memory 的 process 使用?

circular buffer

作業系統中, 利用 shared memory 來溝通的 process 需要呼叫哪個 system call 來告知 OS 正在使用這塊空間?

attach

作業系統中, 當 shared memory 被建立出來後, OS 會否參與其內容?

不會, 交由需要溝通的 process 去處理

作業系統中, 若要建立 shared memory 空間, 需要誰去呼叫 system call?

需要用到這塊空間的 process

作業系統中, RPC 的簡單解釋?

server 端以提供 API 的方式給 client 端, 以作溝通

作業系統中, Sockets 的 port 主要代表什麼?

process

作業系統中, message passing 的 method Socket, 主要是靠什麼連線?

network by IP & port

作業系統中, message passing 又分為哪兩種 method?
  • Sockets
  • Remote Procedure Calls
作業系統中, communication methods 中, 如果要跨電腦溝通, 只可使用哪一種 method?

message passing

作業系統中, memory 的溝通如果不要求太複雜的操作時, shared memory 跟 message passing 哪種是比較適合的?

shared memory

作業系統中, IPC 的簡單解釋?

在不同 process 之間溝通

作業系統中, IPC 的全寫是?

Interprocess Communication

作業系統中, 當我 kill 一個 process, 其 child 還會存在嗎?

不會

作業系統中, UNIX/Linux 中, 如果 parent 要 kill child, 使用哪個 system call?

abort

作業系統中, UNIX/Linux 中, 使用哪個 system call 來 terminate process?

exit()

作業系統中, UNIX/Linux 中, 當 fork 時, memory space copy method 中, copy on write 的意思是?

當 parent 與 child 的 memory content 不同時才複製, 若相同則 share

作業系統中, UNIX/Linux 中, 現階段當 fork 時, 針對 memory space 是使用哪一種 copy 方式?

copy on write

作業系統中, UNIX/Linux 中, 預設的執行順序是 concurrent, 如果要讓 parent 等待, 可以呼叫哪一個 system call?

wait system call

作業系統中, UNIX/Linux 中, 當 child 被建立後, 會呼叫 execlp system call, 目的為何?

重設 child process memory space 的內容, 覆蓋舊的

作業系統中, UNIX/Linux 中, child 被建立後, 會 return 一個 value, 是?

0

作業系統中, UNIX/Linux 中, parent 在建立 child 後, 會 return 一個 value, 是?

child 的 PID

作業系統中, UNIX/Linux 中, parent 與 child 的執行優先順序是?

OS 決定

作業系統中, UNIX/Linux 中, child 被建立時, memory space 的建立原則是複製還是載入?

複製

作業系統中, UNIX/Linux 中, 使用哪個 system call 來建立 child?

fork

作業系統中, process child 建立時, memory space 的定義又分為哪兩種?
  • 完全從 parent 複製
  • 從 parent 載入特定部分
作業系統中, process 的 parent 跟 child 之間, execution 的優先順序又分為哪兩種?
  • 交給 OS scheduler 決定
  • parent 等待直到 child terminate
作業系統中, process 的 parent 跟 child 之間, resource sharing 又分為哪三大類?
  • child share all resources of parent’s
  • child share partial resources of parent’s
  • child share no resources of parent
作業系統中, process 一定是哪一種 data structure?

tree

作業系統中, process identifier 指的是?

PID

作業系統中, Medium-Term Scheduler 為什麼要將 process 在 memory, disk 之間移動?

減少 degree of multiprogramming

作業系統中, Medium-Term Scheduler 的 swap in 主要做什麼事?

將 process 從 disk 移到 memory

作業系統中, Medium-Term Scheduler 的 swap out 主要做什麼事?

將 process 從 memory 移到 disk

作業系統中, Medium-Term Scheduler 主要是將 process 在哪兩個儲存裝置之間切換?

disk, memory

作業系統中, Long-Term Scheduler select a good mix of CPU-bound & I/O-bound, 這句話是什麼意思?

把會需要用到 CPU 的 process 跟會用到 I/O 的 process 取得一個平衡, 提升整體效能

作業系統中, Long-Term Scheduler 主要控制 degree of multiprogramming, 這句話的意思是?

控制 memory 中有幾個程序

作業系統中, Medium-term scheduler 主要將 Process 從哪一個狀態切換成哪一個狀態?

Ready state => Wait state

作業系統中, 為什麼 CPU scheduler 又稱為 short-term scheduler?

因為 time-sharing switch context 的速度非常頻繁

作業系統中, Job scheduler 又稱為?

Long-term scheduler

作業系統中, CPU scheduler 又稱為?

Short-term scheduler

作業系統中, 由 New state => Ready state, 是由 CPU scheduler 處理還是由 Job scheduler 處理?

Job scheduler

作業系統中, 由 Ready state => Run state, 是由 CPU scheduler 處理還是由 Job scheduler 處理?

CPU scheduler

作業系統中, Process Scheduling Queues 當中, 每一個 Device 的 Device Queue 是同一個嗎?

不同, 每個 Device 都有各自的 device queue?

作業系統中, Process Scheduling Queues 當中, Device queue 是在 process 的哪一個狀態的 queue?

Waiting

作業系統中, Process Scheduling Queues 當中, Ready queue 是在 process 的哪一個狀態的 queue?

Ready

作業系統中, Process Scheduling Queues 當中, Job queue 是在 process 的哪一個狀態的 queue?

New

作業系統中, 若要提升 context switch 的速度, 可使用 hardware support, 具體意思是?

hardware 提供多組的 register, 不同 PCB 可同時 load 到不同 register 當中, 不必重 load memory

作業系統中, 若要提升 context switch 的速度, 可使用 special instructions, 具體意思是?

讓 save 跟 reload 以 single instruction 完成

作業系統中, 何謂 context switch 會執行哪兩個動作?

save 目前的 PCB
reload 下一個 PCB

作業系統中, 何謂 context switch?

將原本執行的 process 切換到另外一個 process

作業系統中, process 的 base/limit register 什麼時候會被 load 到 hardware?

當該 process 位於 running state 時

作業系統中, PCB 位於 user space 還是 kernel space?

kernel space

作業系統中, process 的 CPU registers 被存在什麼地方?

PCB

作業系統中, process 的 Program counter 被存在什麼地方?

PCB

作業系統中, 如何實現 PCB 的 queue?

利用 linked list, pointer 指向下一個 PCB

作業系統中, memory 中的 PCB 全寫是?

process control block

作業系統中, process state 中的 Waiting 在執行完 I/O 之後, 會回到哪個 state??

Ready

作業系統中, process state 中的 Runner 通常什麼情況下會回到 Ready?

被 timer 打斷

作業系統中, process state 中的 Terminated 代表的意思是?

將 process 佔用的資源 release, 所以 OS 可以再度分配這些資源

作業系統中, process state 中的 Waiting 代表的意思是?

當 process 在執行一些非 CPU 的工作, 像是 I/O, 這時候須等待 I/O 處理完畢才可在被 CPU 執行, 因為位於 waiting

作業系統中, process state 中的 Running 代表的意思是?

正在使用 CPU

作業系統中, process state 中的 Ready 代表的意思是?

load 到 memory 的 process 在等待使用 CPU 時

作業系統中, process state 中的 New 代表的意思是?

將 program load 到 memory, initialize

作業系統中, 使用哪一個 section 在同一個 process 下的不同 threads 之間溝通?

data section (global variable)

作業系統中, 同 process 不同 thread 之間的有哪些 section 是共用的?
  • code section
  • data section
  • resources
作業系統中, 一個 thread 可以有很多 process 嗎?

不行

作業系統中, 一個 process 可以有很多 thread 嗎?

可以

作業系統中, CPU 在執行中最 basic 的單位是?

thread

作業系統中, Threads 又被稱為?

lightweight process

作業系統中, process 在 memory space 中, 有哪兩個 section 是會動態成長的?
  • Stack
  • Heap
作業系統中, process 在 memory space 中的 Heap 會存放 dynamic allocated variables or classes, 這邊指的是?

就像是 new Class 分配到記憶體的 class

作業系統中, process 在 memory space 中的 Stack 會存放 local variable, 這邊的 local variable 指的是?

function 中的變數, return 就釋放了

作業系統中, process 在 memory space 中, resources 紀錄的是?

該 process 所使用的 resources (e.g. file)

作業系統中, process 在 memory space 中, Register content 紀錄的是?

目前 register 中的 content, 這樣下次再載入的時候會直接 load 到 CPU 的 register

作業系統中, process 在 memory space 中, Program counter 紀錄的是?

目前執行 program 的位置

作業系統中, process 在 memory space 中, Heap 裡頭存放的是?

dynamic allocated variables or classes

作業系統中, process 在 memory space 中, Stack 裡頭存放的是?

local variable

作業系統中, process 在 memory space 中, Data section 裡頭存放的是?

global variable

作業系統中, process 在 memory space 中, Code Segment 裡頭存放的是?

process compiled instruction

作業系統中, program 跟 process 差別在哪?
  • Program 是位於 disk 的 binary code
  • Process 是位於 memory 的執行中的 program
作業系統中, JVM virtual machine 會否將翻譯過的 instruction 記住?

會哦

作業系統中, JVM virtual machine 有無自己的 biyecodes?

作業系統中, Full Virtualization 跟 Para Virtualization 哪一個效能快? 若說 Para Virtualization 比較快, 為什麼?
  • 不一定
  • 有 Master OS 居中優化
作業系統中, Full Virtualization 跟 Para Virtualization 哪一個效能快? 若說 Full Virtualization 比較快, 為什麼?
  • 不一定
  • 有 hardware support, 不用多一層 Master OS
作業系統中, Para Virtualization 的開源軟體叫做?

Zen

作業系統中, Full Virtualization 的開源軟體叫做?

KVM

作業系統中, virtual machine 中, 所謂的 master os, 存在於 Full Virtualization 或是 Para Virtualization?

Para Virtualization

作業系統中, Para Virtualization 中, 安裝在 user space 的 OS 程式碼需要特別修改嗎 (比如說官方 Windows 10 正版光碟是否可以不修改程式碼直接安裝)?

需要特別修改

作業系統中, Virrualization 又分哪兩大類?
  • Full Virtualization
  • Para Virtualization
作業系統中, Full Virtualization 中, 安裝在 user space 的 OS 程式碼需要特別修改嗎 (比如說官方 Windows 10 正版光碟是否可以不修改程式碼直接安裝)?

不需要

作業系統中, critical instruction 在 user space 的執行結果跟在 kernel space 的執行結果, 一樣嗎?

不一樣

作業系統中, 何謂 critical instruction?

一種 instruction, 在 user space 以及 kernel space 執行的結果不同

作業系統中, 有些 CPU 會標明支援 virtual machine, 是什麼意思?

代表此 CPU 除了 user mode, kernel mode 之外, 還會有一個 virtual machine mode, 當偵測到 virtual machine mode 時, 會知道這是 virtual machine 的 kernel, 可以直接執行 privileged instruction, 不需再透過真正的 kernel

作業系統中, 早期 virtual machine 在執行 privileged instruction 時, 因為 virtual machine 的 kernel 位於 user space, 所以被 CPU 拒絕了, 後來如何解決?

當 hardware 拒絕時, 會拋出 exception, 這時真正的 kernel 收到, 進而幫 virtual machine 的 kernel 再執行一次

作業系統中, 早期 virtual machine 在執行 privileged instruction 時, 被 CPU 拒絕了, 為什麼??

因為 virtual machine 位於 user space

作業系統中, virtual machine 的 kernel 實際上是在 kernel space 還是 user space?

user space

作業系統中, virtual machine 在 40~50 年前剛被提出時, 為什麼不被泛用?

因為當時的硬體效能不夠

作業系統中, virtual machine 的歷史已有多少年?

40~50 年

作業系統 Kernel Module 的概念中, 與 layer 的概念差別在哪?

在 layer 概念中, 下層是無法呼叫上層, 但在 Kernel Module 的概念中, 是可以互相呼叫的, 所以更靈活

作業系統 Kernel Module 的概念中, 不同 module 之間的溝通需要用到 message passing 嗎?

不需要, 因為全部都使用 Kernel memory

作業系統中 Microkernel 的概念跟 Kernel Module 的概念, 差別在哪?

Kernel Module 的 module 都位於 kernel space, 而 Microkernel 的 module 則是位於 user-space

作業系統中 Microkernel 的概念中, 速度慢的原因是?

process 跟 process 之間的溝通都要用到 system call

作業系統中 Microkernel 的概念中, 為何使用 message passing 作為 process 跟 process 之間的溝通方式??

因為要避免 synchronisation

作業系統中 Microkernel 的概念中, 兩大優點是??
  • 易於擴展
  • 可攜性高
作業系統中 Microkernel 的概念中, 不同 process 溝通的方式是??

message passing

作業系統中 Microkernel 的概念中, module 都被至於哪一個區塊??

user space

作業系統中 Microkernel 的概念中, kernel 實際上負責的工作有哪兩大類??
  • 在不同的 module 之間溝通
  • 定義不同 module 的 interface
作業系統中 layer 的概念中, 速度會比較快還是比較慢?

比較慢, 因為一個 function call 就要一直往下呼叫

作業系統中 layer 的概念中, 比較容易 debug 的原因是?

可以經由哪一層出問題來判斷

作業系統中 layer 的概念中, 如果上層 okay, 其下層可能會是 okay 的還是不 okay?

okay

作業系統中 layer 的概念, 高層的 layer 可以呼叫低層的 layer 嗎??

不可以

MS-DOS 作業系統中, 有 layer 的概念嗎?

沒有

作業系統中, 為何要使用 API, 有哪三大原因?
  • simplicity
  • portability
  • efficiency
作業系統中, POSIX API 的用途是?

在不同的 OS 中, 儘管彼此的 system call 不同, 但只要 API interface 相同, 便能確保不同的 user program 在不同的 OS 是不需要改動程式碼的

作業系統中, system call 的特色是?
  • 功能單一
  • 速度快
作業系統中, 一個 API 可能會呼叫幾個 system call

0 個或多個

作業系統中, API 一定會呼叫 system call 嗎?

不一定

作業系統中, 當 OS 的 API 採用 C Library, 若我要寫一個 program 跟 OS 溝通, 需要使用哪種語言?

C

作業系統中, 通常 API 的形式像是??

Library, 像 C Library, Java Library

作業系統中, 像 C Library 是屬於 system call 還是 API?

API

作業系統中, 通常使用者會直接呼叫 system call 嗎??

不會, 會透過 API

作業系統中, API 的目的是?

為了 programming 的方便

作業系統中, system call 是哪一種 interrupt?

software

作業系統中, OS 提供的 function call, 又稱為?

system calls

作業系統中, system calls 是用什麼語言寫的?

assembly language

作業系統中, system call 跟 API 相同嗎?

不同

作業系統中, shared memory 需要透過何者方可建立?

kernel

作業系統中, message passing 跟 shared memory, 為何 message passing 速度較慢?

因為還要 copy 一份 memory

作業系統中, message passing 跟 shared memory 何者速度較慢?

message passing

作業系統中, shared memory 的溝通方式如何運作?

建立一個 shared memory, 此區間可同時被兩個 process access, 以此交換 message

作業系統中, message passing 的溝通方式如何運作?

先將要 passing 的 message 從該 process 上 copy 到 kernel 的 memory, 在 pass 到另一個 process

作業系統中, process 跟 process 有哪兩種溝通方式?
  • message passing
  • shared memory
作業系統 CPU protection 中, Load-timer instruction 的目的是?

重設 timer 上的 value

作業系統 CPU protection 中, 透過哪個 privileged instruction 來重設 timer value?

Load-timer

作業系統 CPU protection 中, 當 timer 歸 0 時, CPU 會呼叫 OS 的 scheduler, OS scheduler 會做什麼事?

決定接下來要執行什麼程式, 包括 OS 自己的程式

作業系統 CPU protection 中, 當 timer 歸 0 時, timer 會丟一個 interrupt 給 CPU, 這個 interrupt 會叫 CPU 去做什麼事?

執行 OS scheduler

作業系統 CPU protection 中, 當 timer 歸 0 時, timer 會做什麼事?

會丟一個 interrupt, 打斷 CPU

作業系統 CPU protection 中, timer 位於?

motherboard

作業系統中, 主要靠什麼來做 CPU protection?

timer

作業系統 memory protection 中, 當 CPU 要執行一個程式時, 如果發現 address 不在指定的界限範圍內, 會怎麼做?

丟失 error

作業系統 memory protection 中, 當 CPU 要執行一個程式時, 會先檢查哪個東西有沒有在界限內?

address

作業系統 memory protection 中, limit register 的意思是?

memory 界限的長度

作業系統 memory protection 中, base register 的意思是?

memory 界限的起點

作業系統 memory protection 中, 每支程式都有其可 access memory 的區間, 這個區間由哪兩個東西界定?
  • base register
  • limit register
作業系統 I/O protection 中, 跟 I/O 有關的 instructions 都是屬於哪個種類的 instruction?

privileged instructions

作業系統 I/O protection 中, 哪些 I/O 要保護

全部的 I/O device

作業系統 Dual-Mode 中, privileged instructions 的目的是?

保護電腦, 強迫使用者一定要透過 OS 才可執行的 instruction

作業系統 Dual-Mode 中, 使用者可以自己執行 privileged instruction 嗎?

不行

作業系統 Dual-Mode 中, 何謂 privileged instruction?
  • 只可在 monitor mode 執行
  • 由 system call 呼叫
作業系統 Dual-Mode 中, mode bit 何時會變成 1?

當 system call 執行完畢, 要 return 回 user program 時

作業系統 Dual-Mode 中, mode bit 位於?

hardware

作業系統 Dual-Mode 中, mode bit 何時會變成 0?

當 interrupt/trap 被呼叫或有 error 產生時

作業系統中, system call 一定要透過什麼來執行?

interrupt

作業系統 Dual-Mode 中, mode bit 分別是?
  • user (1)
  • kernel (0)
作業系統 Dual-Mode 中, 如何區別 mode?

利用 mode bit

作業系統中, 要請 OS 做任何事情, 一定要呼叫?

system call

作業系統中, Dual-Mode Operation 中, Monitor mode 的意思是?

代表 OS 執行

作業系統中, Dual-Mode Operation 中, Monitor mode 又稱為?

kernel mode or system mode

作業系統中, Dual-Mode Operation 中, 至少會有哪兩種 mode?
  • User mode
  • Monitor mode
作業系統中, 像 Google 是如何解決分散式系統中的 coherency and consistency 的問題?

不解決

作業系統中, 當我使用 multi-tasking system 時, 多個 core 有多個 cache, 假設在兩個 cache 上同時有同樣的資料, 但新舊不同, 應該要使用哪一個?

較新的

作業系統中, 為什麼在 multi-tasking system 中會比較有 coherency and consistency 的問題?

因為多個 core 有各自的 cache, share 同一個 memory

作業系統中, cache 需要在多層 cache 之間處理什麼問題?

coherency and consistency

作業系統中, cache 的定義?

從較慢的儲存空間複製一份到較快的儲存空間

作業系統中, 當讀取連續資料時, hard drive 會跟 SSD 差很多嗎?

不會

作業系統中, disk 中的 rotational latency 的意思是?

磁盤轉動的速度

作業系統中, disk 中的 seek time 的意思是?

在該磁盤中找到該資料的時間 (這取決於資料的分散度)

作業系統中, disk 中的 positioning time 哪兩個要素相加?

seek time + rotational latency

作業系統中, disk 中的 transfer time 跟什麼有關?

data size

作業系統中, hard real-time system 會使用 secondary storage 嗎?

不會

作業系統中, 儲存裝置的階層主要與哪三大要素有關?
  • speed
  • cost
  • volatility
作業系統中, 唯有哪一個儲存裝置可以被 CPU 存取?

main memory

作業系統中, 除了 main memory 之外的其他儲存裝置又稱為?

secondary storage

作業系統中, 現在 tape 儲存裝置還有被使用嗎?

有的

作業系統中, 照階層順序由上到下排列以下裝置?

Example:

  • cache
  • registers
  • main memory

Answer:
registers, cache, main memory

作業系統中, 最耐用的儲存裝置是?

tapes

作業系統中, 比較注重效能的 OS, 像是 Linux, 當收到 interrupt 時, 如果又收到一個新的 interrupt, 會怎麼處理?

disable

作業系統中, 當我收到 software interrupt 時, 如下圖, 為什麼是 case, 而不是 interrupt vector?

因為 software interrupt 的 function pointer 是不固定的, 反之, interrupt vector 是固定的

作業系統中, 在執行完 interrupt vector 的 size 是固定的還是不固定?

固定

作業系統中, 在執行完 interrupt vector 裡頭的 service routine 之後, CPU 會回到?

原本執行的程式

作業系統中, interrupt vector 中的 function pointer 又稱為?

interrupt service routine

作業系統中, 當我安裝 device driver 時, 會安裝在哪個地方?

interrupt vector

作業系統中, signal number 跟 usb hub 的關係是?

該 usb hub 會有自己的 signal number, 這個 signal number 會對應到 interrupt vector

作業系統中, 當 OS 偵測到 hardware interrupt 之後, 會到什麼地方尋找該 hardware 編號?

interrupt vector

作業系統中, interrupt vector 是什麼?

array of function pointer

作業系統中, software interrupt 又稱為?

trap

作業系統中, 由使用者發起的 system call 會觸發 interrupt 嗎?

不會

作業系統中, software 可能因為哪兩種狀況觸發 interrupt?
  • error
  • operation system call
作業系統中, hardware 產生的 interrupt 又稱為?

signal

作業系統中, interrupt 可能由哪兩種來源發出?
  • hardware
  • software
作業系統中, 假如資料正在從 device 傳送到 buffer, 並從 buffer 在寫入 memory, 在這一個流程中, interrupt 會在什麼時候打斷 CPU?

當 buffer 滿的時候

作業系統中, 在 interrupt 概念出現之前, 當 device 要寫入資料到 memory 時, CPU 的運作模式是?

一方面搬運資料, 一方面監控 buffer 狀態, 總處於忙碌中, 但對使用者沒意義

作業系統中, 當我要從 device 搬資料到 memory, 會先經過哪個裝置?

Device Controller 中的 buffer

*作業系統中, 在 CPU, MemoryDevices之間, 還有一個什麼元件?*

Device Controller

作業系統中, OS 的別名為?

Kernel

作業系統中, System Library 扮演著承上啟下的作用, 這邊的下指的是?

Device driver

作業系統中, System Library 扮演著承上啟下的作用, 這邊的上指的是?

Linker, 與 compile 後的 User program 相接

作業系統中, User program 經過 compiler 轉換成機械語言之後, 要透過哪一個步驟與 System Library 做連結?

Linker

作業系統中, User program 會先經過什麼處理轉換成機械語言?

compiler

作業系統中, 何謂 System Library?

OS 所提供的 API

作業系統中, 將 hardware resources 做分配給不同的 User Application 做使用, 算是 Control 還是 Coordinate?

Coordinate

作業系統中, 將 hardware resources 抽象化給 User Application 做使用, 算是 Control 還是 Coordinate?

Control

作業系統中, OS 實際上是對 hardware resource 做哪兩大操作?
  • Control
  • Coordinate
作業系統中, OS 實際上是把 hardware resources 做什麼處理後給 User Application 是做使用??

提供 hardware resources 抽象化 API

作業系統中, Hardware 常常又被稱為?

computing resources

作業系統四大 component 中, User 代表的是?

people, machines, other computers

作業系統中, 有哪四大 component?
  • Hardware
  • OS
  • Application
  • User
作業系統中的 protection (非 security 方面), 是什麼意思?

不同使用者之間不互相影響, 例如 A 使用者的程式 crash 不可影響到 B 使用者

作業系統中, hard real-time requirements 中, 資料都要跑在硬碟或 memory?

memory

作業系統中, hard real-time requirements 如果沒有達到, 系統會 crash 嗎??

作業系統中, Soft real-time requirements 如果沒有達到, 系統會 crash 嗎??

不會

作業系統中, Real-TIme System 又分成哪兩種?
  • Hard real-time requirements
  • Soft real-time requirements
作業系統中, Real-TIme 的定義是?

與速度無關, 但須在 deadline 之前做完

作業系統中, Cluster System 的定義是?

使用 LAN 相連, 速度較快

作業系統中, Client-Server Distributed System 的缺點是?

Server 掛就全掛了, 效能瓶頸在 Server 端

作業系統中, Client-Server Distributed System 的優點是?

易於管理

作業系統中, Distributed System 又分為哪兩大類?
  • Client-Server Distributed System
  • Peer-to-Peer Distributed System
作業系統中, Distributed System 主要目的是?

Reliability

作業系統中, Distributed System 會共享 memory 嗎?

不會

作業系統中, 何謂 loosely coupled system?

元件並非全都在一台機器中, 而是通過網路線連結

作業系統中, Distributed System 又稱為?

loosely coupled system

作業系統中, NUMA 架構中, 存取 memory 的速度相同嗎?

不同

作業系統中, NUMA 中要存取不同區塊的 memory 時, 可以直接存取, 或是需要該區塊同意?

需要該區塊同意

作業系統中, 以下的圖片是 UMA 還是 NUMA?
  • Answer:
    UMA
作業系統中, 以下的圖片是 UMA 還是 NUMA?
  • Answer:
    NUMA
作業系統, Memory Access Architecture UMA 中, 每個 CPU 的 Memory Access Time 都一樣還是會有所不同?

都一樣

作業系統中, NUMA 的全寫是?

Non-Uniform Memory Access

作業系統中, UMA 的全寫是?

Uniform Memory Access

作業系統中, 像現今, 一個 GPU 上有很多 core, 這又稱為?

Many-Core Processor

作業系統中, 一個 CPU 不同的 core 之間的 communication 較快, 還是不同 CPU 之間的 communication 比較快?

一個 CPU 不同的 core 之間

作業系統中, 一個 Multi-Core Processor 比較耗電, 還是多個 Single-Core Processor 比較耗電?

多個 Single-Core Processor

作業系統中, 何謂 Multi-Core Processor?

一個 CPU 有多個 core

作業系統中, Asymmetric multiprocessor system 適用於大型或小型系統?

大型

作業系統中, 一般家用主機是 symmetric multiprocessor system 還是 asymmetric multiprocessor system?

symmetric multiprocessor system

作業系統中, Symmetric multiprocessor system 跟 Asymmetric multiprocessor system 的 CPU 差異是?

Asymmetric multiprocessor system 有 master CPU 跟很多 slave CPU, symmetric multiprocessor system 都是一樣的

作業系統中, Parallel Systems 又分為哪兩種?
  • Symmetric multiprocessor system (SMP)
  • Asymmetric multiprocessor system
作業系統中, Parallel System 的目的?
  • 更快
  • 經濟
  • 可靠性
作業系統中, Parallel Systems, 或者 Multiprocessor, 抑或 tightly coupled system, 是將超過一個以上的 CPU 串在一起, 將這些 CPU 串在一起的東西稱為?

System Bus

作業系統中, 何謂 Parallel Systems, 或者 Multiprocessor, 抑或 tightly coupled system?

超過一個以上的 CPU 串在一起, 共用 memory

作業系統, 是靠什麼概念才能真正達到多程式同時執行?

time-sharing

作業系統, 是靠什麼概念才能真正達到多使用者同時使用一台電腦?

time-sharing

作業系統 multi-programing system 中, 一次能處理幾個 program?

一個

作業系統 multi-programing system 中, 支援多使用者同時操作嗎?

不支援

作業系統 multi-programing system 中, 分配 memory 中特定的 job 給 CPU 運算的這個動作又稱為?

CPU Scheduling

作業系統 multi-programing system 中, 分配硬碟中特定的 job 到 memory 的這個動作又稱為?

job Scheduling

作業系統中, multi-programing system 中的 spooling 概念是?

當 I/O 輸入完畢時, 通知 CPU, 於此同時, CPU 可以處理另外一段已經輸入完畢的 I/O

作業系統中, spool 是什麼的縮寫?

Simultaneous Peripheral Operation On-Line

早期的電腦又稱為?

Mainframe

早期的 Batch mainframe CPU 總處於?

idle 狀態

早期的 Batch mainframe I/O 快還慢?

超慢

早期的 Batch mainframe 一次能處理幾件事?

1 件事

早期的 Batch mainframe memory 的 layout 分為哪兩大部分?
  • Operating system
  • User program data
早期的 Batch mainframe, user 跟 mainframe 可以互動嗎?

不行



參考資料

Laravel - Security - Authentication (官方文件原子化翻譯筆記) Laravel - Digging Deeper - Notifications (官方文件原子化翻譯筆記)

留言

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×