文章目录
-
- 简介
- 核心结构
- 扫描设备原理
-
- scan_abi
- scan_burner
- scan_cdrom
- scan_cpufreq
- scan_cpuid
- scan_cpuinfo
- scan_device_tree
- scan_disk
- scan_display
- scan_dmi
- scan_fat
- scan_fb
- scan_graphics
- scan_ide
- scan_ideraid
- scan_input
- scan_isapnp
- scan_lvm
- scan_memory
- scan_mmc
- scan_mounts
- scan_network
- scan_nvme
- scan_parisc
- scan_partitions
- scan_pci、scan_pci_legacy
- scan_pcmcialegacy
- scan_pcmcia
- scan_pnp
- scan_s390_devices
- scan_scsi
- scan_smp
- scan_sound
- scan_spd
- scan_sysfs
- scan_usb
- scan_vio
- scan_virtio
- scan_volume
- 总结
- 参考
简介
lshw: HardWare LiSter for Linux 一般用来查看linux设备的硬件信息,包括内存、cpu、主板等信息。
$ lshw --help
Hardware Lister (lshw) -
usage: lshw [-format] [-options ...]
lshw -version
-version print program version ()
format can be
-html output hardware tree as HTML
-xml output hardware tree as XML
-json output hardware tree as a JSON object
-short output hardware paths
-businfo output bus information
options can be
-class CLASS only show a certain class of hardware
-C CLASS same as '-class CLASS'
-c CLASS same as '-class CLASS'
-disable TEST disable a test (like pci, isapnp, cpuid, etc. )
-enable TEST enable a test (like pci, isapnp, cpuid, etc. )
-quiet don't display status
-sanitize sanitize output (remove sensitive information like serial numbers, etc.)
-numeric output numeric IDs (for PCI, USB, etc.)
-notime exclude volatile attributes (timestamps) from output
代码:https://ezix.org/src/pkg/lshw.git
核心结构
class hwNode
{
public:
hwNode(const string & id,
hw::hwClass c = hw::generic,
const string & vendor = "",
const string & product = "",
const string & version = "");
hwNode(const hwNode & o);
~hwNode();
hwNode & operator =(const hwNode & o);
string getId() const;
void setHandle(const string & handle);
string getHandle() const;
bool enabled() const;
bool disabled() const;
void enable();
void disable();
bool claimed() const;
void claim(bool claimchildren=false);
void unclaim();
hw::hwClass getClass() const;
const char * getClassName() const;
void setClass(hw::hwClass c);
string getDescription() const;
void setDescription(const string & description)