Computer Science 422/622 Quiz 1 - Name ____________________ 1. Which one of the following is a function provided by a single-user multi-tasking OS that is not provided in a single-user single-tasking "OS" such as MS-DOS. a. program loading b. memory protection c. subroutines/system calls d. A file system for performing I/O 2. Which one of the following is a function provided by a multi-user multi-tasking OS that is not provided in a single-user multi-tasking "OS" such as Windows 95. a. ability to run multiple b. memory protection processes apparently concurrently. c. subroutines/system calls d. Login processing for performing I/O 3. Identify the correct class of OS for each of the following example systems: 1. Single-user single-task ____ a. OS/2 2. Single-user multi-task ____ b. Windows NT 3. Multi-user single-task 4. Multi-user multi-task 4. Identify the functional component that performs the following OS functions ___ a. Map relative file offsets 1. Process management to physical disk (c-h-s) addresses. 2. Memory Management ___ b. Detect the existence of 3. Resource Management deadlocked processes 4. I/O device management 5. File management 5. The mechanism used by the OS to regain control from a program in an infinite loop is: a. Priviledged instructions b. The memory protection system c. A timer interrupt. d. The system administrator. Computer Science 422/622 Quiz 2 Name _____________________ Rules: Write your name in the upper right corner of both front and back. Don't fold your paper. Do your own work. Closed Books & Notes. 1. For each of the following "real world" operating systems identify the appropriate organization. _____ a. IBM's OS/MVS for S/370 1. Hierarchical _____ b. The Mach MicroKernel 2. Monolithic _____ c. DEC's VMS for VAX 3. Fully distributed _____ d. IBM's OS/2 2.0 for PCs 4. Object/Process oriented 2. In the multiasking model that we discussed in class, OS code runs: a. each time a switch between b. only after all tasks have two application tasks occurs. had a chance to run. c. after each instruction is d. only when there are no executed by an application. applications available to run. 3. Identify whether each of the following functions is performed by the application (A), the interrupt hardware (I), or the OS (O) when a hardware interrupt causes an application process to be preeempted ____ a. Save the SP (stack pointer) register in the PCB of the interrupted process. ____ b. Push the general registers onto the stack. ____ c. Save the Flags and IP (Instruction Pointer) on the stack. ____ d. Copy the address of the first instruction of an OS interrupt service routine from the Interrupt Vector Table to the IP (instruction pointer) register. Computer Science 422/622 Quiz 3 Name _____________________ Rules: Write your name in the upper right corner of both front and back. Don't fold your paper. Do your own work. Closed Books & Notes. 1. Which of the process state transitions would NOT normally be made by a process that did a large amount of computing but no input or output at all. (Select all that apply..) a. Ready to Running b. Running to Ready c. Running to Blocked d. Blocked to Ready 2. Which of the following state transitions would be made LEAST OFTEN by a process that did a large amount of I/O and used only a few MICRO seconds of processor time between each I/O. (Only Select ONE). a. Ready to Running b. Running to Ready c. Running to Blocked d. Blocked to Ready 3. Suppose 2 processes are to be run and EACH ONE requires 5 minutes of processor time and 5 minutes of disk time. If they were run on an ideal multitasking system in which perfect overlap was achieved with no overhead at all, the time to completion of both would be closest to: a. 5 minutes b. 10 minutes c. 15 minutes d. 20 minutes 4. Now suppose two more processes are to be run. Each one of these requires 10 minutes of CPU time but does not use the disk at all. If they are run on an ideal (no overhead) multitasking system, the time to completion of both would be closest to: a. 5 minutes b. 10 minutes c. 15 minutes d. 20 minutes 5. Another possible way to run both pairs of processes would be to run them one at a time, starting the second one as soon as the first one finished (as you would have to do in DOS). In this case one would compute the average time to run the jobs as: (Note that start_time_1 is used in BOTH terms). (end_time_1 - start_time_1) + (end_time_2 - start_time_1) -------------------------------------------------------- 2 The average completion time is: a. Lower for DOS style scheduling b. Lower for multitasking in in both (3.) and (4.) both (3.) and (4.) c. Lower for DOS style in (3.) d. Lower for DOS style in (4.) but lower for multitasking but lower for multitasking in 4.) in (3.) Computer Science 422/622 Quiz 4 Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. 1. Which of the following would NOT be an input parameter when an application makes the create_process( ) system call. a. Name of a program to run. b. Addr of the PCB for the new process c. Size of stack required d. Priority of the new process. by the new process 2. Identify the data structures used to maintain the following PCB structures ____ a. The static (parent / 1. Binary heap child) structure 2. Binary tree ____ b. The dynamic (process state) structure 3. General tree 4. Linked list 5. Stack 3. When an executing process successfully unblocks another process it is necessary for the OS to modify a. The static process stucture b. The dynamic process structure c. Both d. Neither 4. Identify the IMPORTANT FUNCTION that must be performed by the OS at the entry to EVERY system call. 5. What value did we identify as the input parameter to the delete_process() system call. Computer Science 422/622 Quiz 5 Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. 1. The input parameter(s) passed INTO the pipe system call is/are: a. The PID of the process to b. A pointer to an array which to connect the pipe. of two integers. c. A integer value representing d. None of the above... pipe the pipe handle and another like fork has no parameters. integer value representing the capacity of the pipe. 2. Which of the following BEST describes the following segment: [1] pid = fork() [2] pipe(&pd); [3] if (pid == 0) [4] child_proc(); [5] else [6] parent_proc(); a. A single pipe will be created b. Two pipes will be created and the parent and child will and the parent and child be able to communicate through will be able to communicate it. using either one. c. A single pipe will be created d. Two pipes will be created but the parent and child will but the parent and child not be able to communicate through will not be able to communicate it. using either one. <<<<<<<<<<<<< OVER >>>>>>>>>>>>>>>>>>>>>>>>>>>> Consider the following program segment: (NOTE WELL: This is not exactly the same program segment found in last years quiz.) x = 11; pid = fork(); if (pid != 0) { x = 12; sleep(60); printf("hello\n"); printf("%d\n", x); } else { sleep(10); printf("world\n"); printf("%d\n", x); x = 15; } 3. In the above program: a. The parent will print "hello" b. The child will print "hello" and the child "world" and the parent "world" b. Both parent and child will d. The child will print "hello" print "hello" and "world" and "world" but the parent wil just print "world" 4. What numeric value will be printed by the parent? 5. What numeric value will be printed by the child? Computer Science 422/622 Quiz 6 Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. 1. Which of the following process state transitions is LEAST likely to occur. (In == Swapped In Out == Swapped Out) a. In blocked to b. Out blocked to Out blocked. Out ready c. Out blocked to d. In ready to In blocked. Out ready 2. Which of the following would NOT be a factor in determining when to swap a process out of memory. a. The paging rate is b. A swapped in process very high. has been blocked for a long time. c. There are a number of d. There are no swapped out ready processes already swapped processes but its been a long time out ready. since the last swap out. 3. A swapped out process will be dispatched: a. More frequently than a b. Not at all swapped in process c. Only if there is no ready d. Somewhat less frequently than swapped in process. ready swapped in processes. 4. Is each of the following schedulers generally classed as preemptive xor non-preemptive (yes is not a correct answer) a. medium term scheduler b. long term scheduler 5. In addition to scheduling batch jobs long term scheduling also includes a. swapping b. dispatching c. initiation of interactive d. all of the above. sessions (login processing) Computer Science 422/622 Quiz 7 Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. 1. Which of the following would NOT be a good reason for the swapper to select a process for swapping OUT. a. The process is in the b. The process is using a large suspended rather than amount of memory. the ready state. c. The process has low d. The process has not been dispatched priority since it was last swapped in. 2. On a single CPU system the decision made by the short term scheduler of WHAT TO preempt is: a. Derived from a complicated b. Deterministic.. there is only set of factors including one choice. priority. c. Made by randomly selecting d. Made by randomly selecting from one of the swapped in all processes. processes. 3. Which of the following would not be a factor in selecting which process to swap in: a. The priority of the process b. How much memory it used c. How much CPU time it had d. Whether it was out blocked or consumed since it was swapped out ready. out. 4. The maximum rate at which you might expect a process to be swapped on a busy time sharing system is closest to: a. Once every day b. Once an hour c. Once a minute d. Once a millisecond. 5. When a process is suspended waiting for a single disk I/O to complete: a. It would typically be b. It would typically be swapped swapped out and in out and in once. several times. c. It would typically not be swapped out at all. Computer Science 422/622 Quiz 8 Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. 1. As the number of active users of an interactive system is increased, the throughput of the system: a. Decreases b. Increases without bound. c. Approaches a limiting d. Is equal to the response time. upper bound. 2. As the number of active users of an interactive system is increased, the average response time of the system: a. Decreases b. Increases without bound. c. Approaches a limiting d. Is equal to the throughput. upper bound. 3. Suppose PS scheduling is assumed and four jobs are started at the same time. None of the jobs do any I/O. Two require 2 hours of CPU time and two require 1 hour of cpu time. How long after all the jobs start will the last two jobs finish? a. 6 hours. b. 8 hours. c. 10 hours d. 12 hours. 4. The preemptive version of FCFS scheduling is: round robin scheduling is: a. Round robin. b. Shortest remaining time next. c. Shortest Job First d. Last Come First Served Preemptive Resume. <<<<<<<<<<<< Over >>>>>>>>>>>>>>>>>>>>>>>> 5. Consider the program segment shown below: If this program is run several times would you expect the value in the file "test.dat" at the end of each run to be: a. Always be exactly 300 b. Various positive numbers < 300 c. Always the same positive d. Various positive numbers number < 300. greater than 300. #include main() { FILE *update; int status; update = fopen("test.dat", "w"); fprintf(update, "%d", 0); fclose(update); if (fork() == 0) { doit(1); exit(1); } if (fork() == 0) { doit(2); exit(1); } wait(&status); wait(&status); printf("Done\n"); } doit(inc) int inc; { FILE *update; int i; int value; for (i = 0; i < 100; i++) { update = fopen("test.dat", "r"); fscanf(update, "%d", &value); fclose(update); value += inc; update = fopen("test.dat", "w"); fprintf(update, "%d ", value); fclose(update); } } Computer Science 422/622 Quiz 9 Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. For each of the following approaches to providing mutual exclusion select the answer which best describes how it worked (or failed to work). 1. Both processes have an "Process Using Critical Section" flag. Before entering, a process sets its own flag and then tests the other process's flag. If clear, it procedes through the critical section. If not, it unsets its own flag and restarts the algorithm. a. Not safe. c. Could cause starvation (livelock). b. Could cause deadlock. d. Causes strictly alternating access to critical section. e. Works correctly 2. Both processes have a "Process using Critical Section" flag. Before entering, a process sets its own flag and then loops until the other processes flag is clear. a. Not safe. b. Could cause starvation (livelock). c. Could cause deadlock. d. Causes strictly alternating access to critical section. e. Works correctly 3. Both processes have a "Process using Critical Section" flag. Before entering, a process loops until the other processes flag is clear and then sets its own flag. a. Not safe. b. Could cause starvation (livelock). c. Could cause deadlock. d. Causes strictly alternating access to critical section. e. Works correctly 4. Identify the two most significant disadvantages to "real world" use of Dekker's algorithm as a general approach for mutual exclusion: a - b - 5. In Dekker's algorithm process 1 will loop with its own "using Critical section flag" set while it waits for process 2's "using Critical Section" flag to clear: a. Never b. Only if it is process 2's turn to "insist" c. Always d. Only if it is process 1's turn to "insist" Computer Science 422/622 Quiz A Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. 1. Which of the following is NOT an advantage of usings multiple threads instead of multiple processes to implement a parallel algorithm. a. Thread creation is less costly b. It is easier to share data than process creation since it among threads than processes is not necessary to create a new address space. c. Threads provide for better isolation of private data than processes do. 2. Consider the following code segment: int a; void xthread(int b) { int c; Suppose two threads are created and both run the function xthread which of the following BEST characterizes the sharing of data. a. The variable 'a' is shared b. 'a' and 'b' are shared but but both threads have private 'c' is private. copies of 'b' and 'c'. c. All three variables are shared d. all three variables are private. (i.e. if either thread changes one of them, the change is seen by the other thread. 3. A semaphore "WAIT" operation will decrement the value of the semaphore if: a. The original value was > 0. b. There was no task blocked on the semaphore at the time of the call. c. The original value was >= 0. d. Always. 4. A the value of a semaphore will have been incremented at the conclusion of a signal operation if: a. If the original value was > 0. b. There was no task blocked on the semaphore at the time of the call. c. If the original value was = 0. d. Always. <<<<<<<<<<<<<<<<<<<<<<< OVER >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Consider the following (correct) implementation of setlock: [0] CLI ;disable ints [1] RETRY: [2] CMPI LOCKVAL, 0 ;see if its 0 [3] JNZ RETRY ;if not, keep trying til it is. [4] TS LOCKVAL ;use the hardware to make sure. [5] JNZ RETRY ;start over if we got beat to the lock [6] RET 5. If statements [2] and [3] were removed which of the following BEST describes the result in a multiprocessor system: a. it would no longer work b. it would still work correctly correctly and it would and it would cause a performance cause a performance problem problem c. it still work correctly and improve performance Computer Science 422/622 Quiz B Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. 1. The first semaphore based "solution" to the readers and writers problem that we discussed in class used only a single semaphore called "mutex". The disadvantage of this solution was: a. It allowed one reader to b. It allowed for starvation read while one writer of writers. wrote and was thus unsafe. c. It only permitted one d. It only permitted one writer reader at a time to read. at a time to write. 2. In the "improved" semaphore based solution that we discussed in class, if a process is writing and multiple readers are waiting to read, a. All readers will be b. All readers will be blocked on blocked on wsem rmutex. c. All readers but one d. All readers but one will be blocked will be blocked on wsem on rmutex. 3. The "improved" semaphore based solution that we discussed in class was a a. Writer priority solution. b. The reader priority solution. c. The strict Fifo solution. 4. In the MVS system for handling readers and writers: a. Arriving readers pass b. Arriving readers pass waiting writers but waiting writers and arriving writers don't arriving writers pass waiting readers. pass waiting readers. c. Arriving readers don't pass d. An arriving writer can't waiting writers but pass waiting readers and an arriving writers do arriving reader can't pass pass waiting readers. waiting writers. 5. An advantage of the use of the MVS style system call when compared to the semaphore based method described in class. a. Counting semaphores are b. The OS can use data structures used inside the OS rather more appropriate for the problem than by the application. and avoid the use of counting semaphores all together. c. With the system call approach d. Both b. and c. are advantages. it is much easier to implement ANY desired priority scheme. Computer Science 422/622 Quiz C Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. 1. We discussed a data structure called "struct qcbtype" that would be used by an MVS style resource allocation (enqueue/dequeue) manager. Which of the following was NOT an element of the structure: a. The resource name b. A test and set type lock. c. A count of active writers d. A count of active readers 2. Identify one element (OTHER than those listed in 1) that WAS in the structure. 3. The method recommended by Dr. Westall for managing the source code of a large (10,000+ lines) program is to: a. Make sure that you keep it b. Use the #include facility in one large file so that to include all of the subroutine no modules can get lost. modules into the main.c module so that you don't have to run the compiler but one time . c. Compile each module separately, maintain a collection of .o files and build an executable in a separate link step. 4. Which of the following is NOT a reason that message passing is a much more widely used high level interprocess synchronization method than semaphores: a. Message passing is better b. Message passing is computationally suited for distributed more efficient. (networked) environments. c. Message passing is more suitable for process / object oriented designs. 5. For client / server systems using message passing a. Indirect naming is b. Direct naming is superior superior to direct naming. to indirect naming. c. Both methods are d. Neither method is at all equally good. suitable. Computer Science 422/622 Quiz D Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. 1. In a system using mailboxes it is typically requires the highest degree of privilege to: a. Write to the mailbox b. Read the mailbox c. Open the mailbox. 2. Which of the following is NOT a benefit of using message copying rather than pass by address. a. Copying is more appropriate b. Copying avoids problems related in a distributed system. to protecting the memory of the sender. c. Copying is more efficient. 3. Which of the following pairs of approaches to synchonization would be most likely to be useful in an a message passing system in which indirect naming (mail boxes) were used. a. Blocking writes and b. Blocking reads and non-blocking reads non-blocking writes c. Non-blocking reads and non-blocking writes. 4. We identified two ways of dealing with mailboxes that were not destroyed by their owner before the owner exited. Identify the principal DISADVANTAGE of each approach: 1 - Simply destroy the mailbox and its contents whenever the last process to have the maibox open exits. 2 - Never destroy a mailbox unless a process with authority to destroy it does so via the "m_destroy()" system call. Computer Science 422/622 Quiz E Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. 1. A mailbox write procedure should check for a. Blocked readers before checking b. Available buffer space before for available buffer space. checking for blocked readers. c. It doesn't matter because blocked readers and available buffer space are mutually exclusive. 2. A mailbox read procedure should check for a. Blocked writers before removing b. Blocked writers after removing a message from the bufffer. a message from the buffer. c. It doesn't matter because blocked writers and buffered messages are mutually exclusive. 3. The address of the input buffer of a reader that is blocked on a mailbox can best be kept: a. In the mailbox structure. b. In the PCB of the blocked reader c. Both locations are equally d. Neither location will work suitable at all. 4. A mailbox's queue of blocked processes can contain. a. Blocked readers but never b. Blocked writers but never blocked writers. blocked readers. c. BLocked readers or blocked d. Both blocked readers and writers but never both at blocked writers. the same time. 5. In order to guarantee that a deadlock over a resource can't occur it is NECESSARY to: a. Make sure that at least b. Make sure that all four one of the four conditions of the conditions can't can't hold. hold. c. Make sure that at least three of the four conditions can't hold. Computer Science 422/622 Quiz F Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. 1. For each of the following ways of preventing deadlock identify the resource type for which its use is best suited: ____ a. Preemption 1. OS internal locks. ____ b. Hierarchical allocation 2. Files and devices. ____ c. Simultaneous allocation 3. Memory 2. Deadlock detection and avoidance algorithms are suitable for use with a. Consumable resources b. S-R but not consumable but not serially reusuable resources c. Both consumable and S-R d. Neither consumable or S-R. 3. Does the graph shown below represent a deadlocked system? Computer Science 422/622 Quiz G Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. 1. Consider the resource graph shown: There are only three processes and two resource classes. Each class has two instances. Is the system deadlocked? a. yes b. no c. impossible to tell from graph. 2. In the deadlock detection algorithm a process was blocked if and only if it had (assume available resources are never withheld in the allocation procedure). a. A positive entry in the b. A positive entry in the requested allocated matrix. matrix. c. Positive entries in both d. A positive entry in either requested allocated and requested or allocated. 3. In the deadlock detection algorithm resources were the resources of process i were released if a. Requested[i][j] <= avail[j] b. Requested[i][j] <= avail[j] for some j. for all j. c. Requested[i][j] >= avail[j] d. Requested[i][j] >= avail[j] for some j. for all j. 4. When a the resources of process i were released what was added to avail[j]? a. Allocated[i][j] b. Requested[i][j] c. Allocated[i][j] + d. Allocated[i][j] - Requested[i][j] Requested[i][j] 5. The system was free of deadlock at the end of the procedure if a. At least one process was b. All processes were not blocked. not blocked (= marked). c. All processes were blocked (=unmarked) . Computer Science 422/622 Quiz H Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. Consider the following code fragment: Rel Loc Machine Code Assembler Code (IN HEX) (IN HEX) : : : : : : 00012A 5010???????? ST R1, X ;Store R1 in variable X. : : : : : : : : : 00023C 5820???????? L R2, X ;Load X into R2. : : : : 00058C 0000000B X DW 11 ;Define word variable x ; with init value 11 1. What value(s) (in hex) will the relocation table for this code contain? 2. Suppose this program is loaded into real memory at program base address 0x20000. What will be the actual value of the operand of the L(oad) instruction (the 2nd batch of ???'s) at the time the program actually begins execution. 3. Consider the following C variable declaration and initializations; [1] int x = 100; [2] int *y = &x; Which of the above will cause relocation table entry(ies) to be generated: a. [1] but not [2] b. [2] but not [1] c. Both [1] and [2] d. Neither 1 nor 2. ----------------------- Over ------------------------------ 4. In real (UNmapped) memory system program relocation can typically be performed: a. When the program is initially b. Any time. read in to memory but not after it starts running. c. Never. 4. In real (UNmapped) memory system using the fixed partition scheme for memory managment: a. Swapping of processes in and b. Swapping is possible but a out of memory is generally process must be swapped back not possible. into the same partition it was swapped out of. c. Swapping is possible and a d. Swapping is possible and a process can be swapped back process can be swapped back into any partition that has in to ANY free partition. the same size as the one it was swapped out of. Computer Science 422/622 Quiz I Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. 1. The partition management policy that has been accused of creating small unusable free blocks is: a. First Fit. c. Last fit. b. Best Fit. d. Worst fit. 2. Which of the following policies is NOT one that we discussed. a. First Fit. c. Last fit. b. Best Fit. d. Worst fit. 3. Which of the memory allocation policies that we discussed always allocates from the largest free block of memory. a. First Fit. c. Last fit. b. Best Fit. d. Worst fit. 4. If the list of free blocks of memory is always sorted into ascending size order, then the four policies are really two pairs of eqivalent policies. Draw circles around each equivalent policy pair. a. First Fit. c. Last fit. b. Best Fit. d. Worst fit. 5. Recombining free blocks in a variable partition system is necessary a. Only during a partition b. Only when a partition is freed. allocation. c. Both a. and b. d. Only when a process terminates abnormally Computer Science 422/622 Quiz J Name____________________ Answer the following H, O, or L depending upon whether the specified function is the responsibility of the Hardware, the OS, or the Language compiler and Linker. ___ 1. Loading the segment table base and bounds registers from the values kept in the PCB each time a process is dispatched. ___ 2. Creating the segment table skeleton that is part of the a.out file. ___ 3. Ensuring that the action performed in each memory access (read, write, or execute) is consistent with the attributes of the segment being referenced. 4. The memory mgmt function in which segmentation has the biggest advantage over base and bounds addressing is: a. Protecting the OS from b. Support for controlled sharing user processes. among cooperating processes. c. Protecting independent d. No advantage in any of the user processes from areas. each other. 5. In a system that employs segmentation, addresses used to access memory consist of 2 distinct components. What are they: 1 - 2 - Computer Science 422/622 Quiz K Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. 1. The one combination of the allocated and present bits that should never occur is: a. Not allocated and b. Allocated and not present. not present. b. Not allocated and d. Present and present. allocated. 2. The combination of the allocated and present bits that indicates that a process has made a memory protection violation is: a. Not allocated and b. Allocated and not present. not present. b. Not allocated and d. Present and present. allocated. 3. Suppose a computer system uses 2048 byte sized pages. The number of bits representing the OFFSET within a page is: a. 9 b. 10 c. 11 d. None of the above 4. If a computer system uses 1024 byte sized pages, and a process references address: 0x567def the OFFSET within the page being referenced is: a. 0xdef b. 0xef c. 0x1ef d. None of the above 5. Suppose a computer system uses 4096 byte pages and virtual address with the value 0x004567 is generated. What physical address will this address be generated if the page table shown is used: 0x007 a. 0x000006 b. 0x00b567 0x00a 0x006 c. 0x006567 d. 0x004567 0x00b 0x001 0x234 PTBR -> 0x005 Computer Science 422/622 Quiz L Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. 1. In a paging system the average amount of memory wasted (in the allocated but not really needed sense) PER PROCESS is: a. none at all. b. 1 page c. 1/2 page. d. 4096 bytes 2. The optimal page stealing policy is to steal the page that a. was referenced most b. was referenced most distant in the past. recently c. will be next referenced d. has the smallest number of most distant in the future total references. 3. When a process "mallocs" a large block of memory (e.g. 1MB == 256 pages) the normal OS policy is to: a. Immediately allocate 256 b. Mark the 256 pages allocated in new page frames to the the page table but keep P = 0 process. and not allocate real frames until referenced. c. Neither allocate the frames nor set the allocated bit. 4. Page tables are associated with processes as follows: a. Each process has its own b. All processes share one page table. global page table. c. User processes share one table and OS processes share another. 5. Answer the following H or O depending upon whether it is a hardware or OS function: ___ a. Testing the P bit and generating an interrupt if P = 0 on each access to memory. ___ b. Testing the A bit to determine if a page has was actually allocated to a process. Computer Science 422/622 Quiz M Name _____________________ Rules: Write your name in the upper right corner of both front and back. Write your userid on the front. Don't fold your paper. Do your own work. Closed Books & Notes. UIC = Unreferenced interval counter 1. When an OS implements pseudo-LRU it periodically tests the referenced bit of each page and (circle ALL THAT ARE CORRECT) a. Sets the UIC for the b. Adds 1 the UIC for the page to 0 if the page page if the page has not been referenced has not been referenced c. Sets the UIC for the d. Adds 1 the UIC for the page to 0 if the page page if the page has been referenced has been referenced 2. When a pseudo-LRU page replacement policy is in effect, global real memory overcommittment (==shortage) can be detected when: a. When the min value of b. When the min value of all UIC's is small. all UIC's is small. c. When the min value of d. When the max value of all UIC's is large. all UIC's is large. 3. The working set of a process at reference n with window h is denoted w(n, h). The maximum size of w(n, h) is: a. n b. h c. 1 d. The number of pages owned by the process 4. The minimum size of w(n, h) is: a. n b. h c. 1 d. The number of pages owned by the process 5. As each new reference to memory is made the size of a working set will. a. Stay the same b. Grow c. Shrink d. Either a or b. e. Either a. b. or c.