Input device driver

Bruno E. O. Meneguele bmeneguele at gmail.com
Fri Sep 29 20:19:05 EDT 2017


On 29-09, valdis.kletnieks at vt.edu wrote:
> On Fri, 29 Sep 2017 19:38:49 -0300, "Bruno E. O. Meneguele" said:
> 
> > 2) I'm using a USB keyboard as the testing device, and TBH I got
> > confused if I could actually use the input subsystem for that or I
> > _should_ use HID instead (considering the keyboard is HID compliant).
> 
> Step 0: Decide if you're writing an interrupt handling driver, a USB driver, or
> an HID driver - the three live at different levels of abstraction, and
> confusing them will also confuse both you and your kernel.
> 

I don't know why I didn't realize earlier the two counterparts:
interruption vs USB, USB devices are handled in polling mode, not
with IRQs.

So, I could try something else to dive in IRQ's world, like 'timers' or
stick with USB world for now, let's say I choose: USB driver in this
step.

> Step 1: Whichever level you decide on, your kernel probably already has a
> driver that will gladly grab onto a USB keyboard at that level.  Find out how
> to tell your kernel to not grab the device, as sharing a device between two
> drivers never works out well, no matter what abstraction you're using.
> 

Right.

> Step 2: Take a backup of your system, just in case (which you should be doing
> *anyhow* - neither spinning oxide disks nor flash-based drives are perfect).
> 

SSD here, I hope I don't destroy it :). But thanks for the advice.

> Step 3: Write the driver....

Sounds like a plan. 

If I had realized earlier about what I said in 'step 0' I could've
figured out why what I was trying to do wasn't working. Actually another
point I didn't pay attention was to the fact that i8042 is a PS/2
controller and not an USB one.. I'm using a USB keyboard attached to a
laptop which has the trackpad and keyboard as PS/2 devices, of course
things won't work.

Well, I'm sorry for that! But at same time thank you very much :)!

I think I'll be back soon, but hopefuly with better questions.

Thanks.

-- 
bmeneg 
PGP Key: http://bmeneg.com/pubkey.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170929/49f7896f/attachment-0001.bin 


More information about the Kernelnewbies mailing list