辅导案例-CS 350
2020-07-19, 7)47 AMQuiz - CS 350 - Spring 2020 - University of Waterloo Page 1 of 10https://learn.uwaterloo.ca/d2l/lms/quizzing/user/attempt/quiz_atte…c=0&impcf=&pg=1&qi=144827&ai=8615610&dnb=0&cfql=0&d2l_body_type=1 Ques!on 1 (4 points) Ques!on 2 (4 points) Which of the following virtual memory implementa!ons does NOT suffer from external fragmenta!on if a tradi!onally laid-out address space is used? (Tradi!onally laid out, i.e., how OS/161 has a code, data, and stack segment). Select all that apply. dynamic reloca!on segmenta!on single-level paging mul!-level paging segmenta!on with paging 2020-07-19, 7)47 AMQuiz - CS 350 - Spring 2020 - University of Waterloo Page 2 of 10https://learn.uwaterloo.ca/d2l/lms/quizzing/user/attempt/quiz_att…c=0&impcf=&pg=1&qi=144827&ai=8615610&dnb=0&cfql=0&d2l_body_type=1 Ques!on 3 (4 points) Which of the following statements are true about on-demand paging. Select all that apply. A system uses mul!-level paging with 2^12 byte pages and 2^4 byte PTEs. The system uses 64 bit virtual and physical addresses. How many bits are used for the page offset? How many PTEs fit on a page? Give your answer in the form 2^X. How many bits are needed for the page number? How many levels are needed? 2020-07-19, 7)47 AMQuiz - CS 350 - Spring 2020 - University of Waterloo Page 3 of 10https://learn.uwaterloo.ca/d2l/lms/quizzing/user/attempt/quiz_att…c=0&impcf=&pg=1&qi=144827&ai=8615610&dnb=0&cfql=0&d2l_body_type=1 Ques!on 4 (4 points) The performance of on-demand paging is on par with address space preloading. Page faults are costly because they require a fetch from physical memory. Page faults are costly because they require a fetch from secondary storage. LRU is not prac!cal to implement. The op!mal page replacement algorithm requires knowledge of the future, and is hence impossible to implement at this point in !me. The clock algorithm es!mates LRU. The clock algorithm may loop forever. Page replacement algorithms could be used for TLB evic!ons or other cache evic!ons. 2020-07-19, 7)47 AMQuiz - CS 350 - Spring 2020 - University of Waterloo Page 4 of 10https://learn.uwaterloo.ca/d2l/lms/quizzing/user/attempt/quiz_att…c=0&impcf=&pg=1&qi=144827&ai=8615610&dnb=0&cfql=0&d2l_body_type=1 Ques!on 5 (1 point) Ques!on 6 (1 point) On a context switch between processes, the MMU must be updated and the TLB must be cleared. True False The addrspace structure contains informa!on for the physical and virtual start addresses along with the size in pages for each of the code, data, and stack segments. True False A system uses 32 bit virtual and physical addresses. It uses segmenta!on and has 4 segments in the address space. How many bits are used for the segment number? How many bits are used for the segment offset? What segment is the following address in? 0xA5A5 A5A5 What is the segment offset (write your answer in the format 0xDDDDDDDD). 2020-07-19, 7)47 AMQuiz - CS 350 - Spring 2020 - University of Waterloo Page 5 of 10https://learn.uwaterloo.ca/d2l/lms/quizzing/user/attempt/quiz_att…c=0&impcf=&pg=1&qi=144827&ai=8615610&dnb=0&cfql=0&d2l_body_type=1 Ques!on 7 (1 point) Ques!on 8 (1 point) Ques!on 9 (1 point) Ques!on 10 (1 point) Ques!on 11 (1 point) PTEs only contain the frame number. True False The bootstrapping problem is solved by the architecture. True False The number of levels in a mul!-level page table depends on the size of virtual memory, the number of PTEs that fit on a page and the size of physical memory. True False If every entry in a page table is invalid, then it will not be present in the mul!- level table. True False The use bit is used to determine if a page has been used since the last page 2020-07-19, 7)47 AMQuiz - CS 350 - Spring 2020 - University of Waterloo Page 6 of 10https://learn.uwaterloo.ca/d2l/lms/quizzing/user/attempt/quiz_att…c=0&impcf=&pg=1&qi=144827&ai=8615610&dnb=0&cfql=0&d2l_body_type=1 Ques!on 12 (1 point) Ques!on 13 (1 point) Ques!on 14 (1 point) Ques!on 15 (1 point) fault. True False In a modern opera!ng system, it is feasible that one could change the size of a segment via a system call. True False If the segment offset is equal to the segment limit, the MMU should throw an excep!on. True False load_elf is the name of the func!on used to populate an address space in OS/161. True False In OS/161, the stack segment posi!on and size is fixed. 2020-07-19, 7)47 AMQuiz - CS 350 - Spring 2020 - University of Waterloo Page 7 of 10https://learn.uwaterloo.ca/d2l/lms/quizzing/user/attempt/quiz_att…c=0&impcf=&pg=1&qi=144827&ai=8615610&dnb=0&cfql=0&d2l_body_type=1 Ques!on 16 (1 point) Ques!on 17 (1 point) Ques!on 18 (1 point) Ques!on 19 (1 point) True False kseg2 is extra space to be used by the kernel, should kseg0 fill up. True False LRU is not directly used in prac!ce. True False On modern computer systems, it is impossible to know the future. True False On-demand paging is always slower than address space preloading. True False 2020-07-19, 7)47 AMQuiz - CS 350 - Spring 2020 - University of Waterloo Page 8 of 10https://learn.uwaterloo.ca/d2l/lms/quizzing/user/attempt/quiz_att…c=0&impcf=&pg=1&qi=144827&ai=8615610&dnb=0&cfql=0&d2l_body_type=1 Ques!on 20 (1 point) Ques!on 21 (1 point) Ques!on 22 (1 point) Ques!on 23 (1 point) In dynamic reloca!on or segmenta!on, if the virtual address (or offset) is less than or equal to the corresponding limit, then the address is valid. True False Segmenta!on solves the external fragmenta!on problem that dynamic reloca!on suffers from. True False Many opera!ng systems solve the sharing problem by dividing the virtual address range into two blocks---one for the user, and the other for the kernel. That way, kernel and user addresses are easily dis!nguishable. True False With a con!guously allocated address space (all segments together), dynamic reloca!on suffers from internal fragmenta!on. True False 2020-07-19, 7)47 AMQuiz - CS 350 - Spring 2020 - University of Waterloo Page 9 of 10https://learn.uwaterloo.ca/d2l/lms/quizzing/user/attempt/quiz_att…c=0&impcf=&pg=1&qi=144827&ai=8615610&dnb=0&cfql=0&d2l_body_type=1 Ques!on 24 (1 point) Ques!on 25 (1 point) Ques!on 26 (1 point) Ques!on 27 (1 point) Ques!on 28 (1 point) Dynamic reloca!on is very efficient. True False kseg1 is used in OS/161 for devices. This means that the code used to interact with things like printers and keyboards lives in kseg1. True False In single-level paging, the number of bits in a page number is the log of the number of pages in the address space. True False Only leaf nodes of a mul!-level page table contain page-to-frame mappings. True False If an MMU supports segmenta!on via per-segment registers, the minimum 2020-07-19, 7)47 AMQuiz - CS 350 - Spring 2020 - University of Waterloo Page 10 of 10https://learn.uwaterloo.ca/d2l/lms/quizzing/user/attempt/quiz_att…c=0&impcf=&pg=1&qi=144827&ai=8615610&dnb=0&cfql=0&d2l_body_type=1 Ques!on 29 (1 point) number of registers required per segment is 2. True False There are three goals for a virtual memory implementa!on: isola!on, efficiency, and abstrac!on. True False Submit Quiz 0 of 29 ques!ons saved