We can use
netstat to list all software ports,but how to list all hardware ports,is there such a tool?
well, they are 'different' ports - tcp ports are more in terms of IO than actual ports (USB, PCI slots ect)
If you want hardware information you can use lshw or (i believe ) dmidecode. If you want to know what's going on in terms of I/O in general you can use iotop