Identification of 64 Bit AMD CPU

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Identification of 64 Bit AMD CPU

Post by AJ »

Hi All,

I am just investigating a 64 bit extensions to my OS at the moment and am trying to identify whether long mode is available. On Intel, this seems pretty easy (CPUID EAX=1, returns in bit 30 of EDX), but according to the AMD manuals, bits 29:31 of EDX with CPUID EAX=1 are reserved (even in the latest PDF from their site).

Scanning the document, I can't find how to check if long mode is available. Does anyone know how I should do this (I have googled but may not be using the correct search term)?

Cheers,
Adam
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

Bugg*r, just found it! It's in the AMD x86_64 overview document and is in bit 29 of EDX, for anyone else looking.

Cheers,
Adam
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

Looks like you're a little confused ;)

First check if the maximum supported extended level is higher then 0..
EAX = 0x80000000
CPUID
EAX > 0

Then check for the long-mode feature bit is set:
EAX = 0x80000001
CPUID
bit 29 in EDX..

Have fun :)
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

Thanks. It's been one of those days, today. :roll:
Post Reply