I have a throw-away cheap laptop I'd like to twiddle around, a Thinkpad SL 500.

What bothers me are two leds, the one for wireless connectivity, and the one for hibernation, which don't light up at all, although they're functional, I've tried it on windows.

So I would like to write a kernel driver for them, nothing big, it just looks like a good idea to play around with the kernel.

My question is what methodology should I follow systematically to find out what devices are responsible for those leds (in general, not necessarily specific to my hardware), and what drivers are responsible for the other two leds that work, bluetooth and the battery indicator?

And when I say methodology, I really mean the methodology, step by step, with reasons for each step, like in the answer I've gave to someone else over here: What does && mean in void *p = &&abc;

I am profficient at fgrepping through big code repositories, using static code analysers & co, but I think my lack of hardware knowledge hinders me on this problem.

PS: I'm using ArchLinux, so almost the latest kernel version.

  • Have you tried enabling CONFIG_IDEAPAD_LAPTOP in kernel? – Paweł Rumian Sep 7 '12 at 8:47
  • @gorkypl: no, why would I? The question is not about solving the problem, it's about the strategy used to solve the problem myself (as a programmer). – Flavius Oct 21 '12 at 12:00
  • 3
    OK, I have misunderstood you. Anyway, as the IDEAPAD_LAPTOP kernel module is responsible for such things in SL series of Thinkpads, you can start from looking at its source code. Also, you may be interested in some reading, for example on kernelnewbies: kernelnewbies.org/KernelHacking or a great book written by LKH: kroah.com/lkn Two other good sources that come to my mind are: lwn.net/Kernel/LDD3 and amazon.com/dp/0596005652/?tag=stackoverfl08-20 – Paweł Rumian Oct 21 '12 at 15:22

What methodology should I follow systematically to find out what devices are responsible for those LEDs?

Ideally, you should find (open) source of kernel OS on which your laptop LEDs are working, then you could just comment out part by part of kernel until you locate code which is responsible for LEDs (and having a few system freezes doing that, but that's the fun part).

If LEDs are not working on Linux and you do not know which hardware is driving them on other OS's, how do you think you'll write a driver?

That is best answer anybody could give, I'm afraid, and that makes you (almost) nothing more clever than before. Just points you that you need to find out exactly which hardware you have, to be able to do something more.

To be of more help, two pointers:

  1. One of often used IDE or SATA chips is Intel's series ICHX or ICHXr (ICH5, ICH6, ICH7 ... or ICH6R, ICH7R,...).

  2. Linux kernel directory where is located source code for controlling lot of LEDs

I would give you 3rd pointer also, but as this gorkypy already wrote above, I can just repeat: Linux device drivers, 3rd edition, in PDF, for free.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.