MAPPING segments to PAGES

Source: Internet
Author: User

The segmentation and paging mechanisms provide in the support a wide variety of approaches to memory
Management. When segmentation and paging is combined, segments can be mapped to pages in several ways.
To implement a flat (unsegmented) addressing environment, for example, all the code, data, and stack modules
Can is mapped to one or more large segments (up to 4-gbytes) that share same range of linear addresses (see
Figure 3-2 in section 3.2.2). Here, segments is essentially invisible to applications and the Operating-system or
Executive. If paging is used, the paging mechanism can map a single linear-address space (contained in a single
Segment) into virtual memory. Alternatively, each program (or task) can has its own large linear-address space
(contained in it own segment), which is mapped to virtual memory through its own paging.
Segments can be smaller than the size of a page. If one of these segments is placed in a page which are not shared
With another segment, the extra memory is wasted. For example, a small data structure, such as a 1-byte semaphore,

Occupies 4 Kbytes If it is placed in a page by itself. If Many semaphores is used, it's more efficient to pack
them to a single page.
The Intel-64 and IA-32 architectures do not enforce correspondence between the boundaries of pages and
Segments. A page can contain the end of one segment and the beginning of another. Similarly, a segment can
Contain the end of one page and the beginning of another.
Memory-management Software May is simpler and more efficient if it enforces some alignment between page and
Segment boundaries. For example, if a segment which can fit in one page was placed in both pages, there may
Twice as much paging overhead to, access to, that segment.
One approach to combining paging and segmentation that simplifies memory-management software are to give
Each segment it own page table, as shown in Figure 4-13. This convention gives the segment a single entry in the
Page directory, and this entry provides the access control information for paging the entire segment.

In protected mode, the Intel IA-32 architectures provide a protection mechanism that operates at both the
Segment level and the page level. This protection mechanism provides the ability to limit access to certain
Segments or pages based on privilege levels (four privilege levels for segments and both privilege levels for pages).
For example, critical Operating-system code and data can is protected by placing them in more privileged
Segments than those that contain applications code. The processor ' s protection mechanism'll then prevent application

code from accessing the Operating-system code and data in any but a controlled, defined manner.
Segment and page protection can be used at all stages of software development to assist in localizing and detecting
Design problems and bugs. It can also is incorporated into End-products to offer added robustness to operating
Systems, utilities software, and applications software.
When the protection mechanism was used, each memory reference was checked to verify the IT satisfies various
Protection checks. All checks was made before the memory cycle is started; Any violation results in an exception.
Because checks is performed in parallel with address translation, there is no performance penalty. The protection
Checks that is performed fall into the following categories:
limit checks.
type checks.
privilege level checks.
restriction of addressable domain.
Restriction of Procedure entry-points.
Restriction of instruction set.
All protection violation results in an exception being generated. See Chapter 6, "Interrupt and Exception handling,"
For the explanation of the exception mechanism. This chapter describes the protection mechanism and the violations which leads to exceptions.
The following sections describe the protection mechanism available in protected mode. See Chapter 20, "8086
Emulation, "For information on protection in real-address and virtual-8086 mode.

MAPPING segments to PAGES

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.