⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bios.c

📁 Linux下的系统信息获取
💻 C
字号:
/* Copyright (C) 2001-2001 Fujitsu Siemens Computers   Joachim Braeuer   This file is part of smbios   smbios is free software; you can redistribute it and/or modify it   under the terms of the GNU General Public License as published by   the Free Software Foundation; either version 2 of the License,   or (at your option) any later version.   smbios is distributed in the hope that it will be useful, but WITHOUT   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   for more details.   You should have received a copy of the GNU General Public License   along with smbios; see the file COPYING. If not, write to the   Free Software Foundation, Inc., 59 Temple Place - Suite 330,   Boston, MA 02111-1307, USA.*//* $Log: bios.c,v $/* Revision 1.1  2001/09/15 14:52:43  bretthauert/* initial release/* *//** \file bios.c *  DMI-BIOS and SM-BIOS access functions *  The functions defined in this file provide low level access to the BIOS *  area that is comform to the DMI BIOS Specification or the SM-BIOS *  specification, respectively. *   *  \author Markus Lyra *  \author Thomas Bretthauer *	\author Joachim Braeuer *  \version 0.11 *  \date January 2001 */#ifndef __KERNEL__#  define __KERNEL__#endif#ifndef MODULE#  define MODULE#endif#define __NO_VERSION__		/* don't define kernel_verion in module.h */#include <linux/module.h>#include <linux/kernel.h>	/* ... for 'printk()' */#include <linux/errno.h>	/* ... error codes */#include <linux/types.h>	/* ... fixed size types definitions, '__u8'... */#include <linux/proc_fs.h>	/* ... for 'struct proc_dir_entry' */#include <linux/string.h>	/* ... for 'memcpy()', 'strncmp()' */#include "strgdef.h"        /* ... contains the string definitions for the cooked mode */#include "bios.h"		    /* ... local declarations for DMI-, SM-BIOS */#include "cooking.h"	    /* ... local declarations for interpreting DMI- and SM-BIOS types */EXPORT_NO_SYMBOLS;/* *  Global data *//** SM-BIOS, resp. DMI-BIOS /proc/smbios directory */struct proc_dir_entry *smbios_proc_dir = 0;/** SM-BIOS, resp. DMI-BIOS /proc/smbios/raw directory */struct proc_dir_entry *smbios_raw_proc_dir = 0;/** SM-BIOS, resp. DMI-BIOS /proc/smbios/cooked directory */struct proc_dir_entry *smbios_cooked_proc_dir = 0;/** SM-BIOS, resp. DMI-BIOS virtual base address of F-Segment */void *smbios_base = 0;/** SM-BIOS entry point structure */smbios_entry_point_struct *smbios_entry_point = 0;/** DMI-BIOS entry point structure */dmibios_entry_point_struct *dmibios_entry_point = 0;/** SM-BIOS, resp. DMI-BIOS structures base address; starting point */void *smbios_structures_base = 0;/** enumeration of SM-BIOS, resp. DMI-BIOS types that do have subtypes */__u8 smbios_types_with_subtypes[] = { TYPES_WITH_SUBTYPES };/** contains the SMBIOS Version, e.g. V2.31 */char smbios_version_string[32];/* *  Functions *//** \fn smbios_entry_point_struct * smbios_find_entry_point (void *base)  * \brief find the SM-BIOS entry point structure   * \param base virtual base address of physical F-segment address   * \return pointer to the SM-BIOS entry point structure  *  * this function searches the BIOS F-segement (physical address 0x000f0000  * to 0x000fffff) for the SM-BIOS entry point signature '_SM_'.  *  * \author Markus Lyra  * \author Thomas Bretthauer  * \date October 2000  */smbios_entry_point_struct *smbios_find_entry_point (void *base){    smbios_entry_point_struct *entry_point = 0;	/** SM-BIOS entry point */    unsigned long *temp;				        /** temp. pointer       */    /* search for the magic dword - '_SM_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -