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
0
votes
1 answer

disable the Security>Local Intranet>enable protected mode from the code

How to disable the Security>Local Intranet>enable protected mode from the code? I am facing problem with facebook like button when this setting is turned on.
0
votes
1 answer

How to start a process with low integrity level

I have a socket client running as BHO object which tries to communicate with Desktop application. As the IE is running in low integrity level the bho is not loaded with IE running under protected mode. I have two questions. How to start process…
Ammar Ali
  • 133
  • 3
  • 13
0
votes
1 answer

Techniques to save files from ActiveX (protected mode IE)

i have an ActiveX. ActiveX means: Internet Explorer native binary code running from a dll (.ocx) in Protected Mode The user would like to save some content. i would like to show a Save As dialog, then save to the location they said. Since the…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
0
votes
0 answers

Jump from bootloader to the kernel - Assembly x86_64

I want to make a text-os only with assembly. I created a simple bootloader, but now I don't know how to start my kernel. Can you please help me with any example (if it's possible with a practical example)? The current code: boot.asm BITS 16 ORG…
0
votes
0 answers

How to draw Pixels in high resolution (1920x1080 or 1366x768) on screen in protected mode using x86 ASM or C?

I am trying to build a Hobby Operating System and I have successfully built my own two stage bootloader which handles control to the kernel after switching to protected mode. I am able to display characters on the screen by writing at 0x000B0000 -…
0
votes
0 answers

Performance check of unordinary simple JCM structures in minimal i386 BIOS tasks

I'm continuing my investigations into a proof of concept for BIOS 16-32 tasks. Previously my post investigated a regular method for tasking between protected mode and the BIOS and a basic 16 <-> 32 task method found on this link Proof of Concept for…
0
votes
0 answers

How do I use PAE in x86 protected mode?

How do I use the extra memory given by the Physical Address Extension? Is it like paging where there are table entries? or does it use segment registers? how do I access that extended memory?
0
votes
0 answers

Cannot access memory above 0x8000000 in protected mode x86

I am quite enthusiastic about computers and I managed to create my own bootloader and kernel. So far it jumps to protected mode from real mode and can execute C code. But the thing is that I cannot write to memory addresses above 0x8000000. The code…
0
votes
0 answers

How to switch from real mode to protected mode

I am going to write a simple operating system. An error have been occurred while switch from 16 bits' real mode to 32 bits' protected mode. After loading the GDT register and setting the GDT, the protected mode has been turned on successfully. I'd…
Zhi-An Zhu
  • 49
  • 3
0
votes
0 answers

When I use soft interrupt, the program returns from protected mode to real mode. Why is this happening?

void test_task_a(void) { int i, j, k; k = 0; /* Normal: trigger #GP */ /*asm ( "int $32\n\t" );*/ while(TRUE){ for(i = 0; i < 100; i++){ for(j = 0; j < 10000; j++){} //delay } …
0
votes
0 answers

How are the segment registers initialized for x86 (80286) in protected mode?

I'm taking an operating systems class, and I'm a little unsure about segment registers. I've checked a couple of places online, but I haven't gotten a clear-cut answer to my question (even my professor gave a roundabout spiel, alluding to a later…
0
votes
2 answers

Can't Access 32 Bit in Protected Mode

During the development of a small kernel, I stumbled across a strange problem when booting up application processors using the APIC. As stated on OSDev and the Intel-Manual, the processor first enters Real-Mode, and my goal is to get it to operate…
Dalex
  • 61
  • 1
  • 5
0
votes
1 answer

How did executable stacks work in x86 protected mode?

Section 4.7.2 of the the AMD64 Developer Manual Volume 2 (System Programming) which describes Code-Segment Descriptors in legacy modes states: Code segments establish the processor operating mode and execution privilege- level. The segments…
Omar Darwish
  • 1,536
  • 2
  • 15
  • 23
0
votes
1 answer

Jump to Protected Mode is restarting QEMU

I have successfully written code for real mode. But the trouble started with 32-bit Protected Mode. Before jumping to Protected Mode, I have disabled interrupts using cli, loaded GDT using lgdt and set 32-bit mode bit in cr0. But QEMU is rebooting…
kumarp
  • 135
  • 3
  • 11
0
votes
0 answers

How to properly jump to the kernel after switching to protected mode

I'm currently developing a simple os and I decided to write all from scratch. In the second stage of the boot loader when I switch to protected mode it get stuck right after switching, and the emulator (QEMU) reboots. Here's the boot loader stage…
cam0347
  • 23
  • 3