Fragmentation:
Briefly describe what happens basic linking. Then, briefly describe the difference in dynamic runtime linking
Consider the following page reference string:
5,2,3,7,6,3,2,5,2,3,2
Assume pure demand paging so your first unique pages will all cost one fault each. Assume the process has a 3 frames at all times.
Consider a demand-paging system with the following time-measured utilizations:
CPU utilization: 10% Paging disk: 98% Other I/O devices: 8%
Which (if any) of the following will (probably) increase CPU utilization?
Suppose that a 32-bit virtual address is broken up into three fields: a, b, and c. The first two, a and b, are used for a two-level page table system. The third field, c, is the offset. How large is each page? How many pages can be in a logical address space?
Typically, the number of page faults is directly proportional to the number of page frames allocated to a process. If the number of frames given to the process is doubled, the number of page faults is typically halved. Suppose that a normal instruction takes 1 microseconds, but if a page fault occurs, it takes 10001 microseconds. If a program takes 30 seconds to run, during which time it has 1000 page faults, how long would it take to run if twice as much memory were available to it?
Put the system calls in order for use in a typical shared-memory program:
- shm = shmat(id)
- strcat(shm)
- shmctl(id, IPC_RMID)
- shmdt(shm)
- id = shmget(KEY, SIZE, PERMS)
Given the template for a WaitSemaphore()
system call:
/* Do a semaphore wait on the semaphore indicated by sid */ int WaitSemaphore(int sid) { /* statements a-h here */ }
Put the following statements in the right order:
- return 0;
- endif
- if (sema[sid].count < 0) then
- sema[sid].count--;
- pd[current_process].state = BLOCKED;
- if (!sema[sid].allocated) return -1;
- Dispatcher();
- insert(sema[sid].queue, current_process);
What is the role of the device independent layer of a device driver?