OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 3:07 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: CPUID on Intel I5 3210-m
PostPosted: Wed May 10, 2017 11:11 am 
Offline
Member
Member

Joined: Wed Mar 15, 2017 9:22 am
Posts: 40
Hi all

I'm trying to find out if my CPU supports AVX which according to the INTEL Identification program it does but if I run the following INTEL code to check it says it doesn't :-
Code:
xor eax, eax
   cpuid
   cmp eax, 1 ; does CPUID support eax = 1?
   jb not_supported
   mov eax, 1
   cpuid
   and ecx, 018000000h ;check 27 bit (OS uses XSAVE/XRSTOR)
   cmp ecx, 018000000h ; and 28 (AVX supported by CPU)
   jne not_supported
   xor ecx, ecx ; XFEATURE_ENABLED_MASK/XCR0 register number = 0
   xgetbv ; XFEATURE_ENABLED_MASK register is in edx:eax
   and eax, 110b
   cmp eax, 110b ; check the AVX registers restore at context switch
   jne not_supported
   mov eax, 1
   jmp $
   not_supported:
   xor eax, eax
   jmp $


It fails at the bit 27,28 check above, any ideas?

Bipman


Top
 Profile  
 
 Post subject: Re: CPUID on Intel I5 3210-m
PostPosted: Wed May 10, 2017 11:22 am 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
code seems wrong

0x018000000 to binary is 0b11000000000000000000000000000

avx is the 28th bit
27th bit has nothing to do with it

_________________
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 40 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group