淡江大學 九十一 學年度第 一 學期 考試科目: 作業系統 系(所)級班別:資訊管理系 3年 C班 期中 考試命題紙 命題教授簽章: 考試日期:11 月 18 日第 2 節 准帶項目請打「O」否則打「X」 1、須加發計算紙請在試題內封袋備註。 2、本命題紙為 A4 大小,內容多時可以較小(10)字體 計算機 課本 筆記 字典 本試題共 3 頁 P. 印刷 65 份 繕打。印刷格式請勾選:( )二張 A4 併成一張 B4 X X X X 備註:請直接在命題紙上作答 印刷( )依 A4 原稿印刷。(√ )放大成 B4 印刷。 Name: ____________ StdNo(學號):____________ Class(修課班級):_____ SeatNo(學分座號):_____ True-False Questions: (Please answer with ╳ or ○) (22%) ( ) 1. Since OS is only software, the changes in the design of the hardware has no influence on it. ( ) 2. When a process executes, it typically executes for a long time before it either finishes or needs to perform I/O. ( ) 3. Random access memory (RAM) can only be accessed by CPU, no other device can directly communicate with it. ( ) 4. Being another kind of processor, device controllers cannot execute concurrently with the CPU. ( ) 5. The concept of cache memory can be applied only between CPU and memory in the storage device hierarchy. ( ) 6. A program is a passive entity and a process is an active entity with a program counter specifying the next instruction to execute. ( ) 7. The execution of a process is not necessarily to be sequential. ( ) 8. System calls should be made directly from C or C++, they usually cannot be called from low-level languages such as assembly. ( ) 9. In message-passing communication model, information is exchanged through an interprocess-communication facility provided by the operating system. ( ) 10. System research and development can be done on the virtual machine without disrupt normal system operation. ( ) 11. Message passing is useful when smaller numbers of data need to be exchanged. ( ) 12. With layered approach, an operating system can be debugged and verified without any concern for the lower layer. ( ) 13. Windows NT 4.0 partially redressed the performance problem of the first release of Windows NT by removing multiple layers into single integrated layer. ( ) 14. Not only the CPU, but also the resources such as file systems and line printers are also shared for the illusion of virtual machines. ( ) 15. The Java API is also included as a part of the Java virtual machine. ( ) 16. During system design, although mechanisms are strongly affecting policies, it is better to separate the policy from the mechanism. ( ) 17. Although an operating system today is overwhelmingly complex, it is still possible to have it implemented in assembly language. ( ) 18. Two processes associated with same program are considered the same separate execution sequences. ( ) 19. There are five states a process can be in, and only one process can be in running state at any instance. ( ) 20. The long-term scheduler selects which processes should be brought in to the ready queue. ( ) 21. Context-switch time is an overhead because the system cannot do useful work while switching. ( ) 22. The parent processes and the children processes created by the parent can be executed concurrently. Multiple Choices, Single Answer Questions: (Please answer with capital letter(大寫字母).) (18%) ( ) 1. There are four components comprise a computer system, including hardware, __________, application programs, and users. (A) CPU (B) Windows (C) Hard disk (D) Operating Systems ( ) 2. In __________ systems, jobs with similar needs are grouped together before ran them through the computer for speeding up its processing. (A) Concurrent (B) distributed (C) batched (D) multiprogrammed (E) real-time ( ) 3. In multiprogrammed batch systems, several jobs are kept in main memory at the same time, and the CPU is _____________ among them. (A) multiplexed (B) distributed (C) selecting (D) in-line (E) off-loaded ( ) 4. Which program loads the operating system into the memory? (A) kernel (B) spooling (C) I/O (D) control (E) bootstrap ( ) 5. Operating system is ___________ driven. (A) data (B) signal (C) message (D) interrupt (E) software ( ) 6. It is possible to overlap useful computation with I/O in ______________I/O. (A) non-synchronous (B) synchronous (C) asynchronous (D) semi-synchronous 注意:1、考試求公平及公正,請同學務必自律,維護學校與學生之榮譽。 2、考試時不得交談、攜卷出場、窺視、傳遞、代考、夾帶等違規行為,違者將受嚴重議處。 淡江大學 九十一 學年度第 一 學期 考試科目: 作業系統 系(所)級班別:資訊管理系 3年 C班 期中 考試命題紙 命題教授簽章: 考試日期:11 月 18 日第 2 節 准帶項目請打「O」否則打「X」 1、須加發計算紙請在試題內封袋備註。 2、本命題紙為 A4 大小,內容多時可以較小(10)字體 計算機 課本 筆記 字典 本試題共 3 頁 P. 印刷 65 份 繕打。印刷格式請勾選:( )二張 A4 併成一張 B4 X X X X 備註:請直接在命題紙上作答 印刷( )依 A4 原稿印刷。(√ )放大成 B4 印刷。 ( ( ( ( ( ( ( ( ( ( ( ( ) 7. Device controller transfers blocks of data from buffer storage directly to main memory without CPU intervention is called (A) Cycle stealing (B) Memory protection (C) Buffering (D) Direct memory access ) 8. The only large storage media that the CPU can access directly is (A) main memory (B) control storage (C) flash memory (D) hard disk (E) associative memory ) 9. The instruction loaded into the instruction register of a CPU is (A) assembly instruction (B) compiled instruction (C) control storage instruction (D) high-level instruction (E) machine-level instruction ) 10. After fetching the instruction, it is decoded by using its __________ to index into the proper control storage instruction. (A) status word (B) operand (C) op code (D) address (E) register ) 11. Memory-mapped I/O set aside ranges of memory addresses and mapped to (A) device registers (B) cache memories (C) control storages (D) hard disks ) 12. The _________ instructions can be issued only In the monitor mode of the dual-mode operation. (A) control (B) activated (C) privileged (D) prioritized ) 13. A distributed network is a collection of _________ connected through communication lines. (A) processors (B) memories (C) drivers (D) ports (E) slots ) 14. ________ is a new access method removing the need for a user to login before she is allowed to use a remote resource. (A) answer (B) hang up (C) dial (D) WWW (E) wait ) 15. The greatest advantage by dividing operating system into layers is (A) flexibility (B) convenience (C) effectiveness (D) modularity (E) ease of control ) 16. A process includes its text section, ___________, program counter and stacks. (A) data section (B) queue (C) memory (D) registers (E) variables ) 17. The context of a process is represented in the _______of a process. (A) kernel (B) PCB (C) control storage (D) queue ) 18. The __________-term scheduler is used when the system has overcommitted available memory, requiring memory to be freed up. (A) long (B) medium (C) short (D) dynamic Short Answer Question: (60%) 1. (8%)What is an Operating System? Please briefly give its definition. 2. (8%)What are the differences between synchronous I/O and asynchronous I/O? Explain the true meaning of synchronous as discussed in the class. 3. (6%)Complete the Java compile-time and run-time environment on the right. 注意:1、考試求公平及公正,請同學務必自律,維護學校與學生之榮譽。 2、考試時不得交談、攜卷出場、窺視、傳遞、代考、夾帶等違規行為,違者將受嚴重議處。 淡江大學 九十一 學年度第 一 學期 考試科目: 作業系統 系(所)級班別:資訊管理系 3年 C班 期中 考試命題紙 命題教授簽章: 考試日期:11 月 18 日第 2 節 准帶項目請打「O」否則打「X」 1、須加發計算紙請在試題內封袋備註。 2、本命題紙為 A4 大小,內容多時可以較小(10)字體 計算機 課本 筆記 字典 本試題共 3 頁 P. 印刷 65 份 繕打。印刷格式請勾選:( )二張 A4 併成一張 B4 X X X X 備註:請直接在命題紙上作答 印刷( )依 A4 原稿印刷。(√ )放大成 B4 印刷。 4. (8%)Java is a programming language allowing cross-platform execution, however, it does not allow system calls to be made directly. Please explain why and give the solution for that. 5. (8%)Give two reasons why caches are useful. What problems do they solve? What problems do they cause? 6. (8%)Although implementing an operating system in higher-level language has reduced speed and increased storage requirement, today’s OS still are implemented in high-level languages. Why? 7. (6%)Please complete the state transition diagram on the right. 8. (8%)Consider following C program with fork command and answer the following questions: (a) Which command cause the child process to be created? _________ (b) Is the parent and the child is executing same copy of the program? ______ (c) Is the parent and the child going through the same path of execution? ______ (d) What is the PID of the child process? _______ (e) Which process will be terminated first? _________ #include <stdio.h> Void main(int argc, char *argv[]) {int pid; pid = fork(); if (pid < 0) { fprintf(stderr, “Fork Failed”); exit(-1); } else if (pid == 0) { execlp(“/bin/copy”,”copy”,Null); } else { wait(NULL); printf(“Child Complete”); exit(0); } } 注意:1、考試求公平及公正,請同學務必自律,維護學校與學生之榮譽。 2、考試時不得交談、攜卷出場、窺視、傳遞、代考、夾帶等違規行為,違者將受嚴重議處。