现在有个任务就是获取硬件的序列号::获取CPU的序列号/硬盘序列号(IDE/SCSI)/ 获取网卡地址/获取主板序列号
我在网上搜了很多代码,部分已经在linux下编译通过,但只有一些可以得到结果,而有部分得到的是错误的号码.
我发现windows优化大师做的很好,打开后里面什么序列号都有,请问他是怎么做到的呢?
另外我查阅了dmidecode的文档,还有SMBIOS的文档,我想通过读取DMI table来获得大部分硬件信息,可是我发现硬盘序列号以及网卡号却不在其中.
我该如何做呢?请提示一下.
|
[root@localhost ~]# dmesg
Linux version 2.6.18-128.1.10.el5 (mockbuild@builder16.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)) #1 SMP Thu May 7 10:39:21 EDT 2009
BIOS-provided physical RAM map:
。。。。。。。。。。。。。
BIOS-e820: 00000000ff800000 - 0000000100000000 (reserved)
127MB HIGHMEM available.
896MB LOWMEM available.
Memory for crash kernel (0x0 to 0x0) notwithin permissible range
disabling kdump
。。。。。。。。。。。。。。。。
alg: No test for crc32c (crc32c-generic)
ksign: Installing public key data
Loading keyring
- Added public key AA1487A03717BEE2
- User ID: CentOS (Kernel Module GPG key)
io scheduler noop registered
i。。。。。。。。。。。。。。。fffffff
pcmcia: parent PCI bridge Memory window: 0xe8000000 - 0xefffffff
u。。。。。。。。。。。。。。。。
NET: Registered protocol family 15
intel_rng: FWH not detected
padlock: VIA PadLock not detected.
padlock: VIA PadLock not detected.
m。。。。。。。。。。。。。。
[drm] Setting GART location based on new memory map
[drm] writeback test succeeded in 2 usecs
eth1: no IPv6 routers present
trr: 0xe0000000,0x8000000 overlaps existing 0xe0000000,0x2000000
mtrr: 0xe0000000,0x8000000 overlaps existing 0xe0000000,0x2000000
mtrr: 0xe0000000,0x8000000 overlaps existing 0xe0000000,0x2000000
agpgart: Found an AGP 2.0 compliant device at 0000:00:00.0.
agpgart: Putting AGP V2 device at 0000:00:00.0 into 1x mode
agpgart: Putting AGP V2 device at 0000:01:00.0 into 1x mode
详细不?
|
很多硬件信息都在/proc接口下,如cpu的信息,相关硬件的驱动都在/sys目录下面,一般都归好类的
|
其实基本上/proc里面都有了
|
用dmesg就什么都看得到啦