jaypipes / ghw

Go HardWare discovery/inspection library
Apache License 2.0
1.62k stars 174 forks source link

implement PCI module on Windows #322

Open fangdichan opened 2 years ago

fangdichan commented 2 years ago

I try this on win10, but it gives me that error: pciFillInfo not implemented on windows

R4v3nl0 commented 1 year ago

Same on windows 11.

ffromani commented 1 year ago

Hi @fangdichan this is unfortunately not a bug but an implementation gap. We would need contribution to enable the PCI device lookup on windows, because none of active contributors is a windows user.

allberson commented 1 year ago

@fromanirh is there some prevision on when this functionality will be available? Is there a way to run ghw on windows whithout the implementation of pciFillInfo?

ffromani commented 1 year ago

@fromanirh is there some prevision on when this functionality will be available? Is there a way to run ghw on windows whithout the implementation of pciFillInfo?

AFAIK noone is working on this, but we'll gladly accept patches (cc @jaypipes ). You can totally use parts of ghw on windows, for some of them there is already support on windows, and what's supported will be kept.

allberson commented 1 year ago

@fromanirh sorry for the inconvenience, but how to I compile (make) ghw without specific modules, like pciFillInfo?

ffromani commented 1 year ago

@fromanirh sorry for the inconvenience, but how to I compile (make) ghw without specific modules, like pciFillInfo?

no problem at all :) if you import the ghw packages in your project, you can just import the packages you need [1] If you need to use the ghwc tool - https://github.com/jaypipes/ghw/tree/main/cmd/ghwc you can't compile out packages yet, but you can use some of the subcommands, for example cpu and they should work on windows. Unfortunately I don't have a list handy of what works on windows, being myself a linux user.[2]

+++

[1] 
import (
    "github.com/jaypipes/ghw/pkg/cpu"
    "github.com/jaypipes/ghw/pkg/option"
)

[2]
$ go run cmd/ghwc/main.go  help

          __
 .-----. |  |--. .--.--.--.
 |  _  | |     | |  |  |  |
 |___  | |__|__| |________|
 |_____|

Discover hardware information.

https://github.com/jaypipes/ghw

Usage:
  ghwc [flags]
  ghwc [command]

Available Commands:
  baseboard   Show baseboard information for the host system
  bios        Show BIOS information for the host system
  block       Show block storage information for the host system
  chassis     Show chassis information for the host system
  cpu         Show CPU information for the host system
  gpu         Show graphics/GPU information for the host system
  help        Help about any command
  memory      Show memory information for the host system
  net         Show network information for the host system
  pci         Show information about PCI devices on the host system
  product     Show product information for the host system
  topology    Show topology information for the host system
  version     Display the version of gofile

Flags:
      --debug           Enable or disable debug mode
  -f, --format string   Output format.
                        Choices are 'json','yaml', and 'human'. (default "human")
  -h, --help            help for ghwc
      --pretty          When outputting JSON, use indentation

Use "ghwc [command] --help" for more information about a command.