Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Operating systems

Chapter (1) Review questions

1. List and briefly define the four main elements of a computer.


Processor: Controls the operation of the computer and performs its data processing functions. When
there is only one processor, it is often referred to as the central processing unit (CPU).
Main memory: Stores data and programs. This memory is typically volatile; that is, when the computer
is shut down, the contents of the memory are lost. In contrast, the contents of disk memory are
retained even when the computer system is shut down. Main memory is also referred to as real
memory or primary memory.
I/O modules: Move data between the computer and its external environment. The external
environment consists of a variety of devices, including secondary memory devices (e.g., disks),
communications equipment, and terminals.
System bus: Provides for communication among processors, main memory, and I/O modules.

2. Define the two main categories of processor registers.


a memory address register (MAR), which specifies the address in memory for the next read or write.
a memory buffer register (MBR), which contains the data to be written into memory or which receives
the data read from 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

7. What is cache memory? (7e)


Cache memory is a memory that is smaller and faster than main memory and that
is interposed between the processor and main memory. The cache acts as a buffer
for recently used memory locations.

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)

9. What is the difference between a multiprocessor and a multicore system?


A multiprocessor A mode of operation that provides for parallel processing by two
or more processors.
A multicore computer (chip multiprocessor) combines two or more processors (cores) on a single piece
of silicone. Each core consists of all the components of an independent processor.

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.

2. What is the kernel of an OS?


The kernel is the portion of the operating system that includes the most heavily used portions of
software. Generally, the kernel is maintained permanently in main memory. The kernel runs in a
privileged mode and responds to calls from processes and interrupts from devices.

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.

5. How is the execution context of a process used by the OS?


• It is the internal data by which the OS is able to supervise and control the process
• Includes the contents of the various process registers
• Includes information such as the priority of the process and whether the process is waiting for the
completion of a particular I/O event

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.

8. What is time slicing? (9e)


A mode of operation in which two or more processes are assigned quanta of time on the same
processor.

9. Describe the round-robin scheduling technique.


A scheduling algorithm in which processes are activated in a fixed cyclic order; that is, all processes are
in a circular queue. A process that cannot proceed because it is waiting for some event (e.g., termination
of a child process or an input/output operation) returns control to the scheduler.

10. Explain the difference between a monolithic kernel and a microkernel.


A monolithic kernel is a large kernel containing virtually the complete operating system, including
scheduling, file system, device drivers, and memory management. All the functional components of the
kernel have access to all of its internal data structures and routines. Typically, a monolithic kernel is
implemented as a single process, with all elements sharing the same address space.
A microkernel is a small privileged operating system core that provides process scheduling, memory
management, and communication services and relies on other processes to perform some of the
functions traditionally associated with the operating system kernel.

11. What is multithreading?


Multithreading is a technique in which a process, executing an application, is divided into threads that
can run concurrently.

12. What do you understand by a distributed operating system?


• Provides the illusion of a single main memory space and a single secondary memory space plus other
unified access facilities, such as a distributed file system

• 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.

2. What common events lead to the creation of a process? (7e)


-New batch job
-Interactive Login
-Created by OS to provide a service
-Spawned by existing 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.

5. What does it mean to pre-empt a process?


Reclaiming a resource from a process before the process has finished using it.
6. What is swapping and what is its purpose? (7e). What is process spawning? (9e)
A process that interchanges the contents of an area of main storage with the contents of an area in
secondary memory.

7. Why does Figure 3.9b have two blocked states?

One blocked state is waiting it's turn and the other is blocked/suspended, meaning it's missing
resource and missing space in queue

8. List four characteristics of a suspended process.


1) the process is not immediately available for execution
2) the process may or may not be waiting on an event
3) The process was placed in a suspended state by an agent
4) the process may not be removed from this state until the agent explicitly orders the removal

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

11. What are the elements of a process image? (9e)

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.

Process Control Block


Data needed by the OS to control the process (see Table 3.5).

12. Why are two modes (user and kernel) needed?


User mode has restrictions on instructions that can be executed and memory areas that can
be accessed. This is to protect the OS from damage or alteration. In kernel mode, the OS
does not have these restrictions, so that it can perform its tasks.

13. What are the steps performed by an OS to create a new process?


• Assign unique process identifier to new process.
• Allocate space for the new process.
• Initialize the process control block.
• Set the appropriate linkages.
• Create or expand other data structures.

14. What is the difference between an interrupt and a trap?


An interrupt is due to some sort of event that is external to and independent of the currently running
process, such as the completion of an I/O operation.
A trap relates to an error or exception condition generated within the currently running process, such
as an illegal file access attempt.

15. Give three examples of an interrupt


• Clock interrupt
• I/O interrupt
• memory fault

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.

You might also like