当前位置:网站首页>Sub paragraph of Chapter 16

Sub paragraph of Chapter 16

2022-06-13 04:56:00 CCSUZB

If we put the entire address space into physical memory , So the space between stack and heap is not
Not used by the process , But it still occupies the actual physical memory .

16.1 piecewise : Generalized base address / boundaries

The segmentation mechanism enables the operating system to put different segments into different physical memory areas , Thus, the unused part of the virtual address space is avoided to occupy the physical memory

Add : Segment error
Segment error refers to an illegal memory access on a machine that supports segmentation . Interestingly , Even on machines that do not support segmentation, the term remains . But if you can't figure out why the code keeps making mistakes , It's not that interesting

16.2 Which paragraph do we quote

The hardware uses segment registers for address translation . How does it know the offset within the segment , And which segment the address refers to ?

So in our example , If the first two are 00, The hardware knows that this is the address of the code segment , So use the base and bounds of the code segment to relocate to the correct physical address . If the first two are 01, Is the heap address , Correspondingly , Use the base and bounds of the heap .

16.3 What about the stack

After the hardware understanding segment can grow in reverse , The address translation of this virtual address must be a little different

16.4 Support sharing

To support sharing , Need some additional hardware support , This is the protection bit (protection bit) . Basically, several bits are added to each segment , Identify whether the program can read and write this segment , Or execute the code .

原网站

版权声明
本文为[CCSUZB]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202280518034344.html