Re:Linux Kernel Module Programming Guide
by SilverRed on Tuesday August 24, 2021 @02:40AM
(#28285774)
So you would basically either have to be from the company that made the hardware, or have the full documentation for it, or be an insanely talented reverse engineer.
[ Parent
| on HN ]
Re:Linux Kernel Module Programming Guide
by goodcanadian on Tuesday August 24, 2021 @03:07AM
(#28285898)
Well, the one good example I have from a few years ago was a relatively simple ADC PCI card. I did have documentation from the company. They had a Windows driver, but for Linux, their advice was direct memory writes (which requires root privileges). I didn't want the application to run as root, so I wrote a Linux diver for the card.
Re:Linux Kernel Module Programming Guide
by mytailorisrich on Tuesday August 24, 2021 @04:27AM
(#28286309)
You need to have the datasheet.
These are usually a Google search away and the way people develop drivers even in professional settings.
For simple devices (e.g. I2C/SPI sensors) the functionality, number of registers, and procedures are usually very limited and it is not difficult.
For simple devices probably user space is just fine.
i.e. https://www.kernel.org/doc/Documentation/spi/spidev
Usually only if you need an IRQ or something does it require kernel space.