码迷,mamicode.com
首页 > 其他好文 > 详细

Real mode & Protected mode

时间:2018-12-07 11:47:04      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:ref   page   The   time   reference   mit   called   number   dos   

Real mode VS Protected Mode

1. A single selector value can only reference 64K of memory (the upper limit of the 16-bit offset). What if a program has more than 64K of code? A single value in CS can not be used for the entire execution of the program. The program must be split up into sections (called segments) less than 64K in size. When execution moves from one segment to another, the value of CS must be changed. Similar problems occur with large amounts of data and the DS register. This can be very awkward!
2. Each byte in memory does not have a unique segmented address. The physical address 04808 can be referenced by 047C:0048, 047D:0038, 047E:0028 or 047B:0058. This can complicate the comparison of segmented addresses

 

32-bit Protected Mode VS 16-bit Protected Mode
1. Offsets are expanded to be 32-bits. This allows an offset to range up to 4 billion. Thus, segments can have sizes up to 4 gigabytes.
2. Segments can be divided into smaller 4K-sized units called pages. The virtual memory system works with pages now instead of segments. This means that only parts of segment may be in memory at any one time. In 286 16-bit mode, either the entire segment is in memory or none of it is. This is not practical with the larger segments that 32-bit mode allows.


In real mode, a selector value is a paragraph number of physical memory.
In protected mode, a selector value is an index into a descriptor table.  
In both modes, programs are divided into segments.

In real mode, these segments are at fixed positions in physical memory and the selector value denotes the paragraph number of the beginning of the segment.
In protected mode, the segments are not at fixed positions in physical memory. In fact, they do not have to be in memory at all!

Reference

1. https://www.cnblogs.com/fatsheep9146/p/5116426.html

2. https://pdos.csail.mit.edu/6.828/2014/readings/pcasm-book.pdf

Real mode & Protected mode

标签:ref   page   The   time   reference   mit   called   number   dos   

原文地址:https://www.cnblogs.com/dirge/p/10080855.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!