1 / 48

Tutorial 10

Tutorial 10. Exam Review. Q 1: Which of the following is NOT a good reason why operating systems are written in C?. The mapping from C to machine language is straightforward. C has sophisticated memory management capabilities. C provides direct access to memory locations.

Download Presentation

Tutorial 10

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tutorial 10 Exam Review

  2. Q 1: Which of the following is NOT a good reason why operating systems are written in C? • The mapping from C to machine language is straightforward. • C has sophisticated memory management capabilities. • C provides direct access to memory locations. • C programs are very fast.

  3. Q2: Which of the following statements about the earliest digital computers is FALSE? • They were very expensive. • The CPUs were idle most of the time. • Programmers had complete access to the machine. • The operating system on the computers included simple memory management.

  4. Q3: Instructions which query the running state of a processor (i.e. kernel or user mode) make virtualization difficult. Which of the following best explains why? • An instruction running in user mode of a guest operating system would report that it was running in kernel mode. • An instruction running in the kernel of the host operating system would report that it was running in user mode. • An instruction running in the kernel of the host operating system would report that it was running in kernel mode. • An instruction running in the kernel of a guest operating system would report that it was running in user mode.

  5. Q4: What advantages are there in developing an operating system as a series of layers? • It makes debugging easier and helps get the design correct for future expansion. • It is very efficient and uses the client/server model. • It simplifies verifying that the system is correct and makes debugging easier. • It simplifies verifying that the system is correct and is more efficient than alternative approaches.

  6. Q5: In order to allow safe multiprogramming what hardware advances needed to be made? • Hardware memory protection, interrupt processing, privileged instructions. • Hardware memory protection, time-sharing terminals, real-time processing. • Interrupt processing, privileged instructions, time-sharing terminals. • Interrupt processing, time-sharing terminals, hardware memory protection.

  7. Q6: Which of the following groups of information could sensibly be found associated with a PCB? • memory, devices, process state, which processor • access rights, links to other processes, cpu usage, owner • open files, condition handlers, resource limits, priority • all of the above.

  8. Q7: Which of the following is not a necessary component of a monitor (the concurrency construct)? • publicly accessible entry points. • a scheduler. • a readers/writers lock. • a shared resource which is protected by the monitor.

  9. Q8: Which of the following statements is FALSE about condition variables? • Condition variables are commonly used to block threads until the state of the program means they can continue. • Condition variables are associated with a queue that can hold threads. • Calling wait on a condition variable only puts a thread to sleep if the thread should not continue at that time. • Condition variables do not maintain any state about how many times they have been signaled.

  10. Q9: There is a lock variable associated with each Java object, on entering a synchronized method the lock is checked to see if it is free, already held by the current thread, or held by another thread. Which of the following statements is FALSE? • Once a thread acquires the lock, it releases the lock when it has finally left the synchronized method or it calls wait on the lock object. • Only one thread can be holding the lock at a time. • On entering a synchronized method the thread only progresses if the lock is free. • A thread can recursively call the same synchronized method safely.

  11. Q10: The Dining Philosophers can be used to illustrate what types of problem? • Priority inversion. • Deadlock. • Deadlock and livelock. • Livelock.

  12. Q11: Which of the following statements is TRUE? • Semaphores are at least as powerful as monitors. • Monitors are at least as powerful as semaphores. • Simple locks are at least as powerful as semaphores. • All of the above.

  13. Q12: Which of the following statements about deadlock is TRUE? • A wait-for graph can be used to detect deadlock. • The best way to solve the problem of deadlock is to use Dijkstra’s Banker’s algorithm. • It is impossible for deadlock to occur in a system with only one process. • Havenderdescribed the five necessary conditions for deadlock to occur.

  14. Q13: Which of the following answers best explains the Wound-Wait deadlock prevention scheme? • Processes can take resources from younger processes. Processes must restart rather than waiting for resources held by older processes. • Processes can take resources from younger processes. Processes may wait for resources held by older processes. • Processes can take resources from older processes. Processes may wait for resources held by younger processes. • Processes must restart rather than waiting for resources held by older processes. Processes may wait for resources held by younger processes.

  15. Q14: Which of the following is a problem with deadlock in distributed systems? • False cycle detection. • How to maintain the wait-for graph. • The Banker’s algorithm is more complicated in a distributed system. • All of the above.

  16. Q15: Which of the following statements about files is FALSE? • All Unix files are stored on secondary storage. • With sparse files it is possible to have the size of a file larger than the device the file is stored on. • Executable files have different structures specific to their particular operating systems. • Moving a file does not necessarily mean that all of the data needs to be copied and then the original file deleted.

  17. Q16: File types are useful for which of the following reasons? • They specify whether a file is executable or not. • They provide information to the file system about how the contents of a file are to be treated. • They specify which programs can open which files. • All of the above.

  18. Q17: Which of the following statements about file access is TRUE? • The only way to read from a particular position in a sequential access file is to first seek to that position. • The file system must maintain the current position pointer every time a direct (random) access file is read. • Writing to a file is usually faster than reading from it. • The file system does not always have to update the file length when a file is written to.

  19. Q18: Which of the following statements about MacOS resource forks or NTFS alternate data streams is FALSE? • Files with alternate data streams or resource forks can easily be handled by a wide range of operating systems. • The main use of NTFS alternate data streams is to hide extra data on the device. • The text in a word processing document would normally be stored in the resource fork. • All of the above.

  20. Q19: What was the main reason given in lectures that file systems usually do not allow hard links to directories? • Directories can be on different disk devices and this stops hard links from working. • Hard links don’t allow simultaneous access to files and this is particularly bad if the files are directories. • Hard links are slower than soft links and directory access has to be fast. • It is possible to create cycles in the directory tree.

  21. Q20: For contiguous allocation of disk space to files which of the following algorithms leaves the smallest amount of external fragmentation when a single file allocation is made? • Best fit. • Last fit. • First fit. • Worst fit.

  22. Q21: Using contiguous allocation for files if empty disk space is maintained in a linked list with random ordering, which of the following algorithms would be fastest to allocate space to a file. • Worst fit. • First fit. • Last fit. • Best fit.

  23. Q22: Which of the following is TRUE regarding linked allocation of files? • Linked allocation decreases the amount of internal fragmentation. • Linked allocation increases the amount of external fragmentation. • Linked allocation is slower than contiguous allocation for direct (random) access of file data. • Damage to one block never causes the loss of the rest of the file.

  24. Q23: Which of the following is TRUE regarding indexed allocation of files? • Damage to one block never causes the loss of multiple blocks of the file. • Indexed allocation is considerably faster than linked allocation for sequential access. • All indexed allocation schemes have no limits on the file size. • Indexed allocation means there is no external fragmentation.

  25. Q24: NTFS uses extents to keep track of the data of a file. Which of the following is the best description of an extent? • Extents are the current versions of File Allocation Table (FAT) linked data structures. • An extent holds the first 1K of a file followed by links to further extents. • An extent consists of a start cluster number and a length. • An extent is a pointer to a Master File Table entry.

  26. Q25: Which of the following replacement algorithms was most likely used to produce the output above? Least recently used (LRU). First in first out (FIFO). Random. Optimal.

  27. Q26: Which of the following replacement algorithms was most likely used to produce the output above? Random. Least recently used (LRU). Optimal. First in first out (FIFO).

  28. Q27:Which of the following statements best describes locality of reference and why it is important? • Over a long period of time most memory accesses are concentrated in small areas. This is important because it can be used to minimise the amount of memory that needs to be available in the system. • Memory or file accesses over a short period of time are largely predictable. This is important because it means that we can design our programs without having to take access behaviour into account. • The names of files used in a small period of time are closely related. Parts of the pathnames are the same and this is important in both local and distributed file systems. • Many memory or file accesses in a small period of time are close together. This is important for the efficiency of virtual memory, read-ahead in file data and in distributed file systems.

  29. Q28: Which of the following statements about transparency in distributed file systems is FALSE? • Both NFS and AFS provide location transparency. • Migration transparency means that files can be moved without programs which use those files needing to be changed. • Location transparency means that there is no visible connection between a file name and its position. • Location transparency requires migration transparency.

  30. Q29: Which of the following is NOT usually regarded as an advantage of a distributed file system? • It provides uniform access times to all files. • It provides greater flexibility for sharing data. • It provides a greater amount of storage. • It enables easy replication of file resources.

  31. Q30: In which of the following areas would caching of file data be better than using remote service? • Simpler implementation. • Less local memory used. • Speed of access to file data. • All of the above.

  32. Q31: Which of the following statements about consistency semantics is not TRUE? • Unix semantics is based on session semantics. • Unix semantics means that any change to a file is immediately visible to any other process. • With session semantics a process may be working on data which is out of date. • Session semantics is simpler to implement in a distributed file system than Unix semantics.

  33. Q32: Which of the following is FALSE about NFS as discussed in class? • NFS only uses dedicated servers. • Tables on each machine list the mount points and server information for the distributed files. • Remote directories are unmounted automatically by the automounter when unused. • Moving a collection of files is complicated.

  34. Q33: Which of the following is TRUE about AFS as discussed in class? • When a file is relocated all processes using the file lose access to it. • AFS is really only useful in small networks. • All AFS clients can also act as servers. • AFS uses Kerberos for system authentication.

  35. Q34: Which of the following statements concerning distributed services is FALSE? • A Remote Procedure Call uses stub functions on both the client and server end to connect a local procedure call on one machine to a procedure on a remote machine. • Process migration is not commonly used for load balancing because it is too expensive. • In a tuplespace the in and out primitives are atomic. • Remote Procedure Calls handle reference parameters in the same way they handle value parameters.

  36. Q35: Which of the following is NOT an advantage of most virtual memory systems? • Access control over areas of memory. • The ability to use more memory than exists in RAM. • The ability to easily share memory between processes. • Consistent access time to memory locations.

  37. Q36: Most operating systems don’t use the least recently used page replacement algorithm because it is too expensive. The second chance or clock algorithm uses which of the following bits associated with page information to approximate least recently used selection? • the access bits. • the mode bits. • the valid bit. • the referenced bit.

  38. Q37: Which of the following is the best description of what causes thrashing? • When the foreground process has completely used up the number of frames it has been allocated. • When there is not enough contiguous memory to be allocated for all current working sets. • When all frames are currently being used. • When the sum of the pages of the current working sets exceeds the number of frames.

  39. Q38: Which of the following statements about virtual memory on Windows is FALSE? • Privileged processes can lock pages in real memory. • Once a page has been allocated to a process’s working-set it cannot be removed. • A process can be allocated a number of frames up to its working-set maximum. • A process is guaranteed to be allocated its working-set minimum number of frames.

  40. Q39: Concerning protection and security which of the following definitions is incorrect? • A domain is a collection of ordered pairs <object, rights> • A setuid program is a program which can take on the privileges of the owner rather than those of the user. • A subject is a resource which can be used by a principal. • A reference monitor is a component which mediates accesses to objects.

  41. Q40: Which of the following best describes the Confused Deputy problem? • A program with privileges is tricked into misusing its authority. • A program with privileges is tricked into giving those privileges to another program. • A program with privileges gets so many requests that it loses track of which request came from which source. • A program with privileges mistakenly prevents access to a resource which should be available.

  42. Q41: Which of the following techniques would NOT be suitable to keep capabilities from being modified without permission? • On a tagged memory architecture, capabilities could be tagged and only privileged instructions could modify them. • All capabilities could be stored in kernel memory and only modified by system calls. • Capabilities could be encrypted. The public key could be used to check them but the private key to produce them is held by the security system. • Each process stores its own capabilities in memory not shared by other processes and provides them only when access control is being verified.

  43. Q42: Which of the following protocols allows two parties to cooperatively form a secret key for communication but without authenticating themselves with each other? • Needham-Schroeder symmetric key. • Diffie-Hellman. • Kerberos. • Menezes-Qu-Vanstone.

  44. Q43: Given the three “c”s of security failure: change, complacency and convenience, which of the following is most likely to produce a problem based on convenience? • Making a quick patch to enable a program to work on a different system. • Allowing a superuser to access all machine state. • Not checking the bounds on an array. • Providing all users with an electronic card key.

  45. Q44: Which of the following statements is FALSE with regards to Kerberos authentication? • Kerberos tickets are time expiring capabilities. • Kerberos is based on the Needham-Schroeder protocol. • If the Kerberos Authentication Server is down, no one can log in. • The Ticket Granting Server maintains the private keys of all principals.

  46. Q45: Which of the following are commonly used to gain users’ passwords? • Trojan horse. • Dictionary attacks. • Social engineering. • All of the above.

  47. Q46: Which of the following is an advantage that user level device drivers have over more traditional device drivers? • If a user level device driver causes a problem it is isolated from the rest of the system. • User level device drivers can more easily access interrupts using non-privileged code. • User level device drivers are faster. • User level device drivers allow multiple drivers to be used by a device at the same time.

  48. Q47: Which of the following disk scheduling algorithms potentially services requests of the middle tracks up to twice as often as the innermost or outermost tracks? • N-step SCAN. • SSTF - shortest seek time first. • C-SCAN - circular SCAN. • SCAN - elevator algorithm.

More Related