Operating Systems Chapter (1) Review Questions: Memory or Primary Memory
Operating Systems Chapter (1) Review Questions: Memory or Primary Memory
Operating Systems Chapter (1) Review Questions: Memory or Primary Memory
3. In general terms, what are the four distinct actions that a machine instruction can specify?
These actions fall into four categories:
Processor-memory: Data may be transferred from processor to memory or from memory to processor.
Processor-I/O: Data may be transferred to or from a peripheral device by transferring between the
processor and an I/O module.
Data processing: The processor may perform some arithmetic or logic operation on data.
Control: An instruction may specify that the sequence of execution be altered.
4. What is an interrupt?
An interrupt is a mechanism by which other modules (I/O, memory) may interrupt the
normal sequencing of the processor.
5. How are multiple interrupts dealt with? (7e) How can multiple interrupts be serviced by
setting priorities? (9e)
Two approaches can be taken to dealing with multiple interrupts. The first is to disable interrupts while
an interrupt is being processed. A second approach is to define priorities for interrupts and to allow an
interrupt of higher priority to cause a lower-priority interrupt handler to be interrupted.
6. What characteristics are observed while going up the memory hierarchy? (9e)
What characteristics distinguish the various elements of a memory hierarchy? (7e)
a. Decreasing cost per bit
b. Increasing capacity
c. Increasing access time
d. Decreasing frequency of access to the memory by the processor
8. What are the trade-offs that determine the size of the cache memory? (9e)
An increase in block size results in a higher hit ratio as more words are referenced in the block.
However, as the block becomes too big, the hit ratio will begin to decrease and the probability of using
newly fetched data becomes smaller than the probability of reusing data that has been moved out of
the cache to make room for the block.
(We are faced with a trade-off among speed and cost)
10. What is the distinction between spatial locality and temporal locality?
Spatial locality refers to the tendency of execution to involve a number of
memory locations that are clustered. (
Temporal locality refers to the tendency for a processor to access memory locations
that have been used recently.
11. In general, what are the strategies for exploiting spatial locality and temporal locality?
Spatial locality is exploited using larger cache blocks and prefetching. Temporal locality is exploited by
keeping recently used instructions and data values in the cache memory, and by exploiting cache
hierarchy.
Chapter (2) Review questions
1. What are three objectives of an OS design?
An OS is a program that controls the execution of application programs and acts as an interface
between applications and the computer hardware. It can be thought of as having three objectives:
-Convenience: An OS makes a computer more convenient to use.
-Efficiency: An OS allows the computer system resources to be used in an efficient manner.
-Ability to evolve: An OS should be constructed in such a way as to permit the effective development,
testing, and introduction of new system functions without interfering with service.
3. What is multiprogramming?
Multiprogramming or multitasking is a mode of operation that provides for the interleaved execution
of two or more computer programs by a single processor.
4. What is a process?
A process or task is a program in execution. A process is controlled and scheduled by the operating
system.
6. List and briefly explain five storage management responsibilities of a typical OS.
-Process isolation: The OS must prevent independent processes from interfering with each other's
memory, both data and instructions.
-Automatic allocation and management: Programs should be dynamically allocated across the
memory hierarchy as required. Allocation should be transparent to the programmer. Thus, the
programmer is relieved of concerns relating to memory limitations, and the OS can achieve efficiency
by assigning memory to jobs only as needed.
-Support of modular programming: Programmers should be able to define program modules, and to
create, destroy, and alter the size of modules dynamically.
-Protection and access control: Sharing of memory, at any level of the memory hierarchy, creates the
potential for one program to address the memory space of another. This is desirable when sharing is
needed by particular applications. At other times, it threatens the integrity of programs and even of
the OS itself. The OS must allow portions of memory to be accessible in various ways by various users.
-Long-term storage: Many application programs require means for storing information for extended.
7. Explain the distinction between a real address and a virtual address. (7e)
A real address is the physical address in main memory. Whereas a virtual address is the address of a
storage location in virtual memory.
• State of the art for distributed operating systems lags that of uniprocessor and SMP operating
systems
13. List the key design issues for an SMP operating system. (9e)
• Simultaneous concurrent
• processes or threads
• Scheduling
• Synchronization
• Memory management
• Reliability and fault tolerance
Chapter (3) Review questions
1. What is an instruction trace?
A list of the sequence of instructions that are executed by an individual process.
3. Explain the concept of a process and mark its differences from a program. (9e)
A process is an instance of a program being executed.
A program is a passive entity whereas a process is an active entity.
4. For the Five-State processing model of Figure 3.6, briefly define each state.
New: Process that has just been created but has not yet been admitted to the pool of executable
processes by the OS.
Ready: Processes prepared to execute when given opportunity.
Running: Process currently being executed.
Blocked: Process that cannot execute until some event occurs e.g., completion of I/O
operation.
Exit: Process released from pool of executable processes by OS, either because it halted or because it
aborted for some reason.
One blocked state is waiting it's turn and the other is blocked/suspended, meaning it's missing
resource and missing space in queue
9. For what types of entities does the OS maintain tables of information for management
purposes?
The OS maintains tables for entities related to:
-Memory tables: keep track of real and virtual memory
-I/O tables: used by OS to manage I/O devices and channels of the computer system
-File tables: provide information about
the existence of files, their location on secondary memory, their current status, and
other attributes.
-Process tables: manage processes.
10. List three general categories of information in a process control block. (7e)
• Process identification
• process state information
• process control information
User Data
The modifiable part of the user space. May include program data, a user stack area, and
programs that may be modified.
User Program
The program to be executed.
Stack
Each process has one or more last-in-first-out (LIFO) stacks associated with it. A stack is
used to store parameters and calling addresses for procedure and system calls.
16. What is the difference between a mode switch and a process switch?
A mode switch A hardware operation that occurs that causes the processor to execute
in a different mode (kernel or process).
A process switch An operation that switches the processor from one process to
another by saving all the process control block, registers, and other information
for the first and replacing them with the process information for the second.