You are on page 1of 4

COP 4600 Exam 1

In a multiprogramming system the main memory is not generally


occupied simultaneously by multiple processes. - ANS False

A hardware mechanism is needed for translating virtual addresses to physical main memory
addresses at the time of execution of the
instruction that contains the reference. - ANS True

A physical address is the location of a word relative to the beginning of the program and the
processor translates that into a virtual address. - ANS False

All segments of all processes must be of the same length. - ANS False

It is impossible to have both paging and segmentation in the same system. - ANS False

What is the difference between a virtual address and a physical address? - ANS VA is an
address in a logical space (an address in an illusion) while the physical address is an address in
the actual physical memory.

Which of the following instructions should be privileged?


i. Read the clock
ii. Set value of timer
iii. Turn off interrupts
iv. Switch from user to kernel mode
v. Clear memory - ANS ii. Set value of timer
iii. Turn off interrupts
iv. Switch from user to kernel mode
v. Clear memory

Give an example of a preemptive scheduling algorithm. - ANS STCF/SRTF and Round Robin

A memory system that uses paging is vulnerable to external fragmentation. Why or why not? -
ANS False. There is no external fragmentation in a paging system because there is no space
left outside a page/frame.

Of the following items, which are stored in the process control block?
i. Page table pointer
ii. Page table
iii. Stack pointer
iv. Segment table
v. List of processes in the ready state
vi. The content of CPU registers
vii. Program counter - ANS i. Page table pointer
iii. Stack pointer
vi. The content of CPU registers
vii. Program counter

In a typical modern OS, which of the following statements are true about user applications and
the kernel?
1. The kernel runs at privileged level.
2. Applications run at privileged level.
3. Applications may directly invoke any function calls in the kernel.
4. The kernel frequently relinquishes control and must depend on the user application to allow it
to regain control. - ANS 1. The kernel runs at privileged level.

Which of the following instructions should be protected, i.e., can execute only when the
processor is running in kernel mode?
1. MOV cr3, src; (move the value in src to control register CR3. CR3 contains the physical
address of the base of the page table).
2. TR AP; (jump to kernel's syscall dispatcher with kernel privilege)
3. ADD; (add numbers)
4. JMP; (jump to a different instruction)
5. INB (contact I/O device). - ANS 1. MOV cr3, src; (move the value in src to control register
CR3. CR3 contains the physical address of the base of the page table).
5. INB (contact I/O device).

Which of the following are elements of a typical process descriptor? (Recall that a process
descriptor or process control block is the per-process state kept by the kernel.)
1. Process state (blocked/runnable)
2. Address space
3. The state of the CPU registers
4. Process ID - ANS 1. Process state (blocked/runnable)
3. The state of the CPU registers
4. Process ID

Which of the following statements are true about processes?


1. Any process can access any other process's memory by default.
2. Timer interrupts are generally required for a kernel to correctly isolate processes.
3. The kernel must run one process to completion before it starts another process.
4. A user-level process can crash the kernel if not programmed carefully. - ANS 2. Timer
interrupts are generally required for a kernel to correctly isolate processes.
Which of the following statements are true when the kernel switches execution from the current
process to another process?
1. The kernel must save the register values (including IP (Instruction Pointer), SP (stack pointer)
etc.) of the current process to memory.
2. The kernel must save the content of the current process' memory on disk.
3. The kernel must close all the files opened by the current process.
4. The kernel must make the page table of the next process active.
5. The kernel must reset the virtual address space of the current process. - ANS 1. The kernel
must save the register values (including IP (Instruction Pointer), SP (stack pointer) etc.) of the
current process to memory.
4. The kernel must make the page table of the next process active.

Which of the following are true about memory virtualization:


1. In a multiprogramming system the main memory is generally shared among a number of
processes.
2. A hardware mechanism is needed for translating
virtual addresses to physical main memory addresses at the time of execution of the instruction
that contains the reference.
3. In a modern multiprogramming environment the programmer knows at the time of coding how
much space will be available and where that space will be.
4. A physical address is the location of a word relative to the beginning of the program and the
processor translates that into a logical address.
5. A multiprogramming system is one that supports calling code written in different programming
languages (e.g., calling assembly code from C). - ANS 1. In a multiprogramming system the
main memory is generally shared among a number of processes.
2. A hardware mechanism is needed for translating
virtual addresses to physical main memory addresses at the time of execution of the instruction
that contains the reference.

Which of the following are true about memory


systems based on segmentation or paging:
1. The placement policy determines where in real memory a process piece is to reside.
2. The smaller the page size, the greater the amount of internal
fragmentation.
3. Segmentation does not eliminate external fragmentation.
4. All segments of all programs must be of the same length.
5. It is impossible to have both paging and segmentation in the same system. - ANS 1. The
placement policy determines where in real memory a process piece is to reside.
3. Segmentation does not eliminate external fragmentation.

Which of the following are true about memory systems based on


dynamic relocation, segmentation or paging:
1. In order to support Dynamic Relocation, the number of Base and Bound registers available
on the CPU must be at least twice the maximum number of processes that can be stored in
memory at any time.
2. The smaller the page size, the greater the amount of external
fragmentation.
3. Segmentation does not eliminate external fragmentation.
4. All segments of all programs must be of the same length.
5. In a system with paging, there is only one page table
at any time. - ANS 3. Segmentation does not eliminate external fragmentation.

You might also like