What's the best modern guide for hacking on the kernel?
I don't want to learn everything about the internals, I want to iterate on a module quickly.
I feel like I'm missing on a lot of optimizations to shorten the feedback loop.
What's the best modern guide for hacking on the kernel?
I don't want to learn everything about the internals, I want to iterate on a module quickly.
I feel like I'm missing on a lot of optimizations to shorten the feedback loop.
Adrian Vovk
in reply to Sonny • • •Not a kernel hacker so I don't know if it's the best, but this seems like a really nice tool to quickly iterate on the kernel coming out of systemd: https://github.com/DaanDeMeyer/mkosi-kernel
FOSSDEM talk announcing it & showing how it works: https://fosdem.org/2024/schedule/event/fosdem-2024-2209-streamlining-kernel-hacking-with-mkosi-kernel/
@daandemeyer
GitHub - DaanDeMeyer/mkosi-kernel
GitHubAlikates
in reply to Sonny • • •I don't know any good guides, but have a bit of experience with module development for pmOS devices.
What I did was building locally the full kernel and install it on the device together with the modules. Then modify the module, build it individually and push it through ssh to the device. Then in the device rmmod the module and insmod the new version.
Though if you access complex hw you might end up with a locked system and need to reboot. Happened to me a lot of times 😮💨
Sonny
in reply to Alikates • • •Alikates
in reply to Sonny • • •Normally when the kernel has to constantly keep track of the modules and underlying hw state ther could be issues (for example network or display drivers).
If its something simple like an i2c led driver it problably doesn't matter much. At worst the led stays turned on and the config will be overwritten when the module is reloaded
Alikates
in reply to Alikates • • •Sonny
in reply to Alikates • • •@alikates makes sense
I'm hacking on a couple of modules for virtual buttons and GPIOs to get a tablet mode switch working.
That should be fine.
Alikates
in reply to Sonny • • •Good luck with it!