CMSC 412
Midterm #1 (Spring 2003)
A section of code that needs to be protected by mutual exclusion, any solution should also ensure that there is bounded waiting time and ensure forward progress.
A sequence of resource requests that allow a system to go from the current state the completion of all jobs in the system without entering deadlock. This can be done by ordering all processes such that any process can run to completion with its currently allocated resources plus those resources available at the start of the sequence and those held by processes earlier in the sequence.
When a system is unable to make forward progress. Requires the four necessary (but not sufficient conditions: hold & wait, circular wait, non-preemption, and mutual exclusion.
The lowest level part of the scheduler responsible for switching which process is currently running on the system.
·
Only one person at a
time is taking coffee out of the decaf urn
·
Only one person at a
time is taking coffee out of the regular urn
·
Only one urn is on the
coffee maker at a time
·
If one type of urn is
being made and the other has coffee, people can get the type of coffee that is
available.
Semaphore decaf(1), regular(1), maker(1)
If (usesDecaf) {
P(decaf)
If (isEmpty(usesDecaf)) {
P(maker);
// make decaf coffee
V(maker);
}
// take decaf coffee
V(decaf);
} else {
P(regular)
If (isEmpty(usesDecaf)) {
P(maker);
// make regular coffee
V(maker);
}
// take regular coffee
V(regular);
}
No, here solution will not work since the user space programs expect their virtual addresses to start at 0. If she runs using the kernel segment, the address 0 will be part of the kernel’s code.
To decouple versions of the OS kernel from user space programs.
To control what functions in the kernel can be called from user space.
policy – only the student’s and their TAs can read files.
Mechanism – File access is controlled based on access control lists.
So programs can’t trick the kernel into reading memory that is out of range. Need to check extent check for the case when the starting pointer is valid, but the end is past the end of a process’s memory.