Jinyuelong Junior member MATERIALS:Registration Date: Aug 2007 post: 25 excellent: 0 cash: 179 Kx thanks: 2 Thank-You articles: 0 Member appreciation count: 0 |
32010-10-13, 18:47:17Further Thoughts |
|
I thought about it again just now. The original Article in the book is: The Extended Direction and segment boundary of the Data Segment determine the valid range of the offset in the data segment. When the segment size is 1 MB at most, the offset from 0 to Limit is valid in the segment to be extended to the high-end, the offset from Limit + 1 to 1-1 is an invalid offset. The offset from 0 to Limit is an invalid offset in the extended segments to the lower end, the offset from Limit + 1 to 1s-1 is valid and valid. Pay attention to the validity of the address corresponding to the Boundary Value Limit. When the maximum CIDR block is 4 GB, the situation is similar. It can be seen that if a segment is expanded downward, all offsets must be greater than the limit length, because the limit length refers to the lower limit, and its base address starts from the high address. Otherwise, if a segment is expanded upwards, all offsets must be less than or equal to the limit length, because the limit length refers to the upper limit, and the base address starts from the lower address. By using segment wrap, you can define a downward extended segment to any linear address and to any size. I think the first layout should be correct, that is, when you expand down, the segment boundary should be BASE-Limit => 0x2000h-5 => 0x1ffbh. Read this sentence carefully: "As you can see, if a segment is expanded downward, all offsets must be greater than the limit length, because the limit length refers to the lower limit, and its base address starts from the high address. ", That is to say, for this downward extension segment, 0x1ffbh is indeed the lower limit, and any valid address must be greater than 0x1ffbh (I wonder why it is not greater than or equal to 0x1ffbh ). However, the valid region for Limit is Limit + 1 ~ I still don't understand this. My own conjecture is that base + negative numbers are used to access the extended segments, for example, base + (-1) => base-1 to access 0x1fffh, base-6 to access 0x1ffbh (again wondering why 0x1ffbh is not a valid address), and then regard the negative index as the unsigned number to determine whether it is in the Limit + 1 ~ 1-1, that is, the steps to determine whether one extension is effective for the following segments are: 1. Assume that there is a negative index X, and the address to be accessed is BASE + X. Note that X is negative, condition 1 is BASE + X> BASE-Limit (again wondering why 0x1ffbh is not a valid address ). 2. Regard negative number X as an unsigned integer, and then condition 2: (DWORD) X> Limit & (DWORD) X <= 1s-1 If both conditions 1 and 2 are met, the access is successful.The above is just a conjecture. I hope you will discuss it actively -_- In addition, the book "by using segment wrap, you can define the downward extension segment to any linear address and can be defined as any size ." Which of the following heroes can explain this question? |