Hello World

Burak on 2008-07-13T14:32:09

I don't know how long I've been a user in use Perl, but this is my first journal entry. Yay! :)

I've released Sys::Info 0.60 today. It's a milestone version that has mostly compatible Linux & Windows & Unknown (Generic) drivers. Windows OS driver now supports Windows Server 2008 and a lot of other Windows editions too. Windows Server 2008 support was a little bit tricky since Microsoft did not bump the version number with this os release (unlike Server 2003) and it has the same version number as Windows Vista. It is only detectable through the editions.

For the Windows driver, my original plan was to drop WMI interface and use Win32::API, however I've dropped Win32::API idea in favor of XS and WMI turned out to be some huge beast that can not be duplicated easily (or not at all). I was lost on MSDN on this subject :p

Linux driver also has improved OS support too. I've implemeted several OS meta keys and also tried to mimic the "Edition" information for distros. Currently, only Ubuntu is supported by the edition() method.

There is also a new cdkey() function to return the cdkeys for the OS and Office software. You can guess that this only has a meaning and only implemeted in the Windows driver :) It's basically a shortcut to learn the cdkey quickly in case you need it. Original code for that was taken from a PerlMonks thread.

There are some improvements on the CPU detection side too. Hyper Threading detection is improved and it now returns the number of threads if Hyper Threading is in effect. Also, the data structure now has the "architecture" key. However the load() method has a caveat it returns the current CPU usage instead of the load average (which does not exist in Windows anyway).

Sys::Info was initiated back in 2004 while I was supposed to write down my undergraduate thesis some time late at night (3 am Eternal :p) and evolved from that. The idea was to display the OS & CPU name (and HTTP Server name) correctly in a CMS system I was (and still -- I'm lazy --) working on, but this thing resulted with a module suite. The first CPAN release was two years later from that...

I'm trying to create a single and mostly equal interface between the OS specific drivers for system information but it turned out that this is not as easy as I thought back then.

Future plans:

  • Improving current drivers (Windows/Linux/Unknown).
    • - Maybe split the drivers into their own distros.
  • Creating a separate distro for Sys::Info::Device::BIOS
  • Adding support for some other devices
  • Create a mechanism for drop-in driver/device system.
  • (In a far far future) Create a *BSD driver (which I didn't even use once 'till now)
  • (In a far far future) If (somehow) I can have access to a Mac(book(\s?Pro|)?); create a MacOSX (darwin?) driver

Patches & Suggestions are welcome as always :)

perl -MSys::Info -wle "sub n{Sys::Info->os->name(@_)} print for n(),n(long=>1),n(edition=>1),n(edition=>1,long=>1)"
Example outputs:

(1)

Windows Server 2008
Windows Server 2008 Service Pack 1 build 6001
Windows Server 2008 Enterprise Edition Full Installation
Windows Server 2008 Enterprise Edition Full Installation Service Pack 1 build 6001

(2)

Windows Vista
Windows Vista Service Pack 1 build 6001
Windows Vista Enterprise Edition
Windows Vista Enterprise Edition Service Pack 1 build 6001

(3)

Windows XP
Windows XP Service Pack 3 build 2600
Windows XP Professional
Windows XP Professional Service Pack 3 build 2600

And here is an Ubuntu output ;)

perl -MSys::Info -wle 'sub n{Sys::Info->os->name(@_)} print for n(),n(long=>1),n(edition=>1),n(edition=>1,long=>1)'

Ubuntu Linux
Ubuntu Linux 8.04 (kernel: 2.6.24-19-generic)
Ubuntu Linux (Hardy Heron)
Ubuntu Linux (Hardy Heron) 8.04 (kernel: 2.6.24-19-generic)


Linux::Distribution spoils the party

Ron Savage on 2008-07-13T22:54:25

L::D crashes during testing under Debian, and after that it all downhill. See existing RT ticket for details.

Re:Linux::Distribution spoils the party

Burak on 2008-07-15T09:24:00

L::D has many bugs but the last update to that module is from 2006. I can't currently test Debian though :) Anyway, the bug you reported is related to my dumb version checker test, which seems unsuitable for Sys::Info. I should have released another underscore version before 0.60 :p Thanks for reporting.

After installing by force...

Ron Savage on 2008-07-14T00:42:56

I get:
Debian Linux
Debian Linux lenny/sid (kernel: 2.6.24-1-686)
Debian Linux
Debian Linux lenny/sid (kernel: 2.6.24-1-686)

That's good.

Any idea why the 2nd & 4th are the same? I.e. are they meant to be the same?

Re:After installing by force...

Burak on 2008-07-15T09:24:48

No they are not meant to be the same. 0.61 also addresses this issue :)