CS6400 Chapter 3 Questions with Detailed Verified Answers
What are the key roles of an operating system?
Ans: An operating system is the key mediator between applications and the system
hardware resources. It
provides common abstractions to differing hardware interfaces, such as "file" objects
for both hard disks
and solid state drives. It provides security via process isolation through virtual memory,
as well as by
restricting access to hardware resources. It enforces fairness among multiple,
potentially disjoint, users
and their processes by task scheduling algorithms.
Can you make distinction between OS abstractions
© Get it right 2025 Getaway - Stuvia US All rights reserved
,Click here for more: Scholars nexus
Ans: 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?
© Get it right 2025 Getaway - Stuvia US All rights reserved
,Click here for more: Scholars nexus
Ans: 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?
© Get it right 2025 Getaway - Stuvia US All rights reserved
, Click here for more: Scholars nexus
Ans: 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?
© Get it right 2025 Getaway - Stuvia US All rights reserved