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
2
votes
2 answers

I failed in switching the cpu from real-mode to protected-mode

I do this according a book by Nick Blundell. I write a MBR program, which runs in real-mode firstly, and some instructions in the program will switch the cpu to protected-mode. First I set the GDT like this: gdt_start: gdt_null: dd 0x0 dd…
Akr
  • 179
  • 2
  • 4
  • 13
2
votes
1 answer

Running code built for x86 unpaged protected mode

I'm currently trying to reverse engineer a program (~30KB, mostly code) that appears to be built for x86 unpaged protected mode. It contains instructions that access physical memory (or memory mapped device registers to be more precise) directly,…
r00t
  • 23
  • 2
2
votes
1 answer

Obscure IE8 Opacity Issue

I've got a bizarre opacity issue dealing with IE8 & Websphere 6.1. Got a very basic opacity setup where we have a modal type dialog box over-top of a certain screen. I put an opaque div over top of the screen in the background so the user can't…
Durandal
  • 5,575
  • 5
  • 35
  • 49
2
votes
0 answers

Using Flash with Protected Mode enabled in CreateDesktop()

I am trying to start Firefox in new desktop using CreateDesktop() Windows function but I am having problems with Flash when Flash's Protected Mode is enabled. Flash works perfectly when I start Firefox in the default desktop, but Firefox hangs in…
sleon
  • 51
  • 7
2
votes
0 answers

Intel 32bit protected mode enabling paging causes triple fault

I am working on a hobbyist OS and I am having trouble with identity mapping and enabling paging. I am working with Bochs emulator, and I have the following error message := 00691299602e[CPU0 ] interrupt(): gate descriptor is not valid sys seg…
Smokey
  • 281
  • 1
  • 2
  • 6
2
votes
1 answer

Can I run assembly program that switches to protected mode in dosbox?

We are studying an assembly program that switches an 386 processor from real mode to protected mode, and then back to real mode. The program is compiled using TASM. Because this program needs to do some privileged operations, and it needs to start…
sashoalm
  • 75,001
  • 122
  • 434
  • 781
2
votes
1 answer

Boot loop when trying to enable protected mode

I'm writing a basic bootloader just to the point where I have some sort of environment where I can write a simple C program, write it to a hard disk (no file system), and run it. That's all I want to do. Here is what I've done so far. Stage 1: Set…
user1002358
  • 2,852
  • 6
  • 22
  • 32
2
votes
1 answer

GPF after far jump to protected mode

After several weeks of work using GRUB as my bootloader I decided that I should roll my own so I can understand how they work. I found Brokenthorn's tutorials on the internet (currently on http://www.brokenthorn.com/Resources/OSDev9.html). When I…
user1133383
  • 103
  • 1
  • 7
2
votes
1 answer

Custom icon for IE9 Toolbar buttons

I made an extension for IE9 that adds a toolbar button. The registration looks like this: RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(RegCmd, true); if (registryKey == null) registryKey =…
Eric Hartford
  • 16,464
  • 4
  • 33
  • 50
1
vote
1 answer

IA32 CPU, protected mode: which data is saved to the stack when an interrupt takes place?

I would like to know the size in bytes that each piece of data uses in the stack. How does the privilege level affect the answer?
gztomas
  • 3,030
  • 3
  • 27
  • 38
1
vote
1 answer

Mailto link causes page to go blank in ie8

My problem is similar to this post: mailto causing a blank page in IE8 when used with Dojo. I have a page with a mailto link and when the user click on the link, the email client opens as expected, but the page goes blank. This only happens in…
1
vote
0 answers

why my os doesn't switch to protected mode

I started creating an os entirely in assembly thinking I wanted to do it completely in real-mode, but as soon as I realized the limitations I had, I decided to create the bootloader in real-mode and the kernel in protected-mode I tried to set the…
1
vote
1 answer

A weird problem when transitioning to protected mode

I am trying to switch to protected mode after playing around a little bit with real mode, but something weird occurs. In real mode I have created a simple welcome screen asking the user to enter their name. After that, the switch to protected mode…
1
vote
0 answers

qemu invalid tss type

I am switching to user mode from kernel mode in 32-bit protected mode (only segmentation not paging). When I make the switch and call an interrupt in userspace I get this error from QEMU: This may indicate that pixbuf loaders or the mime database…
1
vote
0 answers

QEMU starts blinking with custom boot loader in x86

I'm writing my own boot loader for i386 in NASM for education purposes. But when I'm running qemu with this it starts blinking and do anything but what I want. Here's my code: ; defs.asm %define STACK_SEGMENT_REAL_MODE 0x9000 %define…
k1r1t0
  • 465
  • 2
  • 11