Module 5 - Memory management, files and file systems Flashcards

1
Q

When creating a new process the operating system must allocate memory for two structures, name and explain the purpose of these structures.

A

The process control block (PCB) is a data
structure in the operating system kernel
containing the information needed to
manage a particular process.

Process image is an executable file required while executing the program. This image usually contains the following sections −

Stack: Temporary data such as function
parameters, local variables and return
addresses.

The stack grows from high addresses
towards lower address.

Heap: Heap: Dynamically allocated (malloc) by the program during runtime.

The heap grows from low addresses
towards higher addresses.

Data: Statically (known at compile time)
global variables and data structures.

Text: The program executable machine
instructions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain what is meant by memory compactation.

A

Move all processes to one end of the address space producing one
large hole at the other end of the address space.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain the purpose of logical memory addresses and how logical memory addresses relates to physical memory addresses.

A

A logical address is the address at which a memory cell appears to reside from the perspective of an executing application program.

In general the compiler cannot know where a loaded process will be placed in memory.

That’s why the compiler produces logical memory addresses.

The physical address is accessed through the corresponding logical address because a user cannot directly access the physical address. For running a computer program, it requires a physical memory space. Therefore, the logical address has to be mapped with the physical address before the execution of the program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain why compaction cannot be done without introducing logical memory.

A

???

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the meant by external fragmentation?

A

External fragmentation: total memory space exists to satisfy a request, but it is not contiguous.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the acronym MMU stand for and what is the purpose of the MMU?

A

MMU - Memory Management Unit.

The MMU is a computer hardware unit
having all memory references passed
through itself, primarily performing the
translation of logical memory addresses to physical addresses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

open the module-5.pdf, question 8 a) Explain the purpose of the relocation registers.

A

The value in the relocation register is added to every memory address, automatically, to translate logical to physical adresses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

open the module-5.pdf, question 8 b) What problems could occur if the check against the limit register was omitted?

A

If logical address < limit register was omitted then we would overstep “downwards” into another process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the purpose of virtual memory?

A

Virtual memory provides an idealized
abstraction of the physical memory which
creates the illusion of a larger virtual
memory than the physical memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How is a virtual memory address space similar to a logical address space and how are they different?

A

A virtual memory address space and a logical address space are similar in that they both provide an abstraction layer between the physical memory (RAM) and the program executing on the CPU. They both allow programs to access memory in a way that simplifies memory management and provides a uniform interface to the underlying hardware.

Similarities:

Abstraction: Both virtual memory address space and logical address space provide an abstraction of memory, hiding the physical details of memory management from the program.

Decoupling: Both allow the program to operate independently of the actual physical memory layout, providing flexibility and ease of programming.

Differences:

Memory Mapping: In virtual memory, the mapping between virtual addresses and physical addresses is managed by the operating system, often using techniques like paging or segmentation. In contrast, logical address space typically refers to the memory addresses as seen by the program itself, without consideration for the actual physical memory mapping.

Size and Range: Virtual memory address space can be much larger than physical memory since it includes both physical RAM and secondary storage (like a hard drive or SSD) that can be used as an extension of RAM through techniques like paging or swapping. Logical address space, on the other hand, typically refers to the memory addresses within the program’s own address space, which may or may not match the actual physical memory available.

In summary, while virtual memory address space and logical address space share some commonalities in terms of providing abstractions for memory access, they serve different purposes and operate at different levels of the memory hierarchy. Virtual memory is a system-level concept managed by the operating system, while logical address space is a program-level abstraction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What problem with contiguous memory allocation is solved by introducing a page table?

A

Contiguous memory allocation suffers from fragmentation issues, where free memory is broken up into small, non-contiguous blocks, making it challenging to allocate larger blocks of contiguous memory. This fragmentation can lead to inefficient memory usage and allocation problems.

Introducing a page table solves this problem by allowing the operating system to map non-contiguous physical memory addresses to contiguous virtual memory addresses. This mapping is done in fixed-size blocks called pages. Each process has its own page table, which keeps track of the virtual-to-physical address mappings.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How are pages and frames similar? How are they different?

A

Similarities:

Fixed Size: Both pages and frames are fixed-size blocks of memory. The size is typically determined by the system and is a power of 2, such as 4 KB or 8 KB.

Used for Address Translation: Both pages and frames are used for address translation.

Differences:

Purpose: Pages are used for logical address translation in virtual memory systems, enabling processes to access memory addresses that are not necessarily contiguous or located in physical memory. Frames, on the other hand, represent physical memory blocks directly accessible by the CPU and are managed by the operating system for processes’ use.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the purpose of the page table?

A

We use a page table to map a logical page
number to an empty physical frame.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly