OSRLogo
OSRLogoOSRLogoOSRLogo x OSR Custom Development Services
OSRLogo
x

Everything Windows Driver Development

x
x
x
GoToHomePage xLoginx
 
 

    Tue, 09 Feb 2010     76021 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
  · Attention Silicon Valley - WDF/WDF/Kernel Debugging Seminars Coming to Santa Clara
  · The Community Steps Up: VisualDDK
  · Win7 Mysteries: Crash Dump Oddities
  · KMDF Basics: Using Counted Queues
  · Writing a Virtual Storport Miniport Driver (Part II)

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
What Are Rings

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 WDF Drivers LAB
Santa Clara, CA
22-Feb-2010 to 26-Feb-2010

Writing WDM Drivers LAB
Santa Clara, CA
22-Feb-2010 to 26-Feb-2010

Kernel Debugging
& Crash Analysis LAB

Santa Clara, CA
1 Mar-2010 to 5-Mar-2010

Writing WDF Drivers LAB
Munich, Germany
15 Mar-2010 to 19-Mar-2010

Windows Internals
& Software Drivers LAB

Seattle, WA
29 Mar-2010 to 2-Apr-2010

Kernel Debugging
& Crash Analysis LAB

Munich, Germany
12 Apr-2010 to 16-Apr-2010

File System Development
Waltham, MA
27-Apr-2010 to 30-Apr-2010

 
 

Windows Debugger
V6.11.1.404 -- 27-Mar-09

Checked Build Downloads
11-Apr-09

Debugging Symbols
5-Aug-09

WDK Doc Updates
Now updated monthly!

Windows WDK
Win7 & Server 2008 R2 -- 5-Aug-09

 
IFS Kit Support
bottom nav links