From what I understand pages come from overlays which are clusters of memory spaces generated by Virtual Memory. But I don't understand what frames are or how they relate.
Can anyone explain what page and frame is and how it works?
From what I understand pages come from overlays which are clusters of memory spaces generated by Virtual Memory. But I don't understand what frames are or how they relate.
Can anyone explain what page and frame is and how it works?
Firstly, paging is a memory management scheme. Physical memory can be divided into frames and logical memory into pages. Pages are also called virtual pages and frames are referred to as page frames. All memory chunks in physical address space are identified with frame numbers and logical address with page numbers.
The page table consists of page number with its corresponding offset.
The frame number was derived from the page table and the pages are added into the empty frames.Page frame is a physical property of the main memory. Whereas, virtual page is... virtual.
According to SILBERSCHATZ et, al. "The basic method for implementing paging involves breaking physical memory into fixed-sized blocks called frames and breaking logical memory into blocks of the same size called pages." [OS concepts 9th ed]
Physical memory is organized into PAGE FRAMES. The size of a page frame is a power of 2 in bytes and varies among systems.
Logical memory is organized into PAGES. The size of page matches a page frame.
A logical address is divided into a page selector and an offset into the page.
Logical pages are mapped to page frames using page tables. The structure of a page table varies among systems. The pages selector of a logical address serves as an index into a page table.
In most systems, the page tables can specify valid logical addresses that have no associated page frame. This is a virtual memory system. If an application attempt to access such a page, it triggers a page fault exception. The operating system page fault handler must allocate a physical page frame, load the page frame using data from secondary storage, update the page table to map the logical page to the newly allocated physical page frame, and finally restart the instruction that caused the fault.
The operating system manages the page tables. The CPU (transparently to the application) translates logical page frames into physical page frames using the page table.