sysctl question

2010-07-12 Thread Andreas Tobler

Dear all,

I have an issue here, I do read a temperature sensor and I got a value 
back, in integer. This value is 'encoded', it contains the integer and 
the fractional part of the temperature I read.


This is inside a kernel module. I offer a sysctl interface to read this 
value. Currently the access is done with sysctl_handle_int.


In my userland application I can print this value with the following macro:

FIX32TOPRINT(f) ((f) >> 16),f) & 0x) * 1000) >> 16)

But now I wonder how can I teach the sysctl to print my tempreature the 
same way as my userland app does.


Right now it looks this way:
dev.sm.1.sensor.cpu_b_ad7417_amb.temp: 2736128

If I feed this 2736128 into the macro above I get this:

41.750 this is what I expect.

Is this even possible?

TIA for any pointer.

Andreas
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: sysctl question

2010-07-13 Thread Andreas Tobler

On 13.07.10 10:48, Ed Schouten wrote:

* Andreas Tobler  wrote:

But now I wonder how can I teach the sysctl to print my tempreature
the same way as my userland app does.


I seem to remember all the other temperature sensors expose their value
using tenth Kelvin precision. There is some kind of modifier you can add
to the SYSCTL_INT declaration to denote that it's a temperature value.
The sysctl(8) code on HEAD seems to suggest the type is "IK".


Thanks Ed!

I need to figure out how to format my temperature value to fit with this 
modifier.


Regards,
Andreas
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


ad7418 developer/users?

2010-10-15 Thread Andreas Tobler

Hi all,

I wrote a driver for my PowerMac7,2 which reads temperature and adc 
values from an ad7417, an ad7418 with four adc's.


This driver would be ready for submission, but now I think about if it 
would make sense to bring these two drivers into the same source.


For this idea I'd need some testers who have an ad7418. I saw the driver 
is used on some ARM configs.


Anyone who has opinions, hw to test?

Any help is appreciated.

Thanks,
Andreas
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


kernel dumps on powerpc/pmap questions

2011-04-03 Thread Andreas Tobler

Hello all,

to investigate a system lockup I need to implement kerneldumps on 
powerpc. Well, exactly on PowerMacs. The booke should already support 
this feature.


Right now I'm at the point where I can dump something, means the 
mechanism to be able to get a (core) dump for example via 'call doadump' 
in db works. I can restore the dump via savecore.


I took the approach from booke and implemented the necessary functions 
for PowerMacs. But here I'm offline.


I do not understand what I want to dump, means which part of the memory.
Once I know what to dump, where do I find the information, which addresses?

How can I get a picture of the memory organization form powermacs?
Is there a pointer available about pmap in the kernel to find out a bit 
more on this topic?


What is really needed to be able to run kgdb on a core file to be able 
to find where the kernel crashed?


I know the questions are a bit vague, but I need an entry point.

I appreciate any pointer to implement this feature.

Tia,
Andreas
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"