4 ms·
This... is really helpful. I've been trying to contribute some drivers for Pine64 devices lately and am trying to get up to speed on Linux Kernel development. T
by packetlost 4y ago
This... is really helpful. I've been trying to contribute some drivers for Pine64 devices lately and am trying to get up to speed on Linux Kernel development. There's... a lot.
Does anyone know if this is up to date with current Linux best practices?
- smashed 4y agoAccording to the github readme, the guide has been around since 2001 but it seems fairly up to date.. There are numerous discussion going on the issue tracker, about adding rust chapter, targeting linux 6.1, etc.. Very cool to see github issues and pull request actively used to keep a guide up to date. The guide will walk you through the basic of a kernel module. Exposing virtual files under /proc or /sys or messing around with system calls. It will fall short of helping you with the nitty gritty of writing an hardware driver though. The problem with writing drivers is that you are interfacing with a real-world machine for which you will have very little information about. Pick a device similar to the one you want to support, but that is already supported in linux. Go look at its source code. This will tell you far more about the work involved. You might realize that there is simply not enough information available to support the driver.
- megous 4y agoNo, it's not uptodate. But it's probably good enough to learn about basic concepts. For the devices you're talking about, you'll need to learn about device trees (didn't exist in 2001 at all in Linux), power management, etc.
- packetlost 4y agoI've been reading up on DTS stuff already, there's some resources out there, but all of the "kernel developer guides" seem to predate that by a fair bit. I suppose I'll have to familiarize myself with U-Boot as well...
- megous 4y agoU-Boot has a sort of baby device model implementation. :) Simpler and perhaps easier to grok than Linux, but using the identical DT based HW representation Linux uses later on during boot (it may even modify DTB a bit in memory to pass some information to kernel). OTOH, depending on platform it may mix this device model with some ad-hoc/hardcoded knowledge about the platform and ifdef mess[1], that is otherwise properly described by DT in Linux. So it can be a mixed bag. [1] eg. https://xff.cz/git/u-boot/tree/board/sunxi/board.c https://xff.cz/git/u-boot/tree/board/sunxi/board.c