Spring 2009 - Spring 2009 May 4, 2009 Name :

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Spring 2009 May 4, 2009 Name : _____________________________________________________________________ _ Question Maximum Current 1. True/False 10 pts 2. Short questions 4 3. 4 4. 4 5. 4 6. 4 7. 4 8. 4 9. 4 10. 4 11. Page replacement 12 12. Page tables 6 13. Lab question 10 14. Filesystem 10 15. Programming question 16 Total 100 1. True/False Questions (write F or T) (10 points, 1 point each) __ Swap space is the backing store for the heap. __ Third-level page tables (in a 3-level paging system) are allocated when needed by a process __ The access bit is set by the MMU __ The LRU page replacement policy is fully implemented by current hardware __ It's generally better to replace a dirty page than a referenced page __ Using 4 MB memory pages instead of 4 KB ones means that second-level tables are not needed (in a 32-bit architecture) __ Calling "unlink" on a symbolic link will decrease the reference count of the inode for the file specified by the path in the link __ The rootsquash mount option prevents files on a mounted file system from executing with superuser privileges. __ The page table base register remains unchanged whenever execution switches to a different thread in the same process. __ Using fchmod(int fildes, mode_t mode) is a better idea than using chmod(const char * path, mode_t mode) Short Questions 2. Virtual memory and mmap. a) Replace the following code sample by a single function call (hint: there are 2 correct answers, but you need only one of the two): fd = open("/dev/zero", O_RDONLY); ptr = mmap(0, desired_size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); close(fd); _____________________________________________________________________ ____________ b) What would happen in the virtual memory system if you were to call malloc followed by memset instead of the single function call? (hint: consider the case where a large number of pages would be initialized). Explain why the above call is preferable. _____________________________________________________________________ ____________ _____________________________________________________________________ ____________ _____________________________________________________________________ ____________ _____________________________________________________________________ ____________ _____________________________________________________________________ ____________ _____________________________________________________________________ ____________ _____________________________________________________________________ ____________ _____________________________________________________________________ ____________ 3. Explain mark-and-sweep garbage collection. _____________________________________________________________________ ____________ _____________________________________________________________________ ____________ _____________________________________________________________________ ____________ _____________________________________________________________________ ____________...
View Full Document

This note was uploaded on 01/30/2012 for the course CS 252 taught by Professor Gustavorodriguez during the Fall '11 term at Purdue University-West Lafayette.

Page1 / 13

Spring 2009 - Spring 2009 May 4, 2009 Name :

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online