Real Mode - Switching To Real Mode

Switching To Real Mode

Intel introduced protected mode into the x86 family with the intention that operating systems which used it would run entirely in the new mode and that all programs running under a protected mode operating system would run in protected mode as well. Because of the substantial differences between real mode and even the rather limited 286 protected mode, programs written for real mode cannot run in protected mode without being rewritten. Therefore, with a wide base of existing real mode applications which users depended on, abandoning real mode posed problems for the industry, and programmers sought a way to switch between the modes at will. However, Intel, consistent with their intentions for the processor's usage, provided an easy way to switch into protected mode on the 80286 but no easy way to switch back to real mode. Before the 386 the only way to switch from protected mode back to real mode was to reset the processor; after a reset it always starts up in real mode to be compatible with earlier x86 CPUs back to the 8086. Resetting the processor does not clear the system's RAM, so this, while awkward and inefficient, is actually feasible. From protected mode, the processor's state is saved in memory, then the processor is reset, restarts in real mode, and executes some real mode code to restore the saved state from memory. It can then run other real mode code until the program is ready to switch back to protected mode. The switch to real mode is costly in terms of time, but this technique allows protected mode programs to use services such as BIOS, which runs entirely in real mode (having been designed originally for the 8088-based IBM Personal Computer model (machine type) 5150). This mode-switching technique is also the one used by DPMI (under real, not emulated, DOS) and DOS extenders like DOS/4GW to allow protected mode programs to run under DOS; the DPMI system or DOS extender switches to real mode to invoke DOS or BIOS calls, then switches back to return to the application program which runs in protected mode. This is probably the reason why until Windows ME it was possible to restart the computer to MS DOS mode from within the operating system. The changing towards the NT kernel resulted in the operating system not needing DOS to boot the computer as well as unable to use it. The need to restart the computer in Real Mode MS DOS declined after Windows 3.1x until it was no longer needed. The only way of currently running DOS applications in Real Mode from within newer versions of Windows is by using emulators such as DOSBox.

Read more about this topic:  Real Mode

Famous quotes containing the words real and/or mode:

    I think it’s the real world. The people we’re writing about in professional sports, they’re suffering and living and dying and loving and trying to make their way through life just as the brick layers and politicians are.
    Walter Wellesley (Red)

    The character of the logger’s admiration is betrayed by his very mode of expressing it.... He admires the log, the carcass or corpse, more than the tree.... What right have you to celebrate the virtues of the man you murdered?
    Henry David Thoreau (1817–1862)