OSDev.org
https://forum.osdev.org/

Some questions about x86-64 modes
https://forum.osdev.org/viewtopic.php?f=15&t=31424
Page 1 of 1

Author:  ComputerMail [ Wed Mar 15, 2017 10:18 pm ]
Post subject:  Some questions about x86-64 modes

Hi,

i am following that tutorial http://wiki.osdev.org/Setting_Up_Long_Mode and am blocked at some points, first "The Switch from Real Mode" so we are in real mode here so why do we use ecx and others 32 bits elements ? Other question, at "Entering the 64-bit Submode" what is the difference between IA32e mode and 64-bit long mode ? I understand the first allows us to execute 32bits code but does it allows us to execute 64bits code also ? And the second, i understand it allows us to execute 64 bits code, what are avantages to use one or other ? Last question, at same point as the previous, there is writed "Our GDT (see chapter 4.8.1 and 4.8.2 of the AMD64 Architecture Programmer's Manual Volume 2) should look like this:", here is specified amd processor does x86-64 intel has the same working ?

Author:  Octocontrabass [ Thu Mar 16, 2017 1:18 am ]
Post subject:  Re: Some questions about x86-64 modes

ComputerMail wrote:
first "The Switch from Real Mode" so we are in real mode here so why do we use ecx and others 32 bits elements ?

Because 32-bit operations are convenient, even in real mode.

ComputerMail wrote:
Other question, at "Entering the 64-bit Submode" what is the difference between IA32e mode and 64-bit long mode ?

The wiki page was wrong, it's supposed to say "compatibility mode" instead of "IA-32e". (IA-32e is Intel's name for AMD64.) I've corrected the wiki page.

ComputerMail wrote:
I understand the first allows us to execute 32bits code but does it allows us to execute 64bits code also ?

You can't execute 64-bit code in compatibility mode.

ComputerMail wrote:
And the second, i understand it allows us to execute 64 bits code, what are avantages to use one or other ?

That question has been answered many times. Have you already tried asking Google?

ComputerMail wrote:
here is specified amd processor does x86-64 intel has the same working ?

Yes. (There are a few small differences between AMD64 and IA-32e, but the GDT is not one of them.)

Author:  Korona [ Thu Mar 16, 2017 1:21 am ]
Post subject:  Re: Some questions about x86-64 modes

This should be posted in OS Development and not in this subforum.

The difference between real mode and protected mode is not their operand size but the way that segment registers are handled. Real mode only allows accessing 1 MiB of memory but it does not prevent execution of 32-bit instructions. In 16-bit modes (= real mode and 16-bit protected mode) 32-bit instructions need an operand size override prefix. Likewise in 32-bit modes 16-bit instructions need such a prefix.

IA32e is Intel's term for 64-bit long mode. Intel's and AMD's implementations of x86_64 are almost binary compatible (except for things like VT-x/SVM, Machine Check, Performance Monitoring, ...).

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/