Questions tagged [protected-mode]

x86 protected mode allows system software to support virtual memory, paging and preemptive multi-tasking.

x86 protected mode allows system software to support virtual memory, paging and preemptive multi-tasking.

  • Protected mode was first added to the x86 architecture in 1982, with the release of Intel's 80286 processor, and later extended with the release of the 80386 processor in 1985.
  • To maintain backward compatibility, x86 processors begins executing instructions in real mode.

To enter protected mode:

  • The Global Descriptor Table (GDT) must first be created with a minimum of three entries: a null descriptor, a code segment descriptor and data segment descriptor.
  • In an IBM-compatible machine, the A20 line (21st address line) also must be enabled to allow the use of all the address lines so that the CPU can access beyond 1 megabyte of memory.
  • Then the PE bit must be set in the CR0 register and a far jump must be made to clear the prefetch input queue:
; set PE bit
mov eax, cr0
or eax, 1
mov cr0, eax

; far jump (cs = selector of code segment)
jmp cs:@pm

@pm:
; Now we are in PM.
214 questions
7
votes
1 answer

Transition from real to protected mode in the Linux kernel

I am currently studying low level organization of operating systems. In order to achive that I am trying to understand how Linux kernel is loaded. A thing that I cannot comprehend is the transition from 16-bit (real mode) to 32-bit (protected mode).…
6
votes
1 answer

Why do I get triple fault when trying to handle an exception on 286 but not on a modern CPU nor Bochs?

I'm trying to initialize protected mode with exception handling on an AMD 286 system. I've debugged the code below on Bochs, and it works fine there. So does it when run on a Pentium 4 machine. But on the 286 it simply triple faults when it gets to…
Ruslan
  • 18,162
  • 8
  • 67
  • 136
6
votes
1 answer

How does setting the PE flag in CR0 enable protected mode?

I am trying to understand how a machine goes from power on to running a kernel. From what I've gathered, it is useful to switch into protected mode during boot up in order to gain access to more addressable memory even if we will eventually switch…
Pedro Cattori
  • 2,735
  • 1
  • 25
  • 43
5
votes
1 answer

how create medium integrity level process from low integrity level process?

If I run IE in protected mode, its integrity level is low. And if I then create a medium integrity level process (impl by ActiveX), IE will warn the user with an Elevation Warning window. How do I create a medium process from another processes (like…
solid
  • 63
  • 6
5
votes
4 answers

IE Protected Mode for Local System Account

I have a Windows Service that runs a Team City Build agent on a Windows 7 OS. This agent triggers NUnit tests which use the Selenium IE web drivers to execute a series of tests. For the Selenium IE web drivers to work the protected mode for all…
Shaun
  • 73
  • 2
  • 4
5
votes
1 answer

How to lower integrity of WCF named pipe

I have an Internet Explorer add-in, written in C#, which talks via a WCF named-pipe to a .NET desktop application. The desktop app creates the ServiceHost for the netNamedPipeBinding, and each instance of the IE add-in creates a ChannelFactory to…
HappyNomad
  • 4,458
  • 4
  • 36
  • 55
4
votes
1 answer

Interacting with a Service from Internet Explorer

I am attempting to have IE9 interact with a COM service (created using Visual Studio 2010's wizard) while running in protected mode. If I run the service as admin rather than registering it as a service, my BHO's call to spUnk.CoCreateInstance…
Brian
  • 25,523
  • 18
  • 82
  • 173
4
votes
1 answer

C# : Lower integrity of named pipes

I am developing an Internet Explorer Browser Helper Object (BHO) in C#. This BHO detects the URL that the user navigates to and then auto populates the username and password. The BHO communicates with a process running as a service. The…
Avinash Agarwal
  • 157
  • 1
  • 9
4
votes
1 answer

How to create tiny 32-bit (i386) executables for DOS?

I'd like to create tiny 32-bit (i386) executables for DOS. As a reference, here is the NASM assembly source code of my tiny 16-bit (8086) executable for DOS: ; $ nasm -o hi16.com hi16.nasm # 26 bytes. bits 16 org 0x100 mov dx, msg ; 16-bit pointer…
pts
  • 80,836
  • 20
  • 110
  • 183
4
votes
3 answers

Reading the Internet Explorer Protected Mode registry

I'm learning the registry with vbscript on the side. I would like to know would I check the strValuname and dwValue of the internet explorer protected mode feature through the use of vbscript? I tried searching the registry on the strKeyPath to no…
4
votes
1 answer

Why should prefetch queue be invalidated after entering protected mode?

The Intel Developer Manual suggests that after switching to protected mode, we immediately perform the JMP or CALL instruction immediately after the MOV CR0 instruction changes the flow of execution and serializes the processor. The purpose is for…
Amumu
  • 17,924
  • 31
  • 84
  • 131
4
votes
2 answers

Triple fault when jumping into protected mode

I'm developing a boot loader, which will boot into a simple kernel after switching into protected mode. I used this paper as a tutorial, somewhere in chapter four or five. In theory it is supposed to start in 16-bit real mode, load the kernel into…
adotout1
  • 43
  • 5
4
votes
1 answer

What exactly does the granularity bit of a GDT change about addressing memory?

If this bit is zero, then memory is addressed byte by byte? And if it is 1, then memory is addressed 4Kb by 4Kb? So for example, if this bit was set to 0, and i addressed memory location a000h, then i would be addressing the byte at that location…
kbzombie
  • 322
  • 2
  • 12
4
votes
1 answer

OS development - executing first instruction in protected mode

I am referring to Broken Thorn's OS development tutorial. I am currently at the stage of executing the second stage bootloader to load the GDT and enter protected mode. I understood how the GDT works and how to enter into protected mode. However, my…
Cygnus
  • 3,222
  • 9
  • 35
  • 65
4
votes
1 answer

GDB realmode to protected mode, on the fly disassamble

I'm trying to debug a piece of MBR code, with some context switch in it. I have the asm layout set up by default with 16bit disassambled instructions. My problem appears when I make a context to protected mode, in wich case the instructions in the…
lerosQ
  • 250
  • 3
  • 11
1
2
3
14 15