Difference between virtual page and page frame?

2019-05-02 01:15发布

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?

4条回答
女痞
2楼-- · 2019-05-02 01:37

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.

Physical address = (page size * frame number) + page offset
The frame number was derived from the page table and the pages are added into the empty frames.

查看更多
Ridiculous、
3楼-- · 2019-05-02 01:38

Page frame is a physical property of the main memory. Whereas, virtual page is... virtual.

frame 0  frame 1  frame 2  frame 3  frame 4
----------------------------------------------
|        |        |        |        |        |
|        |        |        |        |        |
---------------------------------------------- Main Memory
查看更多
欢心
4楼-- · 2019-05-02 01:38

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]

查看更多
我命由我不由天
5楼-- · 2019-05-02 01:40

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.

查看更多
登录 后发表回答