我不确定物理端口到底是什么意思。dmidecode可以列出连接器,
# dmidecode --type 8
# dmidecode 2.12
SMBIOS 2.5 present.
Handle 0x0004, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator:
Internal Connector Type: None
External Reference Designator: EXTERNAL MONITOR PORT
External Connector Type: DB-15 female
Port Type: Other
Handle 0x0005, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator:
Internal Connector Type: None
External Reference Designator: BUILT-IN LAN PORT
External Connector Type: RJ-45
Port Type: Network Port
Handle 0x0006, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator:
Internal Connector Type: None
External Reference Designator: USB PORT
External Connector Type: Access Bus (USB)
Port Type: USB
Handle 0x0007, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator:
Internal Connector Type: None
External Reference Designator: USB PORT
External Connector Type: Access Bus (USB)
Port Type: USB
Handle 0x0008, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator:
Internal Connector Type: None
External Reference Designator: USB/eSATA PORT
External Connector Type: Access Bus (USB)
Port Type: USB
Handle 0x0009, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator:
Internal Connector Type: None
External Reference Designator: HEADPHONE JACK
External Connector Type: Mini Jack (headphones)
Port Type: Other
Handle 0x000A, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator:
Internal Connector Type: None
External Reference Designator: HDMI-CONNECTOR
External Connector Type: Other
Port Type: Video Port
Handle 0x000B, DMI type 8, 9 bytes
Port Connector Information
Internal Reference Designator:
Internal Connector Type: None
External Reference Designator: MICROPHONE JACK
External Connector Type: Other
Port Type: Other
或系统插槽
# dmidecode --type 9
# dmidecode 2.12
SMBIOS 2.5 present.
Handle 0x000C, DMI type 9, 13 bytes
System Slot Information
Designation: SD CARD
Type: Other
Current Usage: In Use
Length: Other
Characteristics:
3.3 V is provided
Hot-plug devices are supported
Handle 0x000D, DMI type 9, 13 bytes
System Slot Information
Designation: EXPRESS CARD
Type: x1 PCI Express
Current Usage: In Use
Length: Other
ID: 1
Characteristics:
3.3 V is provided
Hot-plug devices are supported
你还需要什么?您可以在dmidecode的sourceforge页面上找到所有相关代码