A semi-related question: do kernel modules play nicely with device-tree instantiations? Like let's say I wanted to instantiate an I2C with a custom driver in my device-tree. Can I put the controller's driver in a kernel module that lives in /lib/modules? Or do I need to compile it into the kernel?
The Linux Kernel Module Programming Guide
11–20 of 32 posts
Re: The Linux Kernel Module Programming Guide
#12A semi-related question: do kernel modules play nicely with device-tree instantiations? Like let's say I wanted to instantiate an I2C with a custom driver in my device-tree. Can I put the controller's driver in a kernel module that lives in /lib/modules? Or do I need to compile it into the kernel?
Re: The Linux Kernel Module Programming Guide
#13Earlier quoted context omitted.
RPi is barely embedded work. It's almost always micro-desktop Linux.
True. But there are some of us working on ARM platforms that aren't RPi that need to hack drivers. Anyone working with a SOM, for example, will want to customize the DT for their carrier board. And then your EE finds a cheaper controller chip somewhere. And then your display supplier switches captouch parts on you mid-production. Sorry, was I venting there? (And just a tip, don't break bad on the Pi here. For many pe…
Re: The Linux Kernel Module Programming Guide
#14Earlier quoted context omitted.
RPi is barely embedded work. It's almost always micro-desktop Linux.
True. But there are some of us working on ARM platforms that aren't RPi that need to hack drivers. Anyone working with a SOM, for example, will want to customize the DT for their carrier board. And then your EE finds a cheaper controller chip somewhere. And then your display supplier switches captouch parts on you mid-production. Sorry, was I venting there? (And just a tip, don't break bad on the Pi here. For many pe…
Which has nothing to do with RPi or embedded systems... Not sure if I understand.
>And just a tip, don't break bad on the Pi here. For many people this is the only ARM platform worth working with.
Ugh... Cell phones? Or any of the zillion of ARM development boards out there.
Re: The Linux Kernel Module Programming Guide
#15A semi-related question: do kernel modules play nicely with device-tree instantiations? Like let's say I wanted to instantiate an I2C with a custom driver in my device-tree. Can I put the controller's driver in a kernel module that lives in /lib/modules? Or do I need to compile it into the kernel?
Just make sure to run `depmod -a` after copying it into /lib/modules.
Re: The Linux Kernel Module Programming Guide
#16A semi-related question: do kernel modules play nicely with device-tree instantiations? Like let's say I wanted to instantiate an I2C with a custom driver in my device-tree. Can I put the controller's driver in a kernel module that lives in /lib/modules? Or do I need to compile it into the kernel?
Yep. The device tree and kernel modules are actually two seperate concepts - the former is just a data structure that describes the hardware for a system and the latter is a way of delivering the drivers independently of the kernel. Just make sure to run `depmod -a` after copying it into /lib/modules.
Re: The Linux Kernel Module Programming Guide
#17Just a warning if you do embedded work with Linux (RPi, Beaglebone, etc)... this guide doesn't cover the Devicetree APIs. Doesn't even acknowledge their existence.
Is there a guide for that?
Re: The Linux Kernel Module Programming Guide
#18In my opinion the best way to do kernel development is to just look at device drivers in kernel sources, study what current drivers do and write your own driver. The kernel supports su much heterogeneous devices and its APIs change continuously that it is practically impossible to write a complete guide on this topic.
Re: The Linux Kernel Module Programming Guide
#19A semi-related question: do kernel modules play nicely with device-tree instantiations? Like let's say I wanted to instantiate an I2C with a custom driver in my device-tree. Can I put the controller's driver in a kernel module that lives in /lib/modules? Or do I need to compile it into the kernel?