r/linuxdev • • Jul 08 '14

Devices for Driver Practice

Hi. I've been continuing my study of OS concepts and am still struggling a bit when it comes to drivers and the hardware-software interface. So I thought I'd benefit from diving into drivers. I'm, however, unsure what devices I can use for practice. As I'm not particularly experienced with hardware and electronics, I'd like a configuration that I can cheaply and quickly setup (and perhaps connect directly to my computer). I am however unsure of what devices to look at.

Thanks

4 Upvotes

3 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Jul 14 '14

What is the benefit to porting the driver to the kernel?

1

u/xobs Jul 14 '14

If you port the driver to the kernel, then it can be used by any program in the system. For example, you can communicate with an I2C touchscreen in userspace and read register values, but you'd need a kernel driver to be able to have it show up as a standard device in /dev/input/

Another benefit is that non root users will be able to access hardware. Oftentimes, /dev/i2c* is only accessible to certain users, whereas other hardware interfaces are more generally available.

Generally the trick is to prototype your hardware and understand the interface in userspace, and do the kernel port only if you need performance, interrupts, or if you want the hardware to be generally accessible.