Consider a paging system with the page table stored in memory:
Fragmentation:
Explain how the OPT page replacement algorithm is similar to the SJF process scheduling algorithm. In particular, what are the uses for OPT and SJF?
Consider a system with 1024 bytes (words) of physical memory divided into 16 frames. The logical address space for each process also has 32 pages:
Consider the following pseudo-program with a fork() call that starts a process running in the indicated function. The process then terminates after the function is over:
/* global variable */ int x int main() { fork(doIt) x = 0 print(x) } void doIt() { x = 1 print(x) }
fork()
call with a
create_thread()
call that makes a new thread instead of
a process. Now, what are the possible outputs?
mutex_lock()
and
mutex_unlock()
to ensure that running the program
prints "0" first and then "1".
Consider a system with 32 bits for a memory access. Assume a 2 level paging scheme with 4 bits for the outer page table and 8 bits for the inner page table. How big is each page?
What is a relocation register? Give an example and describe how it is used. What additional hardware can you add to the relocation register to enable memory protection? Give an example.
Using only the following pseudo-system calls and statements:
Implement a client and a server that has the client connect to the
server, send a login name (from the keyboard) to the server, receive
an "ok" from the server and close the connection. You may use the
above statements more than once, as needed.