Skip to content

Commit

Permalink
Fix Hardware Virtualization Detect and add detect for Hyper-Transport…
Browse files Browse the repository at this point in the history
… in AMD.
  • Loading branch information
eloaders committed Feb 5, 2014
1 parent be94c2d commit db054e2
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 27 deletions.
51 changes: 30 additions & 21 deletions src/i-nex/.src/FFlags.module
Original file line number Diff line number Diff line change
Expand Up @@ -22,69 +22,69 @@ Public VIRT As String
Public instructions As String
Public dec_instructions As String
Public Sub _init()

Shell "grep 'flags' /proc/cpuinfo | sed -n '1p'" Wait To dec_instructions
If dec_instructions Like "*mmxext*" Then
Shell "grep 'flags' /proc/cpuinfo | sed -n '1p' | cut -d ':' -f 2" Wait To dec_instructions
If dec_instructions Like "* mmxext *" Then
instructions = instructions & "MMX(+), "
Endif
If dec_instructions Like "*mmx*" Then
If dec_instructions Like "* mmx *" Then
instructions = instructions & "MMX, "
Endif
If dec_instructions Like "*3dnowext*" Then
If dec_instructions Like "* 3dnowext *" Then
instructions = instructions & "3DNow!(+), "
Endif
If dec_instructions Like "*sse*" Then
If dec_instructions Like "* sse *" Then
instructions = instructions & "SSE, "
Endif
If dec_instructions Like "*3dnow*" Then
If dec_instructions Like "* 3dnow *" Then
instructions = instructions & "3DNow!, "
Endif
If dec_instructions Like "*sse2*" Then
If dec_instructions Like "* sse2 *" Then
instructions = instructions & "SSE2, "
Endif
If dec_instructions Like "*pni*" Then
If dec_instructions Like "* pni *" Then
instructions = instructions & "SSE3, "
Endif
If dec_instructions Like "*ssse3*" Then
If dec_instructions Like "* ssse3 *" Then
instructions = instructions & "SSSE3, "
Endif
If dec_instructions Like "*sse4_2*" Then
If dec_instructions Like "* sse4_2 *" Then
instructions = instructions & "SSE4.2, "
Endif
If dec_instructions Like "*sse4_1*" Then
If dec_instructions Like "* sse4_1 *" Then
instructions = instructions & "SSE4.1, "
Endif
If dec_instructions Like "*sse4a*" Then
If dec_instructions Like "* sse4a *" Then
instructions = instructions & "SSE4a, "
Endif
If dec_instructions Like "*nx*" And Finfosys.vendor_id Like "*GenuineIntel*" Then
If dec_instructions Like "* nx *" And Finfosys.vendor_id Like "*Intel*" Then
instructions = instructions & "XD-Bit, "
Else
instructions = instructions & "NX-Bit, "
Endif

'Instructions for detect AMD64,vmx, ht
If dec_instructions Like "* lm *" Then
Finfosys.ToolButton1.Picture = Picture["Data/check_true.png"]
X86_X64 = "True"
Else
Finfosys.ToolButton1.Picture = Picture["Data/check_false.png"]
X86_X64 = "False"
X86_X64 = "False"
Endif
If dec_instructions Like "*svm *" Then

If dec_instructions Like "* vmx *" Then
Finfosys.ToolButton2.Picture = Picture["Data/check_true.png"]
VIRT = "True"
Else
Finfosys.ToolButton2.Picture = Picture["Data/check_false.png"]
VIRT = "False"
Endif
If dec_instructions Like "*vmx*" Then
Else If dec_instructions Like "* svm *" Then
Finfosys.ToolButton2.Picture = Picture["Data/check_true.png"]
HTT = "True"
Else
Finfosys.ToolButton2.Picture = Picture["Data/check_false.png"]
HTT = "False"
VIRT = "False"
Endif

ht()
HyperTransport()
End

Public Sub ht()
Expand All @@ -108,3 +108,12 @@ Public Sub ht()
Endif
Endif
End

Public Sub HyperTransport()

If Finfosys.vendor_id Like "*AuthenticAMD*" And dec_instructions Like "*ht*" Then
Finfosys.ToolButton3.Picture = Picture["Data/check_true.png"]
Finfosys.Label99.Text = "Hyper-Transport:"
Endif

End
15 changes: 9 additions & 6 deletions src/i-nex/.src/Finfosys.form
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
Delay = 2000
}
{ Label72 Label
Move(7,217,168,21)
Move(7,217,147,21)
#Translate = False
Font = Font["Bold,8"]
Foreground = &H9F300E&
Expand All @@ -117,10 +117,11 @@
Border = Border.Raised
}
{ ToolButton1 ToolButton
Move(154,217,21,21)
Move(133,217,21,21)
Picture = Picture["Data/check_false.png"]
}
{ Label98 Label
Move(175,217,182,21)
Move(154,217,161,21)
#Translate = False
Font = Font["Bold,8"]
Foreground = &H9F300E&
Expand All @@ -129,19 +130,21 @@
Border = Border.Raised
}
{ ToolButton2 ToolButton
Move(336,217,21,21)
Move(294,217,21,21)
Picture = Picture["Data/check_false.png"]
}
{ Label99 Label
Move(357,217,105,21)
Move(315,217,147,21)
#Translate = False
Font = Font["Bold,8"]
Foreground = &H9F300E&
Padding = 3
Text = "HT:"
Text = "Hyper-Threading:"
Border = Border.Raised
}
{ ToolButton3 ToolButton
Move(441,217,21,21)
Picture = Picture["Data/check_false.png"]
}
{ Label71 Label
Move(7,196,455,21)
Expand Down

0 comments on commit db054e2

Please sign in to comment.