Open - Ended Questions Flashcards
Explain the difference between physical and logical address space.
Logical Address
Basic - Generated by CPU
Address Space - Is set of all logical addresses generated by CPU in reference to a program
Visibility - Users can view the address
Generation - Generated by the CPU
Access - The user can use it to access the physical address
Editable - Can be changed
Physical Address
Basic - Location in a memory unit
Address Space - Is set of all physical addresses mapped to the corresponding logical addresses
Visibility - Users can never view the address
Generation - Computed by MMU
Access - The user can indirectly access physical address, but not directly
Editable - Will not change
Explain Paging:
- Paging is a memory management scheme that eliminates the need for a contiguous allocation of physical memory.
- The process of retrieving processes in the form of pages from the secondary storage into the main memory is known as paging.
- The basic purpose of paging is to separate each procedure into pages.
- In paging, the physical memory is divided into fixed-size blocks called page frames, which are the same size as the pages used by the process.
Explain Shared pages:
Shared pages in operating systems save memory, speed up communication, and boost performance by letting processes access the same data without copying. However, they can be security risks and require careful management to avoid conflicts between processes.
Explain Swapping:
Swapping is bringing a process into memory and then temporarily copying it to the disc after it has run for a while. The purpose of swapping in an operating system is to access data on a hard disc and move it to RAM so that application programs can use it.
Explain Fragmentation:
The process of dividing a computer file, such as a data file or an executable program file, into fragments that are stored in different parts of a computer’s storage medium, such as its hard disc or RAM, is known as fragmentation in computing.
An unwanted problem with operating systems is fragmentation, which occurs when processes load and unload from memory and divide available memory. Because memory blocks are so small, they cannot be assigned to processes, and thus remain idle. It’s also important to realize that programs create free space or holes in memory when they are loaded and unloaded.
Explain the steps involved in translating a virtual address to a physical address in a paged virtual memory system.
Splitting the virtual address: Divide it into virtual page number (VPN) and page offset.
Looking up the VPN: Check the Translation Lookaside Buffer (TLB) first (faster cache). If not found there (TLB miss), consult the page table.
Validating the page: Ensure the page exists in memory (valid bit in page table).
Building the physical address: If valid, combine the retrieved physical frame number with the page offset to get the final physical address.
Handling a page fault: If the page is missing (invalid bit), a page fault occurs, triggering the OS to load the page from disk and retry the translation.
Discuss the role of the page table in virtual memory management.
The page table is the key component translating virtual addresses (used by programs) to physical addresses (understood by hardware) in virtual memory.
It acts as a dictionary:
- Mapping: It holds entries that map virtual page numbers to physical memory frames.
- Protection: It can control access by specifying read/write/execute permissions for each page.
- Efficiency: Multi-level tables manage large address spaces while keeping the main table compact.
- Demand Paging: It helps with demand paging by revealing where to find pages on disk if they’re not in memory (causing a page fault).
Overall, the page table is the translator and rulebook for virtual memory management.