我尝试从装有 FreeBSD 的服务器读取 CPU 序列号信息。
我毫不费力地尝试了这些:
- 系统控制
- 消息
- CPU控制
系统上不存在这些实用程序:
- 德米德码
- 处理器信息
- 处理器ID
- /proc 目录
我无法在服务器上安装任何软件。
知道如何解决吗?
谢谢!
答案1
FreeBSD 上存在“cpuid”包,但它不是基础系统的一部分。
输出示例:
root@freeBSD > cpuid
eax in eax ebx ecx edx
00000000 00000005 756e6547 6c65746e 49656e69
00000001 000106e5 01040800 00000201 178bfbff
00000002 55035a01 00f0b2e4 00000000 09ca212c
00000003 00000000 00000000 00000000 00000000
00000004 0c000021 01c0003f 0000003f 00000000
00000005 00000000 00000000 00000000 00000000
80000000 80000008 00000000 00000000 00000000
80000001 00000000 00000000 00000001 28100800
80000002 65746e49 2952286c 726f4320 4d542865
80000003 37692029 55504320 20202020 20202020
80000004 30363820 20402020 30382e32 007a4847
80000005 00000000 00000000 00000000 00000000
80000006 00000000 00000000 01006040 00000000
80000007 00000000 00000000 00000000 00000000
80000008 00003024 00000000 00000000 00000000
Vendor ID: "GenuineIntel"; CPUID level 5
Intel-specific functions:
Version 000106e5:
Type 0 - Original OEM
Family 6 - Pentium Pro
Model 30 - Intel Corei7 or Xeon processor, 45nm
Stepping 5
Reserved 0
Extended brand string: "Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz"
CLFLUSH instruction cache line size: 8
Initial APIC ID: 1
Hyper threading siblings: 4
Feature flags: 178bfbff:
FPU Floating Point Unit
VME Virtual 8086 Mode Enhancements
DE Debugging Extensions
PSE Page Size Extensions
TSC Time Stamp Counter
MSR Model Specific Registers
PAE Physical Address Extension
MCE Machine Check Exception
CX8 COMPXCHG8B Instruction
APIC On-chip Advanced Programmable Interrupt Controller present and enabled
SEP Fast System Call
MTRR Memory Type Range Registers
PGE PTE Global Flag
MCA Machine Check Architecture
CMOV Conditional Move and Compare Instructions
FGPAT Page Attribute Table
PSE-36 36-bit Page Size Extension
CLFSH CFLUSH instruction
MMX MMX instruction set
FXSR Fast FP/MMX Streaming SIMD Extensions save/restore
SSE Streaming SIMD Extensions instruction set
SSE2 SSE2 extensions
HT Hyper Threading
Feature flags set 2: 00000201:
SSE3 SSE3 extensions
SSSE3 Supplemental Streaming SIMD Extension 3
Extended feature flags: 28100800:
SYSCALL SYSCALL/SYSRET instructions
XD-bit Execution Disable bit
RDTSCP RDTSCP and IA32_TSC_AUX are available
EM64T Intel Extended Memory 64 Technology
Extended feature flags set 2: 00000001:
LAHF LAHF/SAHF available in IA-32e mode
TLB and cache info:
5a: Data TLB: 2MB or 4MB pages, 4-way set associative, 32 entries
03: Data TLB: 4KB pages, 4-way set assoc, 64 entries
55: Instruction TLB: 2MB or 4MB pages, fully assoc., 7 entries
e4: 3rd-level cache: 8MB, 16-way set associative, 64-byte line size
b2: Instruction TLB: 4-KB Pages, 4-way set associative, 64 entries
f0: 64-byte prefetching
2c: 1st-level data cache: 32-KB, 8-way set associative, 64-byte line size
21: 256-KB L2 (MLC), 8-way set associative, 64 byte line size
ca: Shared 2nd-level TLB: 4-KB Pages, 4-way set associative, 512 entries
09: 1st-level instruction cache: 32KB, 4-way set assoc, 64 byte line size
Processor serial: 0001-06E5-0000-0000-0000-0000
我认为您要查找的值是“处理器序列”。因此,一个简单的cpuid |grep "Processor serial"
方法就可以了。
正如您所说,您无法在服务器上安装某些东西,但您仍然可以:
- 找到一个安静的地方
/tmp
(如果你想保持低痕迹/垃圾), 获取预编译包:
fetch ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages/misc/cpuid-3.3_6.tbz
(使用您的服务器架构调整 URL - 请参阅
uname -a
以了解更多信息)从中提取“cpuid”二进制文件:
tar -jxvf cpuid-3.3_6.tbz bin/cpuid`
并在本地执行:
./bin/cpuid