Getting Hardware information in Linux

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting Hardware information in Linux

ik-6
Hello list,

I'm trying to figure out how to get hardware information about the machine i'm running at in Linux OS.
For example: hard-drive size, manufacture etc...
BIOS information, screen information (regardless of X, that is the hardware itself), cards that are assigned and the whole information about such cards.
Disks of any kind etc... CPU Information (can use the /proc/cpuinfo)

Does anyone know or can point me on how to do it ?

Thanks,
Ido


LINESIP - Opening the source for communication
http://www.linesip.com
http://www.linesip.co.il



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Getting Hardware information in Linux

Michael Van Canneyt


On Tue, 18 Oct 2011, ik wrote:

> Hello list,
>
> I'm trying to figure out how to get hardware information about the machine i'm running at in Linux OS.
> For example: hard-drive size, manufacture etc...
> BIOS information, screen information (regardless of X, that is the hardware itself), cards that are assigned and the
> whole information about such cards.
> Disks of any kind etc... CPU Information (can use the /proc/cpuinfo)
>
> Does anyone know or can point me on how to do it ?

use DBUS to query HAL. Normally you should get most of the info.

I wrote an article on how to do this in FPC. if you want, I can send it to you.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Getting Hardware information in Linux

ik-6
On Tue, Oct 18, 2011 at 21:44, Michael Van Canneyt <[hidden email]> wrote:


On Tue, 18 Oct 2011, ik wrote:

Hello list,

I'm trying to figure out how to get hardware information about the machine i'm running at in Linux OS.
For example: hard-drive size, manufacture etc...
BIOS information, screen information (regardless of X, that is the hardware itself), cards that are assigned and the
whole information about such cards.
Disks of any kind etc... CPU Information (can use the /proc/cpuinfo)

Does anyone know or can point me on how to do it ?

use DBUS to query HAL. Normally you should get most of the info.

HAL is deprecated :(
 

I wrote an article on how to do this in FPC. if you want, I can send it to you.

Sure, it can help me, thanks.
 

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Ido

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Getting Hardware information in Linux

Sven Barth-2
On 18.10.2011 21:50, ik wrote:

> On Tue, Oct 18, 2011 at 21:44, Michael Van Canneyt
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>
>
>     On Tue, 18 Oct 2011, ik wrote:
>
>         Hello list,
>
>         I'm trying to figure out how to get hardware information about
>         the machine i'm running at in Linux OS.
>         For example: hard-drive size, manufacture etc...
>         BIOS information, screen information (regardless of X, that is
>         the hardware itself), cards that are assigned and the
>         whole information about such cards.
>         Disks of any kind etc... CPU Information (can use the /proc/cpuinfo)
>
>         Does anyone know or can point me on how to do it ?
>
>
>     use DBUS to query HAL. Normally you should get most of the info.
>
>
> HAL is deprecated :(

You can then take a look at its successor, DeviceKit (see here:
http://en.wikipedia.org/wiki/DeviceKit ). According to the wiki entry
you might also try to take a look at "libudev". I've found a guide here:
http://www.signal11.us/oss/udev/ (I haven't read it and thus can't say
whether it's good or not).

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Getting Hardware information in Linux

Den Jean
In reply to this post by ik-6
On Tuesday 18 October 2011 19:36:48 ik wrote:
> Does anyone know or can point me on how to do it ?
read the output of lshw or read its source on how to do it yourself.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Getting Hardware information in Linux

Jorge Aldo G. de F. Junior
In reply to this post by ik-6
I think all this info can be found on /proc directory...

2011/10/18 ik <[hidden email]>:

> Hello list,
>
> I'm trying to figure out how to get hardware information about the machine
> i'm running at in Linux OS.
> For example: hard-drive size, manufacture etc...
> BIOS information, screen information (regardless of X, that is the hardware
> itself), cards that are assigned and the whole information about such cards.
> Disks of any kind etc... CPU Information (can use the /proc/cpuinfo)
>
> Does anyone know or can point me on how to do it ?
>
> Thanks,
> Ido
>
>
> LINESIP - Opening the source for communication
> http://www.linesip.com
> http://www.linesip.co.il
>
>
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Getting Hardware information in Linux

Graeme Geldenhuys-2
In reply to this post by Michael Van Canneyt
On 18/10/2011 21:44, Michael Van Canneyt wrote:
>
> use DBUS to query HAL. Normally you should get most of the info.
>
> I wrote an article on how to do this in FPC. if you want, I can send it to you.

Would you mind sending me that article too, please.

I'm using Turbo Power's OnGuard in our products, and improved the
hardware detection code under Linux (CPU, network card, OS, user, HDD
etc), but I did not use DBUS at all, I simply parsed the data in /proc/*
and /dev/disk/*

The hard drive make and serial number was a tough one, especially
without forcing root access, but I did manage. I also asked in the
mailing list about other distros and if they have the same /dev/disk/*
information, and most modern Linux distros did.



Regards,
  - Graeme -

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Getting Hardware information in Linux

Graeme Geldenhuys-2
In reply to this post by Den Jean
On 19/10/2011 00:31, Den Jean wrote:
> read the output of lshw or read its source on how to do it yourself.

problems with that is that to get most of the information you must run
lshw as super-user (root).

eg: Serial numbers, product codes, vendor names etc are all missing from
the output if you don't run it as root. :-(

I guess Linux takes security really serious when it comes to hardware
information.

Regards,
  - Graeme -

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Getting Hardware information in Linux

Žilvinas Ledas-2
In reply to this post by Michael Van Canneyt
Hello,

On 2011-10-18 22:44, Michael Van Canneyt wrote:
>
> use DBUS to query HAL. Normally you should get most of the info.
>
> I wrote an article on how to do this in FPC. if you want, I can send
> it to you.
>
Could you send it to me as well?


Regards,
Žilvinas Ledas

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal