Segmentation and paging are two ways to divide or map addresses.
The differences between the two are as follows:
A) The page is the physical unit of information, and the page is the discrete distribution method,To reduce the external zero header of the memory and improve the memory utilization; or,Pagination is only required by the system management, not by the user's needs (it is also transparent to the user ). A segment is the logical unit of information. It contains a set of relatively complete information (such as data segments, code segments, and stack segments ).The purpose of segmentation is to better meet user needs (users can also use it ).
B) The page size is fixed and determined by the system,The logic address is divided into two parts: the page number and the page address, which are implemented by the hardware of the machine,Therefore, a system can only have one page size. The length of the segment is not fixed, which is determined by the program you write,It is usually divided by the editing program based on the nature of the information when editing the source program.
C) The paging job address space is one dimension, that is, a single linear space,A programmer can express an address only by using a memory character (in hexadecimal notation of a linear address. The address space of a segmented job is two-dimensional. When a programmer identifies an address,Both the segment name (such as the Data Segment, code segment, and stack segment) and the intra-segment address are required.
D. Both pages and segments have a storage protection mechanism. However, the access permission is different: the segment has three permissions: read, write, and execution, while the page has only two permissions: read and write.