State of kdefx
Kevin Ottens
ervin at kde.org
Tue Jul 31 00:32:18 BST 2007
Le mardi 31 juillet 2007, Matthew Woehlke a écrit :
> Kevin Ottens wrote:
> > Well, seeing it's very low level and the amount of code, it'd be best to
> > port this as a HAL probing addon... Shouldn't be that difficult. And then
> > it's trivial to expose via solid.
>
> Ok. But I am increasingly lost how to go about that, my ability to do
> something unaided is going down, down... :-)
Well, basically if you checkout HAL code, you'll see a few "probers" in
hald/*/probing (* currently being solaris, freebsd or linux). My first idea
was to add one for the processor, it'd basically be a small program doing the
probing on a given processor and calling
libhal_device_property_strlist_append() to add info on the right object
there.
But, looking closer at the situation, since the operation is not supposed to
be slow a prober would be overkill, you can probably implement this in the
backends (hald/linux/acpi.c, hald/freebsd/hf-devtree.c and
hald/solaris/devinfo_misc.c). That'd cover most of the unix cases I guess.
> > Advantages of doing it this way is that the
> > probing of the processor would be done only once in the system, not each
> > time an application ask for the information.
>
> I was going to complain that 'CPUID' is much cheaper than a function
> call. Then I looked at kcpuinfo.cpp :-).
>
> Actually to do this well is even worse than the current kdefx code,
> because you have to (at least, you would be nice to ;-) ) support MS and
> Solaris compilers also (and maybe others?), but I'd still trust that
> over /proc/cpuinfo (which is brittle on Linux and non-existant on other
> OS's, at least on Windows). I can (and would be happy to) help with that
> much at least.
For the record, hald/linux/acpi.c already reads some stuff in /proc/cpuinfo.
And yes, I didn't think about the Windows case at first... I'd say: implement
the probing in HAL for the unix cases (see above), and implement the probing
in the Windows backend of libsolid for the Windows case (note that nobody
stepped up to write such a backend yet).
Regards.
--
Kévin 'ervin' Ottens, http://ervin.ipsquad.net
"Ni le maître sans disciple, Ni le disciple sans maître,
Ne font reculer l'ignorance."
More information about the kde-core-devel
mailing list