Download Test1_soln

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Security-focused operating system wikipedia , lookup

Copland (operating system) wikipedia , lookup

CP/M wikipedia , lookup

RSTS/E wikipedia , lookup

VS/9 wikipedia , lookup

Spring (operating system) wikipedia , lookup

Burroughs MCP wikipedia , lookup

Unix security wikipedia , lookup

Distributed operating system wikipedia , lookup

DNIX wikipedia , lookup

Paging wikipedia , lookup

Thread (computing) wikipedia , lookup

Process management (computing) wikipedia , lookup

Transcript
Test 1
Operating Systems and Networking
Fall 2013
September 24, 2013
Hints and possible solutions
Answer only five questions from below
1. What are the three major objectives of a general-purpose multi-user, multi-taksing Operating
Systems? In what ways these may differ from users’ expectations of an OS?
Ans. The System objectives are:
● Provide an optimum individual execution environment to user and other processes
● Allow allocation and de-allocation of system resources to processes
● Ensure security for each process
Users’ expectations are:
● High throughput execution
● Minimum Turnaround time per process
2. What are real-time systems? In what ways ‘hard’ real-time systems are distinguished from ‘soft’
real-time systems? Rationalize the difference by an example.
Ans. Real-time systems are those which are deadline oriented. The difference between ‘hard’ and
‘soft’ real-time systems is predicated by the cost of missing process deadlines. For ‘hard’ real-time
tasks, this cost is very high compared to those designated as ‘soft’ real-time processes.
3. The architectures of operating systems are often pictured as a set of concentric rings. What is in
the dead middle of the rings? What do the rings normally suggest as one move progressively
from the center to the periphery? In relation to this, where does one find the applications?
Ans. At the center of the rings is the set of raw hardware. The rest of the system units (the software
) appears within the concentric ring segments. Farther a segment is less security protection its
components enjoy from the system. The applications are all at the outer ring.
4. Why an OS is often depicted as an interrupt-driven system or event-based system? What is the
difference between an interrupt and preemption?
Ans. If an OS has nothing to do, no event is scheduled to happen; it lies dormant as if in ‘sleep’. Only
when it is awakened by a system call, or an event ‘happens’ it gets into work. In other words, an
interrupt or an event schedule changes it from a ‘non-active state’ to an active ‘running’ state. An
‘interrupt’ is a system generated event caused by a hardware malfunction or error. A preemption is a
process where a high priority process upon arriving into the ready queue claims the CPU ejecting the
current occupant who then returns to the CPU queue.
5. In a modern computer system all kinds of memory coexist and they are usually categorized via a
memory hierarchy structure. Describe a typical memory hierarchy layout. What characteristics
distinguish the various elements of a memory hierarchy?
Ans. The hierarchical layout generally comprises registers, cache, main memory (RAM),
secondary memory, and archival memory in that order from the top. In special cases, some of
the components may disappear as in diskless workstations. The characteristic issues are: unit
memory cost (highest for registers, lowest for archival), memory access time (fastest for
registers, slowest for archival), and volume of memory
6. What is the purpose of a system call? How do the system calls relate to the underlying operating
system and to the concept of dual-mode (kernel-mode and user-mode) operations?
Ans. The purpose of a system call issued by a process is to get something done by the OS, which
it cannot do. This makes the environment abstraction split into two modes: User mode (with user
having the control and the CPU), and the Kernel mode (with the kernel having the control and
the CPU). System call is expensive, but if it cannot be carried out in the user mode because user
lacks authority to execute it, it would be done by the system in the kernel mode, and user would
be notified of it after system control passes to it.
7. What is a process? How does it differ from a program associated with it? What are its possible
states? What would be the rationale for a suspended state? How does a process might enter a
suspended state?
Ans. A process is a program in execution. A program can have multiple copies in the disk, but
only one execution image in the RAM per execution event. The possible states of a process are:
New, Ready, Running, Blocked, Suspended, and Exit. A process may be suspended because
a. It is forced by the user to enter into the suspended state
b. It is taking a large resource load of (RAM×Residence time) per unit of goodput, and
MMU enforces its suspension to get more throughput.
A process enters either from (a) blocked state (normal), or from (b) running state via user
interaction issuing, say, a CTRL=Z.
8. Explain why the following assertions made with reference to ULTs are valid.
a. ULTs are cheaper to create and run than processes.
b. Communication overhead between two ULTs is much smaller than between
processes.
c. ULTs are transparent to Kernel.
Ans. (a) ULTs pertain to a single process, and therefore they share the same address space.
Consequently, the overhead to create these threads is minimal requiring shorter TCB blocks (in
lieu of larger PCB blocks) and shorter context-switch time. These in turn enforce smaller
overhead to run a thread than running child processes.
(b) Since ULTs share the same address space, they communicate with each other via shared
memory. Therefore, overhead for thread synchronization is minimal.
(c) Kernel only knows a process, and it has no notion of a process being organized as a bunch of
threads, That level of abstraction is valid only at the user level, not at the kernel level.
9. Explain why the following assertions about the KLTs are valid.
a. KLTs are slower than ULTs.
b. KLTs are expensive and not portable.
c.
KLTs are expected to handle system-wide resource allocation and scheduling issues.
Ans. (a) A KLT is usually assigned to work with a LWP (Light Weight Process) anchor point that
handles mapping of several bunch of ULTs from different sets of processes including some
specific kernel routines that handles various checks and balances. Thus, a KLT from a specific
user reference point is slower than a ULT.
(b) KLTs collectively comprise the a specific OS environment, and therefore, they are not portable
unless one finds the same OS host machine. KLTs are to be managed as resources of OS, and
therefore, OS needs to find extra time (and security) to take care of each.
(c) Scheduling and allocation of resources require a global system vision of who is doing what
and when. This global view is impossible to have at a local process level, and therefore, a process
(and its ULTs) cannot be trusted to handle such issues. Since they must be done, KLTs take over
their functions and responsibilities.
[Bonus] True, or False! Each correct answer would earn 3 points.
A. Poor CPU ultilization may imply thrashing when its CPU queue has a large number of
threads or processes queued. T.
B.
C.
D.
E.
Time lost in context switching is purely overhead. T.
PCB block of a process could be retrieved if lost. F.
A process may be blocked if interrupted by a high-priority process. F.
Same data will often populate L1 and L2 caches in multicore systems to eliminate
frequent bus access. F.