package require cpuid eval format \"%8.8x %8.8x %8.8x\" [::cpuid::cpuid 0] => 00000005 756e6547 6c65746e eval format \"%8.8x %8.8x %8.8x\" [::cpuid::cpuid 1] => 00000f34 00020800 0000441d eval format \"%8.8x %8.8x %8.8x\" [::cpuid::cpuid 2] => 605b5001 00000000 00000000 |
CPUIDの詳細は、The CPUID Guideを参照してください。
package require cpuid
proc swap {x} {
format "0x%2.2x%2.2x%2.2x%2.2x" \
[expr ($x & 0xff)] \
[expr ($x & 0xff00) >> 8] \
[expr ($x & 0xff0000) >> 16] \
[expr ($x & 0xff000000) >> 24]
}
pack [text .text -width 40 -height 5]
set result [::cpuid::cpuid 1]
set standard [swap [lindex $result 0]]
set standard2 [swap [lindex $result 1]]
set ncpu [expr ($standard2 & 0xff00) >> 8]
set extended [swap [lindex $result 2]]
# bit28
if {$standard & 0x10000000} {
if {$ncpu >= 2} {
.text insert end "Hyper-Threading Technology (HTT): Enable\n"
} else {
.text insert end "Hyper-Threading Technology (HTT): Disable\n"
}
} else {
.text insert end "Hyper-Threading: Not Supported\n"
}
# bit20
if {$extended & 0x100000} {
.text insert end "No-execute Page Protection (NX): Supported\n"
} else {
.text insert end "No-execute Page Protection (NX): Not Supported\n"
}
# bit29
if {$extended & 0x20000000} {
.text insert end "64-Bit Extensions (IA-32e): Supported\n"
} else {
.text insert end "64-Bit Extensions (IA-32e): Not Supported\n"
}
# bit30
if {$standard & 0x40000000} {
.text insert end "IA-64 Processor Capable (IA-64): Supported\n"
} else {
.text insert end "IA-64 Processor Capable (IA-64): Not Supported\n"
}
|