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

Switch to protected mode

Is there simple code for switching into protected mode? (for NASM) Yes - I tried resolve it using Google. Still, I not understand how... And how to load the kernel (in this mode), which is located just behind the VBR? (after first 512 byte with size…
Matesax
  • 23
  • 1
  • 8
0
votes
1 answer

Internet Explorer and Jquery

I have the following code: $.ajax({ type: "POST", url: "ajax.php", data:{ SiteLinki: $('#duvarSite').html(), duvarIcerik: $.trim($('#share').val().replace(/\n/g,'
\n')), durum: 'paylas' }, success:…
0
votes
1 answer

Why does switching to protected restarts the machine?

I'm trying to create very simple operating system in 64 bits. I'm trying to enter protected mode first, but I'm failing at this point. When I do the far jump into 32 bits, the machine restarts. My code is loaded into memory with another assembly…
Baptiste Wicht
  • 7,472
  • 7
  • 45
  • 110
0
votes
3 answers

Are 16 bit registers accessible in Protected mode x86?

Can I access 16-bit registers (AX, CX etc...) in protected mode at Windows x86? Will be this code valid? mov ax,123 Thanks.
Smax Smaxović
  • 550
  • 2
  • 7
  • 17
0
votes
0 answers

Add my site to trusted sites zone and disable protected mode for trusted sites programmatically

Is there any way to add my site to trusted sites zone and disable protected mode for trusted sites programmatically? When I browse my site, it should be added to trusted sites automatically and at the same time protected mode for trusted sites need…
sherin_
  • 352
  • 4
  • 15
0
votes
1 answer

starting address for data and instructions in protected flat mode

I’m currently reading "Assembly Language step by step" by Jeff Duntemann. I’m somewhat frustrated by picture describing memory organization for protected flat model. It shows a piece of memory of 4GB size. There, instructions area is close to bottom…
Bob
  • 137
  • 1
  • 6
0
votes
2 answers

x86 - segmentation in protected mode serves what purpose?

I read about the x86 memory segmentation and I think that I'm missing something, the linear(virtual) address is built by taking the 32-bit from the GDT entry (base address), taking the 32-bits from the offset address and sum them to get a 32 bit…
0
votes
3 answers

jump to kernel after switching to protected mode in assembly

My first question here I'm working on a simple operating system in 32-bit mode (just for fun) but I ran into a problem which is I can't jump to my kernel after switching to (32-bit) protected mode Here's my bootloader.asm [ BITS 16 ] [ ORG 0x7c00…
0
votes
1 answer

Questions about indirect jmp in protected mode

Because the address xxxx:yyyyyyyy is 32 bits in protected mode, I put a 48-bits address in a piece of memory and want to give indirect jmp, here is what I wrote: mov eax,s1 mov [address],eax mov ax,SelectorCode32 mov [address+4],ax jmp fword…
user2269707
0
votes
1 answer

What is the role of DC bit in GDT?

this is my code : ... data_seg equ os_data-gdt_start code_seg equ os_code-gdt_start ... jmp code_seg:pm_start [BITS 32] pm_start: mov ax,data_seg mov ds,ax mov word [ds:0xb8000],0xC341 it work correctly when dc bit (Third bit of Access…
HamidReza
  • 717
  • 7
  • 17
0
votes
0 answers

Can't get any event while Protected Mode In IE is ON

I'm writing an IE add-on (ToolBar) with Winform and I need to get the mouse position and keyboard key press And I don't get any Windows event while the IE is on Protected mode, Even the protected override void OnLostFocus(EventArgs e) is not…
Ofir Hadad
  • 1,800
  • 3
  • 26
  • 47
-1
votes
1 answer

C kernel is going crazy with floating point numbers

So I'm writing a C kernel (which runs in protected mode) and I'm dabbling with floating point numbers. First, I wrote this C program to make sure that nothing goes wrong (runs on my physical machine, not as part of the kernel) that used a for loop…
MARSHMALLOW
  • 1,315
  • 2
  • 12
  • 24
-1
votes
1 answer

How will first megabyte memory layout be changed in Protected Mode?

As far as I understand when we are in x86 Real Mode the first megabyte memory layot looks like that: Will memory layot be changed once we jump to Protected Mode? I know that we can access video memory by the same address like we did it the Real…
daniil_
  • 707
  • 7
  • 26
-1
votes
1 answer

How does cs register work in protected mode?

This is the content of segment register, which is composed of 13-bit offset, 1-bit table indicator, and 2-bit requested privilege level: Bit: | 15 3 | 2 | 1 0 | Content: | offset (index) | ti…
Bicheng
  • 687
  • 8
  • 20
-1
votes
1 answer

Changing the cursor size assembly 32-bit protected mode

I am building an operating system in assembly. I know how to move the cursor through the CRT microcontroller (ports 0x3D4-0x3D5) but I don’t know how to change the size. Also can I create a vertical cursor in text mode (like windows cursor)? Any…
ARISTOS
  • 336
  • 3
  • 7
1 2 3
14
15