西安电子科技大学操作系统期末试题及答案解析(共17页).docx
《西安电子科技大学操作系统期末试题及答案解析(共17页).docx》由会员分享,可在线阅读,更多相关《西安电子科技大学操作系统期末试题及答案解析(共17页).docx(17页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上 西 安 电 子 科 技 大 学考试时间 120 分钟 试题题号一二三四五六七八九十总分分数1.考试形式:闭卷 2.考试日期: 年 月 日 3.本试卷共 四 大题,满分100分班级 学号 姓名 任课老师 Part 1: Select one answer (A through D) for each question ( Total 20, each 2 )1. A computer system consists of , system programs and application programs.A. Control bus B. data busC. Ad
2、dress bus D. hardware2. Thread(线程)can be implemented in .A. Kernel SpaceB. User SpaceC. Kernel Space or User SpaceD. None of the above3. In OS, short term schedule(调度)means .A. Job schedulingB. Process schedulingC. Thread schedulingD. CPU scheduling4. Which one of the following item is not shared by
3、 all threads in a process? .A. Address spaceB. RegisterC. Open files D. Accounting information5. In the paged memory management system, the address is composed of page number and the offset within the page. In the address structure shown in the following figure, . 31 10 9 0page numberoffsetA. page s
4、ize is 512, 2M pages at mostB. page size is 1k, 4M pages at mostC. page size is 2k, 8M pages at mostD. page size is 4k, 16M pages at most6. Virtual memory is based on The Principle of Locality. Which of the following statements about The Principle of Locality is correct? A. Program executes codes in
5、 orderB. Program assesses(访问)memory in a non-uniform mannerC. Program accesses a lot of variables continuouslyD. Program accesses a relatively small portion of the address space at any instant of time7. In UNIX i-node scheme, a directory entry contains only two fields: the file name (14 bytes) and t
6、he number of the i-node for that file (2 bytes). These parameters(参数)limit the number of files per file system to .A. 64k B. 32kC. 16kD. 4k8. The time required to read or write a disk block is determined(决定)by three factors. Which one dominates(主导,占优势)the other two times? .A. Seek timeB. Rotational
7、delay timeC. Data transfer timeD. None of above9. The chmod command(命令)is used to change the permission(许可)of file in Linux. To use it, you specify the desired permission setting and the file or files that you wish to modify. The permission settings are usually a series of bits. Which of the followi
8、ng bits present that the files owner may read, write, and execute the file, while all others may only read the file? .A. 755 B. 744 C. 644D. 61110. The method listed below doesnt need CPU to participate in the transfer of data block.A. Interrupt-Driven I/OB. DMAC. Programmed I/OD. None of abovePart2
9、: Fill Blanks (Total 20, each 2)1. Operating System is an extended machine and .2. Parallel Systems include Symmetric(对称)multiprocessing and .3. A semaphore(信号量)S is an integer variable that is accessed only through two standard atomic operations: and .4. Address binding of instructions and data to
10、memory addresses can happen at three different stages, Compile time, Load time and .5. Four Conditions for Deadlock: , Hold and wait, No preemption and .6. Sector 0 of the disk is called the .7. In Linux, the file metadata(元数据)is stored in .8. The security goals include data confidentiality(机密性),dat
11、a integrity and .Part3: Essay Questions (Total 20, each 4)1. What is system call? Use an example to illustrate(举例说明)the steps of system call.2. Please describe the diagram(图)of Process State.3. What is Monitor? Can you use Monitor to implement a data structure?4. What is TLB? What role does it play
12、in memory management?5. The difference of programming I/O and interrupt-driven I/O.Part4: Integrate Questions (Total 40, each 10)1. The code below is an example program of producer-consumer. The product produce numbers from 1 to MAX and the consumer will read it. Please fill blanks in the code#inclu
13、de #include #define MAX /* how many numbers to produce */pthread_mutex_t the_mutex;pthread_cond_t condc, condp;int buffer = 0; /* buffer used between producer and consumer*/void *producer(void *ptr) /*produce data*/int i;for (i=1; i=MaX; i+) pthread_mutex_lock(&the_mutex);while ( )pthread_cond_wait
14、(&condp, &the_mutex);buffer = i; pthread_exit (0);void *consumer (void *ptr) /*consume data*/int i, res;for (i = 1; i=MAX; i+) pthread_mutex_lock (&the_mutex);while ( )pthread_cond_wait ( , &the_mutex);res = buffer;buffer = 0;pthread_cond_signal(&condp); printf(“buffer=%dn” , res); pthread_exit (0);
15、int main (int argc, char *argv)pthread_t pro,con;pthread_mutex_init (&the_mutex, 0);pthread_cond_init (&condc, 0);pthread_cond_init (&condp, 0);pthread_create (&con, 0, consumer, 0);pthread_create (&pro, 0, producer, 0);pthread_join (pro, 0);pthread_join (con, 0);pthread_cond_destroy (&condc);pthrea
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 西安电子科技大学 操作系统 期末 试题 答案 解析 17
限制150内