Page 2 of 2

Re: Long Mode

Posted: Wed Mar 04, 2009 7:03 pm
by JohnnyTheDon
Sly wrote:I heard that you can get to long mode by changing a bit in a MSR.
You need to change LME (Long Mode Enable) in the EFER MSR and then enable paging, which sets the LMA (Long Mode Active) flag. If you try to directly set or clear LMA an exception (GPF?) occurs.

Re: Long Mode

Posted: Thu Mar 05, 2009 5:05 am
by jal
Sly wrote:I heard that you can get to long mode by changing a bit in a MSR.
I heard your soul can be saved by donating to your local church. I also heard 9-11 is a government conspiracy. I also heard the Earth is only 6000 years old. I also heard China is doing Tibet a favour. I also heard yellow is the new pink. I also heard a continuous beeping noice noone else can hear. You get the point. If not: your remark is completely useless without substantiating where you heard it and giving further information. This is not a gossip forum.


JAL

Re: Long Mode

Posted: Thu Mar 05, 2009 6:39 am
by 01000101
jal wrote:
Sly wrote:I heard that you can get to long mode by changing a bit in a MSR.
I heard your soul can be saved by donating to your local church. I also heard 9-11 is a government conspiracy. I also heard the Earth is only 6000 years old. I also heard China is doing Tibet a favour. I also heard yellow is the new pink. I also heard a continuous beeping noice noone else can hear. You get the point. If not: your remark is completely useless without substantiating where you heard it and giving further information. This is not a gossip forum.

JAL
That was the most pointless and unnecessary post I've seen here in a while.

Sly: yes, you need to modify a MSR value in order to enter Long Mode.

this should be all you need though for that: (look up the actual info about the MSR in the Intel Manuals)

Code: Select all

    mov ecx,0xC0000080		    ; set MSR address
    
    rdmsr			            ; read MSR
    or ax, 0x0100               ; set long mode bit
    wrmsr                       ; write MSR

Re: Long Mode

Posted: Thu Mar 05, 2009 10:38 am
by quok
01000101 wrote: Sly: yes, you need to modify a MSR value in order to enter Long Mode.

this should be all you need though for that: (look up the actual info about the MSR in the Intel Manuals)

Code: Select all

    mov ecx,0xC0000080		    ; set MSR address
    
    rdmsr			            ; read MSR
    or ax, 0x0100               ; set long mode bit
    wrmsr                       ; write MSR
However, that is not the only step that is required to get in to long mode. Sly's post seemed to suggest he heard somewhere that there is a way to enter long mode by simply toggling a bit in some MSR, without any of the other necessary steps.

Re: Long Mode

Posted: Thu Mar 05, 2009 1:10 pm
by jal
01000101 wrote:That was the most pointless and unnecessary post I've seen here in a while.
Well, at least the most pointless and unnecessary post by me. Must've been in a bad mood. Still, it is rather silly to behave like you're in on some secret, when the secret is actually only part of a well known truth.


JAL