Real mode & Protected mode

Posted dirge

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Real mode & Protected mode相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章

redis解决DENIED Redis is running in protected mode because protected mode is enabled

Redis 的 protected-mode

CentOS 7.6网卡绑定mode1

redis.conf详解之protected-mode

DENIED Redis is running in protected mode

DENIED Redis is running in protected mode报错解决办法