OSRLogo
OSRLogoOSRLogoOSRLogo x Seminar Ad
OSRLogo
x

Everything Windows Driver Development

x
x
x
GoToHomePage xLoginx
 
 

    Thu, 02 Sep 2010     81215 members

   Login
   Join


 
 
Contents
  About This Site
What's New?
Hector's Memos
The NT Insider
The Basics
File Systems
Downloads
ListServer / Forum
Driver Jobs
Store
  Express Links
  · It's Here: The NT Insider -- Digital Edition!
  · WDK Community Bug Bash 2010 -- Submit a Bug... Get FREE STUFF!
  · File Systems and Filters: A Specialty
  · It's All About The Basics
  · The NT Insider - Digital Edition

What is Real Mode?

When the original 8086 was released there was only a single way of addressing memory locations.  This technique uses a segment register and an offset register.  These two registers are combined to compute the linear address. For example, instructions are fetched from memory by combinging the CS register (code segment) and the IP register (instruction pointer).  The CS register addresses memory in 16 byte units (sometimes called paragraphs).  Since the CS register is a 16 bit register, and the IP register is a 16 bit register, this method of addressing allows the 8086 to address up to 1 MB.  This works because the linear address is computed by combining these two values:

CS << 4 + IP = Linear Address Of Instruction

This same technique works for the other segment registers and offset registers.  This mode of addressing is known as real mode addressing.

As computers have evolved, 1MB of addressable memory has not been enough, so subsequent processors in the IA-32 family have changed to allow larger address spaces.  In order to maintain backwards compatibility, the processor must be changed to take advantage of those new features.  To maintain backwards compatibility, the processor starts operating in real mode (using real mode addressing) but the processor state may be changed to a different mode (normally protected mode) using whatever the appropriate mechanism.  For example, protected mode addressing is enabled by setting a bit in the CR0 control register.  Paging is enabled with a different bit in the CR0 control register (paging is only available in protected mode).  System Management Mode Addressing is only available when running in system management mode, and that in turn is enabled by asserting a signal on the appropriate pin for the IA-32 CPU (assuming your version supports System Management Mode, of course).

To answer the original question, then.  Real Mode is the execution mode of the IA-32 CPU when real mode addressing is being used.  While older versions of Windows had some support for real mode, modern Windows (on IA-32) is very much based on protected mode (with paging).  None of the OS runs in real mode, nor does it have any support for executing any part of the OS in real mode.

Indeed, the way that modern Windows makes older Real Mode programs work is by using "virtual 8086" machines that provide a separate execution environment - a virtual CPU.  That virtual CPU can then run in "real mode" but Windows itself continues to run in protected mode.

Related Articles
Stop Interrupting Me -- Of PICs and APICs
What Are Rings
The Wide World Of The AMD64

User Comments
Rate this article and give us feedback. Do you find anything missing? Share your opinion with the community!
Post Your Comment

Post Your Comments.
Print this article.
Email this article.

Writing WDM Drivers LAB
Seattle, WA
16-Aug-2010 to 20-Aug-2010

Writing WDF Drivers LAB
Santa Clara, CA
27-Sept-2010 to 1-Oct-2010

Kernel Debugging &
Crash Analysis LAB

Portland, OR
18-Oct-2010 to 22-Oct-2010

Developing File Systems
Santa Clara, CA
26-Oct-2010 to 29-Oct-2010

Windows Internals &
Software Drivers LAB

Santa Clara, CA
15-Nov-2010 to 19-Nov-2010

 
 

Windows Debugger
V6.12.2.633 -- 26 Feb 10

Checked Build Downloads
29-Apr-10

Debugging Symbols
5-Oct-09
 

WDK Doc Updates
Now updated bi-monthly!

Windows WDK
V7.1.0 -- 26 Feb 10

 
 
x
LetUsHelp
 

Need to develop a Windows file system solution?

We've got a kit for that.

Need Windows internals or kernel driver expertise?

Bring us your most challenging project - we can help!

System hangs/crashes?

We've got a special diagnostic team that's standing by.

Visit the OSR Corporate Web site for more information about how OSR can help!

 
bottom nav links