SMBIOS (System Management BIOS) |
您所在的位置:网站首页 › sys是什么品牌 › SMBIOS (System Management BIOS) |
操作系统为了有效控制系统资源与正确显示信息,需要知道底层硬件的一些数据,但因为底层硬件厂商数百家,产品也是上万种,操作系统要想得知正确的信息就必须要透过BIOS的帮忙,这种方法就是SMBIOS Table。SMBIOS可以把它想像成是一堆纪录信息,BIOS在转交控制权给操作系统之前将所有相关资讯准备好,放在系统內存的某处,让操作系统去读取。 SMBIOS是种标准的业界规范:http://www.dmtf.org/standards/smbios 使用Dmidecode查找SMBIOS Table信息 查找SMBIOS Typedmidecode: option requires an argument -- 't' Type number or keyword expected Valid type keywords are: bios system baseboard chassis processor memory cache connector slot 查找CPU资讯Command:dmidecode -t processor Example Result(预设从sysfs 读取): Command:dmidecode -t processor -no-syfs Example Result(从EFI Memory Entry Point读取): 使用/sys/firmware/dmi/tables查找SMBIOS Table信息/sys/firmware/dmi/tables/下有两个file:DMI、smbios_entry_point。 smbios_entry_point:Binary format for SMBIOS接口基地址。DMI:存有整个SMBIOS的raw binary data。可以用hexdump命令查找。 Type 0: BIOS 使用memory address直接查找SMBIOS Table信息使用C语言读写memory。使用C语言函数open /dev/mem设备。devMem=open("/dev/mem",O_RDWR) 映射memory to use。mappedAddr=mmap(0,mapSize,PROT_READ, MAP_SHARED,devMem,pageStartAddr)pageStartAddr选择/sys/firmware/dmi/tables/smbios_entry_point所提供的基地址。 Base address to SMBIOS Type 0 (BIOS info) 0x6e928000这样就可以读写并解析SMBIOS table了。 Example Code Output: 等于下面hexdump /sys/firmware/dmi/tables/DMI的方式: |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |