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
4
votes
0 answers

Passing a url from a link drag-and-dropped from InternetExplorer to sojamo/Processing

I'm having trouble dropping an address from the IE address bar into a processing application, even the simple DropBasics.pde example that comes with sDrop. I think the problem is to do with Internet Explorer's Protected Mode. There's an informative…
dumbledad
  • 16,305
  • 23
  • 120
  • 273
3
votes
0 answers

How to call IEGetProtectedModeCookie API from a high-integrity (admin) process?

I need to call the IE8 IEGetProtectedModeCookie API from a high-integrity (admin) process. Whenever I call this API from my Azure webapp, I'm getting ERROR_INVALID_ACCESS. I've read in a number of places that high-integrity processes can't call this…
Armchair Bronco
  • 2,367
  • 4
  • 31
  • 44
3
votes
0 answers

Does the CS register need to be set when setting up Unreal Mode?

The OSDev Wiki describes the general procedure of switching to unreal mode, with an example bootloader: ORG 0x7c00 ; add to offsets start: xor ax, ax ; make it zero mov ds, ax ; DS=0 mov ss, ax …
3
votes
1 answer

Cannot receive output from my PS/2 mouse driver

I am following this OSDev Wiki tutorial about PS/2 Mouse drivers and I'm trying to write mine so I can add it to my C kernel (in protected mode). First, I sent the command byte 0x60 to the port 0x64 followed by this status byte to the port 0x60: …
MARSHMALLOW
  • 1,315
  • 2
  • 12
  • 24
3
votes
0 answers

Where in this code does the switch to 32bit protected mode happen

I read about how to switch from default real mode to protected mode and I wonder where the switch in my code happens. Theres one part that I copied and dont fully understand, which is this: global loader global stack_ptr extern main MODULEALIGN…
3
votes
1 answer

Assembly 32 bit-Protected Mode, label not pointing to defined string?

I am trying to learn some x86 assembly. I have successfully created a MBR with a bootloader, loaded another sector, switched to Protected Mode and performed a far jump into the loaded sector. Used environment I am using NASM on a 64-bit Windows…
Expolarity
  • 153
  • 1
  • 1
  • 11
3
votes
1 answer

Read the keyboard in protected mode

I'm trying to do a PS/2 keyboard controller, and I can't get it work. outb(0x60, 0xED); outb(0x60, 2); /* Turn on CapsLock LED (doesn't works)*/ char c = 0; while (c != 1) { if (inb(0x60) != c) { c = inb(0x60); if (c > 0) …
user10481362
3
votes
1 answer

DeleteURLCacheEntry doesnot delete Temporary Internet files when Protected Mode is ON

I am using "deleteURLCacheEntry" Wininet API to delete temporary internet files on Win7/Vista IE 7/8 respectively. The API works perfectly fine when IE's protected mode is OFF. But it fails silently when the protected mode is ON. Can somebody advise…
user561832
  • 51
  • 1
  • 5
3
votes
1 answer

Simplest way to export data from bare bones OS

What is the simplest way to export data from a bare-bones OS? I’m developing some assignments for my Computer Architecture course that require students to time different segments of code as accurately as possible. My idea is to insert the code to…
Zack
  • 6,232
  • 8
  • 38
  • 68
3
votes
0 answers

How to make a VESA linear frame buffer in real mode to use it after in protected mode?

I want to create a small operating system, but in 32-bit mode with graphics with the full resolution of my screen (1366x768) and 24 bpp. For now, my code in nasm assembly calls the 0x4F02 VESA function in real mode with the value of 0xC118 (the…
Bolgeg
  • 41
  • 5
3
votes
0 answers

IE11 Server 2012r2: Trusted Sites treated as Internet Sites in Enhanced Protected Mode Context?

I am trying to automate some tasks on Internet Explorer using AutoIT. I am using AutoIT's IE.au3 library. I have Enhanced Protected Mode enabled for my machine. I want to disable it (and Protected Mode) for a specific site and I am using IE 11.…
Tal
  • 398
  • 4
  • 19
3
votes
1 answer

Not Getting keyboard input in c kernel protected mode

I am making an OS in C and 32bit Assembly following James Molloy's tutorial till IRQs and PIT step and i am trying to get keyboard input i tried this code added to the tutorials' code but i am not able to get things right. Keyboard.c: #include…
3
votes
5 answers

IE11 intermittently not loading pages

Many of our users are reporting that they are getting a blank page when using IE11 to access our website. Sometimes they don't even get a blank page, the browser just stays on the last page visited. These users can access other domains (such as…
Elonka
  • 39
  • 1
  • 1
  • 4
3
votes
6 answers

Are there any instructions in x86 assembly that exist only in 64-bit mode?

Some old x86 instructions are undefined in 64-bit mode. For instance LDS, LES and LSS, or short opcodes of the INC r16 (40 + rw) and INC r32 (40 + rd) instructions. Are there any instructions that are defined only in 64-bit mode, and not in 32-bit…
Nathan Fellman
  • 122,701
  • 101
  • 260
  • 319
2
votes
1 answer

Bootloader Mixing C and Assembly

I just started my first operating system (I'm a beginner in this field). I wanted to do this in both assembly and C, but I'm having trouble calling C functions in assembly code. boot.asm: BITS 32 global start extern dmain start: call dmain …
1 2
3
14 15