OSD Home

Pmode quick start

No other protected mode OS or code can be running

Start small

You must understand x86 segmented addressing

Linear address = segment base address + offset
In pmode, however, the segment base address comes from a descriptor, not from the segment register.

Consult one or more of the many pmode tutorials on the Internet.

Use video memory for debugging

After each crucial step in the process of switching to pmode, poke a character into video memory, so you can see (literally) how far the code gets. This is demonstrated in the quick-start code, below.

Virtual 8086 (V86) mode

V86 mode is a hybrid of real mode and protected mode. It lets you run real-mode code at ring 3 (user privilege), with paging, and memory and I/O protection as in true protected mode.

A program that manages transitions between V86 mode and protected mode is called a virtual-8086 mode monitor (VMM). The transitions may proceed in both directions:
VMM type Application Kernel Example
DOS extender 32-bit 16-bit Windows 3.x, Windows 9x
Virtual DOS machine (VDM) 16-bit 32-bit DOSEMU (Linux), NTVDM (Windows NT)

Pmode code snippets

Enable 'unreal' mode. This is identical with real mode, with the exception that 32-bit addresses greater than 0xFFFF are allowed (they don't cause exception 0Dh, as they do in true real mode). Unreal mode is interesting, but not as useful as you might think.

'Quick-start' code. The register and memory usage of this code is shown here. This code now comes with a bootloader, so you can build it under Linux or Windows NT and boot it from a floppy disk.

A virtual-8086 mode monitor.

Links

TO DO

REPORT BUGS OR ERRORS IN THIS DOCUMENT