Sistemas Operativos, Manejo de la memoria 5 Paginación parte 1
Memory Management in Operating Systems
In this section, the discussion revolves around memory management in operating systems, specifically focusing on the concept of paging and its implementation.
Introduction to Paging
- Physical memory is divided into blocks of equal size called frames, typically powers of 2 like 512 (2^9) or 8192 (2^13).
- Processes are also divided into blocks of the same size as frames, known as pages. Pages are loaded into available frames.
Fragmentation and Page Tables
- The logical address space of a process does not need to be contiguous. Pages of processes are loaded into available frames.
- To execute a program with n pages, free frames are needed for loading. Page tables translate logical addresses to physical addresses.
Internal Fragmentation
- Internal fragmentation occurs when a page is not fully utilized by a process due to page size exceeding process requirements.
- Example scenario: A process requiring four pages may lead to internal fragmentation if not all parts of the last page are used.
Page Tables and Address Translation
- Page tables map page numbers to frame numbers for each process, facilitating address translation from logical to physical addresses.
- Each entry in a page table contains the frame number corresponding to a specific page number for efficient address resolution.
Logical Addressing with Paging
- Logical addresses consist of a page number and an offset within that page. The offset determines the byte location within the page being accessed.
- Address translation involves using the page number as an index in the page table to find the corresponding frame number for constructing physical addresses.
Understanding Page Table Indexing
In this section, the speaker explains the structure of page table indexing in a computer system.
Page Table Structure
- The 4 bits represent the page number, while the 12 bits signify the offset.
- This choice of 12 bits is due to the page size being 4096 bytes (2^12).