OS Topic 12 - Memory management Flashcards
A modern personal computer’s OS supports multiple processes, each of which demands its own allocation of memory for p________ i___________ and for d__________.
program instructions and for data
The operating system must manage how memory is allocated among many p_________.
processes
The part of the operating system responsible for carrying out memory management is the ‘m_________ m___________ m__________’.
memory management module
There are four important issues that the OS memory management module must deal with;
- A____________ memory
- R___________
- P___________
- L_________ memory size
allocating memory
relocation
protection
limited memory size
Allocating Memory
The memory management module
must manage memory by allocating it among m_________ p___________
multiple processes
Relocation
The memory management module must be able to relocate programs so they can be loaded wherever there is f_____ s_______ available.
free space
Protection
The memory management module must enforce the s_____________ of one process’s memory from another.
Why?
separation
This is a security risk: malicious software in one process could obtain sensitive data from another process. There is also a risk that a program that contains bugs could inadvertently write to memory belonging to another process.
Limited Memory Size
The memory management module must be able to manage more programs than will fit into main memory by using s__________ storage.
secondary storage
Virtual memory
Memory management module Vs memory management unit.
Match the definitions:
- A memory management module is: _____
- A memory management unit is: _____
a) A functional block in the processor
b) A software module in the operating
system
1b
2a
Virtual memory
A Memory Management Unit (MMU) is a h__________ component in a computer’s p_________ that handles the translation of v_________ addresses used by software into p________ addresses in the computer’s memory.
hardware component
processor
virtual
physical
Virtual memory
When a program is loaded into memory, it uses v_________ addresses, which are addresses that might not directly correspond to the physical location in memory. The MMU steps in and translates these virtual addresses into the actual p_______ addresses in the computer’s memory.
virtual
physical
Virtual memory
Virtual addresses are used by the program during its e__________, while physical addresses represent the actual locations in the physical memory h__________. The MMU ensures that the correct m_________ between virtual and physical addresses is maintained.
execution
hardware
mapping
Virtual memory
Systems like this which translate logical addresses used by programs into different physical addresses are called v________ m_________ s________
virtual memory systems
Recap - Registers
What is a register?
A register is a small, fast storage location within the CPU (Central Processing Unit) that is used to store data t____________ during the execution of a program.
temporarily
Recap - Registers
Here are three common types of register, there are many more, though.
- D_______ R_________
- A_________ R_________
- P___________ C__________
- Data Registers
- Address Registers
- Program Counter (PC)
Recap - Registers
Match the tasks to the correct registers.
a) Keeps track of the address of the next
instruction to be fetched and executed.
b) Used to store data operands for
arithmetic and logic operations.
c) Hold memory addresses or pointers.
- Data Registers
- Address Registers
- Program Counter
1b
2c
3a
Virtual memory - definition
What is an operand?
An operand is a term used to describe the data on which a mathematical or logical operation is performed on.
e.g. ADD A, B
What are the operands in this code?
A, B
Virtual Memory
True or false?
A logical address is the same thing as a virtual address.
true
Virtual Memory
Why use virtual addresses instead of physical addresses?
Virtual memory provides the illusion of a dedicated and contiguous address space for each p___________, while efficiently sharing the physical memory among multiple processes.
process
Virtual Memory
A processor with two special-purpose registers – a base register and a length register – provides a simple m_______ of implementing a virtual memory system.
method
Base and length registers
The base register contains the amount to be added to every logical address. If it contains 4000 (to continue the example above), then a logical address of 123 is translated to a physical address of ________
4123
Base and length registers
When discussing addresses we must note that one address typically corresponds to one b________ of data.
A process may require several a_________ as it may have many bytes of data.
The addressing s_______ of a process is the range of addresses that the process can use.
byte
addresses
space
Base and length registers
The length register contains the h________ logical address required by the process.
Highest Logical Address: The value stored in the length register represents the highest or maximum logical address that the process may need during its execution.
highest