Assignment 5 Os

Download as odt, pdf, or txt
Download as odt, pdf, or txt
You are on page 1of 11

Name:Amit Sharma

Enroll:190303105559
Div:CSE_3B8_B
ASSIGNMENT-5
OPERATING SYSTEM

Q-1: Multiple Choice Question

1. Increasing the RAM of a computer typically improves performance because.

A. Virtual memory increases


B. Larger RAMs are faster
C. Fewer page faults occur
D. Fewer segmentation faults occur

Answer:Fewer page faults occur

2. Virtual memory is
A. Large secondary memory
B. Large main memory
C. Illusion of large main memory
D. None of the above

Answer: Illusion of large main memory

3. A computer system supports 32-bit virtual addresses as well as 32-bit physical


addresses. Since the virtual address space is of the same size as the physical
address space, the operating system designers decide to get rid of the virtual
memory entirely. Which one of the following is true?

A. Efficient implementation of multi-user support is no longer possible


B. The processor cache organization can be made more efficient now
C. CPU scheduling can be made more efficient now
D. Hardware support for memory management is no longer needed

Answer: Hardware support for memory management is no longer needed

4. Page fault occurs when


A. When a requested page is in memory
B. When a requested page is not in memory
C. When a page is currupted
D. When an exception is thrown

Answer: When a requested page is not in memory


5. Consider a logical address space of 8 pages of 1024 words each, mapped onto a
physical memory of 32 frames. How many bits are there in the physical address and
logical address respectively?
A.5, 3
B.10, 10
C.15, 13
D.15, 15

Answer: 15,13

6. The character set used in Windows 2000 operating system is __________


A. 8 bit ASCII
B. Extended ASCII
C. 16 bit UNICODE
D. 12 bit UNICODE

Answer: 16 bit UNICODE

7. during operation a process creates data structure within the memory already
allocated to it by the kernel, this function is actually performed by the

A. Runtime library
B. Dynamic library
C. Static library
D. Load time library

Answer: Runtime library

8. virtual memory in memory hierarchy consists of

A. Caches and RAM


B. Caches and Disk
C. RAM and DISK
D. All of the above

Answer: RAM and DISK

9. which of the below factor considered the most in management of memory

A. Efficient use of memory


B. Speedy allocation of memory
C. Speedy deallocation of memory
D. All of the above

Answer: All of the above

10. Contiguous memory allocation is the classical memory allocation model in


which
A. Same process is allocated in a different area in the memory
B. All the process is allocated a single contiguous area in the memory.
C. Each process is allocated a single contiguous area in the memory.
D. All the above.
Answer: Each process is allocated a single contiguous area in the memory.

11.Contiguous memory allocation faces the problem of


A. Memory fragmentation
B. Page Faults
C. Less throughput
D. Less hit ratio

Answer: Memory fragmentation

12. The Technique of memory compaction and reuse of memory can be applied to
overcome the problem of
A. Internal fragmentation
B. External fragmentation
C. Page Faults
D. Swapping

Answer: External fragmentation

13. External fragmentation occurs when a


A. Memory area remain unused because it is too large to be allocated
B. Memory area remain unused because it is too small to be allocated
C. More memory is allocated than requested by the process
D. Less memory is allocated than requested by the process

Answer: More memory is allocated than requested by the process

14. Internal fragmentation occurs when a


A. Memory area remain unused because it is too large to be allocated
B. Memory area remain unused because it is too small to be allocated
C. More memory is allocated than requested by the process
D. Less memory is allocated than requested by the process

Answer: Less memory is allocated than requested by the process

15. The technique of memory compaction and reuse of memory can be applied to
overcome the problem of
A. Internal fragmentation
B. External fragmentation
C. Page Faults
D. Swapping

Answer: External fragmentation

16. Memory management technique in which system stores and retrieves data from
secondary storage for use in main memory is called
A. fragmentation
B. paging
C. mapping
D. none of the mentioned

Answer: paging

17.Consider a virtual memory system with FIFO page replacement policy. For an
arbitrary page access pattern, increasing the number of page frames in main
memory will?
A. Always decrease the number of page faults
B. Always increase the number of page faults
C. Sometimes increase the number of page faults
D. Never affect the number of page faults

Answer: Sometimes increase the number of page faults

18.What is the swap space in the disk used for?


A. Saving temporary html pages
B. Saving process data
C. Storing the super-block
D. Storing device drivers
Answer: Saving process data

19.The advantage of pages in paging is


A. no logical relation with program
B. no need of entire segment of task in physical memory
C. reduction of memory requirement for task
D. all of the mentioned
Answer: all of the mentioned

20.The size of the pages in the paging scheme is


A. variable
B. fixed
C. both variable and fixed
D. none
Answer: fixed

21.To convert linear addresses into physical addresses, the mechanism that the
paging unit uses is
A. linear conversion mechanism
B. one level table mechanism
C. physical conversion mechanism
D. two level table mechanism
Answer: two level table mechanism
Q-2 : Fill in the Blanks

1. ________memory allocation insures the overhead of memory allocation action


performed during operation of a process.

Answer: Dynamic

2. program always deal with __________.

Answer: Logical Address

3. The page table contains__________ in physical memory?

Answer: base address of each

4. With relocation and limit registers, each logical address must be _______ the limit
register.

Answer: Less than

5. In ,a program may be too big to fit into a partition, so the programmer must
design the program with the use of overlays so that only portion of the program needed to
be in main memory at any time.

Answer: Fixed partitioning

6.Memory compaction involves

Answer: Dynamic Relocation

7. Among all memory management techniques is simple to implement


little operating system overhead.

Answer: Fixed partitioning

8. For larger page tables, they are kept in main memory and a __________ points to the
page table.

Answer: Page table base register

9. For every process there is a __________

Answer: Page table


10. In segmentation, each address is specified by ____________

Answer: A name and length

11. A multilevel page table is preferred in comparison to a single level page table for

Answer: implemention of virtual address space of a process.


12.A memory buffer used to accommodate a speed differential is called ____________
Answer: Cache

13.Run time mapping from virtual to physical address is done by ____________

Ans: Memory management unit


14. Memory management technique in which system stores and retrieves data from
secondary storage for use in main memory is called?

Answer: paging
15.The address of a page table in memory is pointed by ____________

Ans: page table base register

Q-3: Short Questions:

1. what is memory hierarchy?

Keywords.The memory hierarchy system consists of all storage devices


contained in a computer system from the slow Auxiliary Memory to fast Main
Memory and to smaller Cache memory. ... When the program not residing in
main memory is needed by the CPU, they are brought in from auxiliary
memory.

2. what is compile time?

Keywords: Compile time refers to the time duration in which the programming
code is converted to the machine code (i.e binary code) and usually occurs
before runtime.

3. what is execution time?


Keywords: The execution time or CPU time of a given task is defined as the time spent
by the system executing that task, including the time spent executing run-time or system
services on its behalf.

4. What are the types of memory?

Keywords: Primary memory(RAM and ROM) and Secondary memory(hard


drive,CD,etc.).

5. CPU fetches the instruction from memory according the value of?

Keyword: Program Counter

6. Define Compaction.
Keyword: process in which the free space is collected in a large memory
chunk to make some space available for processes. 

7. State the main difference between logical from physical address space.

Keywords: Logical address is generated by CPU in perspective of a program.


On the other hand, the physical address is a location that exists in the
memory unit.

8. Define Memory-Management Unit (MMU)?

Keywords: computer hardware unit having all memory references passed through
itself, primarily performing the translation of virtual memory addresses to physical
addresses.

9. What is the difference between internal and external fragmentation when does it
occur?

Keywords: variable-sized block, fixed-sized block, Memory

10. Brief introduction about: TLB

Keywords: A translation lookaside buffer (TLB) is a memory cache that is


used to reduce the time taken to access a user memory location.

11. Define the following terms: Paging, Segmentation

Keywords: Paging is a storage mechanism used to retrieve processes from


the secondary storage into the main memory in the form of pages.
Segmentation is a virtual process that creates variable-sized address spaces
in computer storage for related data, called segments.

12. Explain Hardware implementation in the page table

Keywords: The hardware implementation of page table can be done by using


