CS6400 COMPREHENSIVE EXAM 2026
QUESTIONS WITH SOLUTIONS GRADED A+
◉ Can you make distinction between OS abstractions Answer:
mechanisms, policies?, Abstractions are the user-facing virtual
representation of access to hardware
resources, like sockets for network hardware, as well as virtual concepts
like
the idea of "users" themselves to create a layer above the hardware that
allows
complex interactions. Mechanisms are the back-end that supports the
way
that abstractions are implemented. For example, "users" are a virtual
concept
that is implemented through the mechanism of profiles, access control
lists,
etc. Finally, policies are the varying mechanisms that can exist for a
particular abstraction. For example,
user threads (an abstraction), which are scheduled on the CPU by their
respective kernel thread (mechanism),
follow a particular scheduling policy, which can be something like a
"round-robin" policy, or "shortest task
first" scheduling.
,◉ What does the principle of separation of mechanism and policy mean?
Answer: In essence, this is just further abstraction but on a lower level in
the system: for kernel developers instead
of users.
This ties into the idea of "separation of concerns." A particular
mechanism, such as scheduling, shouldn't
actually care what the scheduling policy is. It should delegate that
responsibility to the policy itself, which
should be swappable / configurable. By providing a common interface
for policies, it makes it easier for
people to define their own without actually being concerned with how its
implemented.they can trust the
mechanism to do the right thing based on their policy
◉ What does the principle optimize for the common case mean?
Answer: It's pretty self-explanatory: the design should be optimized for
the way it's most likely to be used. For
example, the "interrupts as threads" design is beneficial to overall
system performance because despite the
fact that there is a cost incurred for interrupts, there are savings on every
mutex lock/unlock operation.
Because the latter occur much more frequently than the former (common
case), it's an overall performance
gain.
, ◉ What happens during a user-kernel mode crossing?
What are some of the reasons why user-kernel mode crossing happens?
Answer: This "crossing" is known as a system call. These special calls
are the only means through which users can
interact with the system in a privileged way. Here's what happens, to
some granularity of detail:
• A permission flag is set in hardware that indicates "kernel mode"
privileges.
• The program jumps to the kernel interrupt handler. Here (based on the
system call parameters) it
will jump to the system call requested.
• The system call begins executing in the context of the kernel. This
involves things like checking
parameters, (safely) copying data from userspace, etc.
• The requested privileged action is taken (such as telling a disk driver to
read some bytes and place
them in a particular memory location).
Primarily, these crossings involve interaction with privileged resources
and hardware. For example, applica-
tions reading from a file (read()), requesting more memory (mmap()),
creating network resources (socket()),
etc. are all examples of actions that require crossing into kernel mode.
Crossings can also occur if users
violate rules. For example, if a user tries to access a privileged memory
address (recall that part of a pro-
QUESTIONS WITH SOLUTIONS GRADED A+
◉ Can you make distinction between OS abstractions Answer:
mechanisms, policies?, Abstractions are the user-facing virtual
representation of access to hardware
resources, like sockets for network hardware, as well as virtual concepts
like
the idea of "users" themselves to create a layer above the hardware that
allows
complex interactions. Mechanisms are the back-end that supports the
way
that abstractions are implemented. For example, "users" are a virtual
concept
that is implemented through the mechanism of profiles, access control
lists,
etc. Finally, policies are the varying mechanisms that can exist for a
particular abstraction. For example,
user threads (an abstraction), which are scheduled on the CPU by their
respective kernel thread (mechanism),
follow a particular scheduling policy, which can be something like a
"round-robin" policy, or "shortest task
first" scheduling.
,◉ What does the principle of separation of mechanism and policy mean?
Answer: In essence, this is just further abstraction but on a lower level in
the system: for kernel developers instead
of users.
This ties into the idea of "separation of concerns." A particular
mechanism, such as scheduling, shouldn't
actually care what the scheduling policy is. It should delegate that
responsibility to the policy itself, which
should be swappable / configurable. By providing a common interface
for policies, it makes it easier for
people to define their own without actually being concerned with how its
implemented.they can trust the
mechanism to do the right thing based on their policy
◉ What does the principle optimize for the common case mean?
Answer: It's pretty self-explanatory: the design should be optimized for
the way it's most likely to be used. For
example, the "interrupts as threads" design is beneficial to overall
system performance because despite the
fact that there is a cost incurred for interrupts, there are savings on every
mutex lock/unlock operation.
Because the latter occur much more frequently than the former (common
case), it's an overall performance
gain.
, ◉ What happens during a user-kernel mode crossing?
What are some of the reasons why user-kernel mode crossing happens?
Answer: This "crossing" is known as a system call. These special calls
are the only means through which users can
interact with the system in a privileged way. Here's what happens, to
some granularity of detail:
• A permission flag is set in hardware that indicates "kernel mode"
privileges.
• The program jumps to the kernel interrupt handler. Here (based on the
system call parameters) it
will jump to the system call requested.
• The system call begins executing in the context of the kernel. This
involves things like checking
parameters, (safely) copying data from userspace, etc.
• The requested privileged action is taken (such as telling a disk driver to
read some bytes and place
them in a particular memory location).
Primarily, these crossings involve interaction with privileged resources
and hardware. For example, applica-
tions reading from a file (read()), requesting more memory (mmap()),
creating network resources (socket()),
etc. are all examples of actions that require crossing into kernel mode.
Crossings can also occur if users
violate rules. For example, if a user tries to access a privileged memory
address (recall that part of a pro-