Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

The QNX Operating System


September 1991/The QNX Operating System/Sidebar

Real Mode vs. Protected Mode Operation


This sidebar describes the difference between real mode and protected mode operation of the Intel family of 80x86 microprocessors.

MS-DOS and PC-DOS were written for the Intel 8088/6 microprocessor which runs in what is termed "real" mode. What this means is that the memory locations which are referenced by the segment registers of the processor are actual (real) physical locations in the computer's memory. Since a programmer is free to load anything he wants into these segment registers, any program that runs in real mode can access all the available memory of the computer — including the memory that is reserved for the operating system. This means that if you want to (most often when you don't want to) you can easily overwrite part of the operating system. Every C and assembly language programmer that has worked in the MS-DOS or PC-DOS environment has done this (more times that he/she will admit to) and has had to resort to the use of the big red switch as one of their debugging tools.

The 80286, 80386 and 80486 microprocessors can run in real mode to maintain backward compatibility with the 8088/6. However, these processors can also run in what Intel decided to call "protected" mode. In protected mode, the values loaded into the segment registers of the processor are not real addresses. They are selectors. Selectors are references into a table that contains the actual physical memory addresses of allocated segments, their length and attributes (read-only, read/write, executable) and privilege information. In protected mode, each time a program makes a memory access, the microprocessor checks the validity of the memory access and then generates a physical address (if it is allowed) in order to carry out the required instructions. This hardware support for memory management allows an operating system to protect itself from the programs that are running under it. It also allows it to protect the programs running on the system from clobbering each other's memory.

An additional benefit of protected mode operation with the Intel family of chips is that a much larger memory space is available. One megabyte is all you get in real mode. Sixteen megabytes and four gigabytes (!!!) are physically addressable in the protected modes of the 80286 and 80386 chips respectively.

QNX is available in both real mode and protected mode versions. This means that you can run QNX on 8088/6 based machines as well as the higher horsepower 80286 through 80486 machines.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.