OS 題庫 2

2.21
前者當執行時 command interpreter會跳到指定的section of code,執行完後再return。前者執行速度較快,寫起來較簡單。但擴充到後面會越來越難。
後者讀取程式到memory中,後者較容易擴充,但是速度較慢,且傳值時很麻煩。

2.22
system-call interface: 程式語言中,由系統提供的link to system calls。他會攔截API中的function call並invoke必要的system call。因此,大部分OS的interface的實作細節都被隱藏在API之中並由run-time support library管理(?)。
API則是提供給programmer,可以使用的方法。

2.23
passing the parameters in registers: 但是有可能有比registers還多的parameters。
parameters還可以儲存在block, table中,然後再透過registers傳送address of the block。
parameters還可以被placed或pushed onto the stack,或者是popped off the stack by the operating system。

2.24
寫起來更快, 更compact, 且更容易理解和debug。且更先進的compiler只要重新編譯就能讓產生的code更好。且更容易port,移動到不同的硬體架構上執行。

2.25
使用者希望系統使用起來方便簡單,可靠安全快速。
開發者,維護和設計系統的人則希望系統設計起來簡單,好實作且容易維護,其應該具有彈性,可靠性,沒有錯誤而且有效率。

2.26
增加新功能很簡單,只要直接加到user space就好。且比較安全和可靠,因為services大都為user processes。
但microkernels can suffer from performance decrease due to increased system function overhead。

2.27
Modular approach結合了layered和microkernel design的好處。OS只要知道如何呼叫對應的方法並讓modules之間互相溝通,如果需要新增新功能,user可以將新module載入kernel。Kernel可以有well-defined,protected interfaces。如果讓modules之間可以互相溝通,則會更有flexibility。

2.28
Max OS X由Mach microkernel和BSD UNIX組成。

2.29
The Dalvik virtual machine特別為android設計,適用於在有限制的memory和CPU環境底下。






留言