dedicated registers.
13. Explain memory protection.
Keywords: Memory protection is a way to control memory access rights on a
computer, and is a part of most modern instruction set architectures and
operating systems.
Q-4:Long Questions

1. Write about binding of instruction and data to memory.

Keywords: Classically, the binding of instructions and data to memory


addresses can be done at any step along the way: Compile time. The compiler
translates symbolic addresses to absolute addresses. If you know at compile
time where the process will reside in memory, then absolute code can be
generated (Static).

2. Difference between Static and Dynamic loading.

Keywords.Loading the entire program into the main memory before start of
the program execution is called as static loading. Loading the program into
the main memory on demand is called as dynamic loading. ... Program
execution will be faster. Program execution will be slower.

3. What is swapping.

Keyword: Swappingis a mechanism in which a process can be swapped


temporarily out of main memory (or move) to secondary storage (disk) and
make that memory available to other processes. At some later time, the
system swaps back the process from the secondary storage to main memory.

4. Difference between Fixed and Variable Partition.

Keywords: Implementing variable Partitioning is difficult as compared to


Fixed Partitioning as it involves allocation of memory during run-time rather
than during system configure. External Fragmentation: ... The empty space in
memory cannot be allocated as no spanning is allowed in contiguous
allocation.

5. How does external fragmentation occur?


Keywords: External fragmentation arises when free memory is separated into
small blocks and is interspersed by allocated memory. It is a weakness of
certain storage allocation algorithms, when they fail to order memory used by
programs efficiently.

6. Explain Internal Fragmentation.

Keywords: Internal Fragmentation occurs when a process needs more space


than the size of allotted memory block or use less space. External
Fragmentation occurs when a process is removed from the main memory.

7. How do you solve internal and external fragmentation?


Keywords: Internal Fragmentation occurs when a process needs more space
than the size of allotted memory block or use less space. External
Fragmentation occurs when a process is removed from the main memory.
Best Fit Block Search is the solution for internal fragmentation. Compaction
is the solution for external fragmentation.

8. Explain page Allocation.


Keywords: Demand page memory allocation is the technique in which pages
within a particular process or task are swapped in and out of main memory
from secondary memory as required for execution. ... Because pages of a
process can occupy non-contiguous frames positions, the OS needs to keep
track of where each page is stored.

9. Difference between: Paging and Segmentation.

Keywords: Paging is a memory management function that presents storage


locations to the CPU as additional memory. Segmentation is a virtual process
that creates variable-sized address spaces called segments.Paging and
segmentation are processes by which data is stored to, then retrieved from, a
computer's storage disk.

10. Explain in brief: Structure of Page Table


Keywords: Entry consists of the virtual address of the page stored in that real
memory location , with information about the process that owns that page.
Decreases memory needed to store each page table , but increases time needed to
search the table when a page reference occurs.

11.Explain Segmentation with pros and cons.


Keywords: Advantages of memory segmentation:
•Allow the memory capacity to be 1 MB even though the addresses associated with the
individual instructions are 16 bits wide.
•Allow the use of separate memory areas for the program code and data and stack
portion of the program.
•Permit a program and/or its data to be placed into different areas of memory
whenever the program is end.
•Multitasking becomes easy
Disadvantages of memory segmentation:

1. External fragmentation is present

2. Costly memory management algorithms.

3. Segmentation finds free memory area big enough.


4. Paging keep list of free pages.

5. Segments of unequal size not suited as well for swapping.

12. What is paging? How it is used? Explain with advantages and disadvantages.

Keywords: A computer can address more memory than the amount


physically installed on the system. This extra memory is actually called virtual
memory and it is a section of a hard that's set up to emulate the computer's
RAM. Paging technique plays an important role in implementing virtual
memory.

Paging is a memory management technique in which process address space is


broken into blocks of the same size called pages (size is power of 2, between 512
bytes and 8192 bytes). The size of the process is measured in the number of pages.

Advantages and Disadvantages of Paging


• Paging reduces external fragmentation, but still suffer from internal fragmentation.
• Paging is simple to implement and assumed as an efficient memory management
technique.
• Due to equal size of the pages and frames, swapping becomes very easy.

You might also like