Here on my Channel I put out some videos about GNU/Linux with a focus on applications for automation and Embedded Systems. But here are also some videos about some useful tools you can use on GNU/Linux.
Thanks for the video. I am studying the DMA engine and tried to replicate your work as in your video. I stuck at the line of dma_request_channel(mask,NULL,NULL) as it returns error but I have no idea how to fix. Are there anything I can try to print errors out with more details ?
what are the prerequisites for this course?. I know C, C++ and I am studying Computer Science. But my practical knowledge is not very good. I am trying to improve my skills.
hi getting this on pi 5 still Sean@raspberrypi:~/Programming/LinuxDeviceDriver $ make make -C /lib/modules/6.6.47+rpt-rpi-2712/build M=/home/Sean/Programming/LinuxDeviceDriver modules make[1]: Entering directory '/usr/src/linux-headers-6.6.47+rpt-rpi-2712' ERROR: Kernel configuration is invalid. include/generated/autoconf.h or include/config/auto.conf are missing. Run 'make oldconfig && make prepare' on kernel src to fix it. make[2]: *** [/usr/src/linux-headers-6.6.47+rpt-common-rpi/Makefile:817: include/config/auto.conf] Error 1 make[1]: *** [/usr/src/linux-headers-6.6.47+rpt-common-rpi/Makefile:246: __sub-make] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-6.6.47+rpt-rpi-2712' make: *** [makefile:4: all] Error 2
using a pi5, getting make file issues any idea, thx sean Sean@raspberrypi:~/Programming/LinuxDeviceDriver $ make --trace makefile:4: target 'all' does not exist make -C /lib/modules/6.6.47+rpt-rpi-2712/build M=/home/Sean/Programming/LinuxDeviceDriver modules make[1]: Entering directory '/usr/src/linux-headers-6.6.47+rpt-rpi-2712' /usr/src/linux-headers-6.6.47+rpt-common-rpi/Makefile:246: target '__sub-make' does not exist make --no-print-directory -C /usr/src/linux-headers-6.6.47+rpt-rpi-2712 \ -f /usr/src/linux-headers-6.6.47+rpt-common-rpi/Makefile modules /usr/src/linux-headers-6.6.47+rpt-common-rpi/Makefile:817: target 'include/config/auto.conf' does not exist test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \ echo >&2; \ echo >&2 " ERROR: Kernel configuration is invalid."; \ echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\ echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ echo >&2 ; \ /bin/false) /usr/src/linux-headers-6.6.47+rpt-common-rpi/arch/arm64/Makefile:59: update target 'stack_protector_prepare' due to: prepare0 /usr/src/linux-headers-6.6.47+rpt-common-rpi/Makefile:1819: update target 'prepare' due to: stack_protector_prepare if [ -z "y" ] && [ "gcc-12 (Debian 12.2.0-14) 12.2.0" != "gcc-12 (Debian 12.2.0-14) 12.2.0" ]; then \ echo >&2 "warning: the compiler differs from the one used to build the kernel"; \ echo >&2 " The kernel was built by: gcc-12 (Debian 12.2.0-14) 12.2.0"; \ echo >&2 " You are using: gcc-12 (Debian 12.2.0-14) 12.2.0"; \ fi /usr/src/linux-headers-6.6.47+rpt-common-rpi/Makefile:1946: update target '/home/Sean/Programming/LinuxDeviceDriver' due to: prepare make -f /usr/src/linux-headers-6.6.47+rpt-common-rpi/scripts/Makefile.build obj=/home/Sean/Programming/LinuxDeviceDriver need-builtin=1 need-modorder=1 /usr/src/linux-headers-6.6.47+rpt-common-rpi/scripts/Makefile.build:41: /home/Sean/Programming/LinuxDeviceDriver/Makefile: No such file or directory make[3]: *** No rule to make target '/home/Sean/Programming/LinuxDeviceDriver/Makefile'. Stop. make[2]: *** [/usr/src/linux-headers-6.6.47+rpt-common-rpi/Makefile:1946: /home/Sean/Programming/LinuxDeviceDriver] Error 2 make[1]: *** [/usr/src/linux-headers-6.6.47+rpt-common-rpi/Makefile:246: __sub-make] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-6.6.47+rpt-rpi-2712' make: *** [makefile:4: all] Error 2 Sean@raspberrypi:~/Programming/LinuxDeviceDriver $
Could you detail why `pgoff = phys_addr >> PAGE_SHIFT`? Is that because each page has an ID which is stored in the first PAGE_SIZE bits of each page (and that the allocated data "begins" only after - this is how I understand it)? Or a similar reason? What if you do `pgoff = phys_addr` instead of `pgoff = phys_addr >> PAGE_SHIFT`?
Thanks for these videos. Can you explain a little about what reference sources you use? For example, what do we do as developers if we do not already know the paramter order for gpio_direction_output() function? What is a good place to quickly look that kind of information up? The header file? manpages?
Hi Johannes, Thanks for these videos, they rock! I was wondering about why the buffer_pointer is updated to the to_copy value, rather than delta. If copy_from_user returns a non-zero not_copied result, would we not want the driver_read function to pick a to_copy value corresponding to the delta?
Thank you for touching on what the mode numbers mean! Another person said "just set this to '0666'" and I'm thinking "I know there's such a thing as a demon in computing, but this seems wrong"
For accessing them in userspace See ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-iZk1cDsIiiU.html I have a separate Playlist about pcie Drivers too: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-454KPcO95jY.htmlsi=SN4DewVHugUZ6kMA
I don't quite understand. Are there 2 types of DMA controllers? One inside PCI device (if device provides it) and another in CPU itself? And can I use any of them to copy data PCI <--> RAM or I have to rely on PCI device (to implement DMA inside) only?
Yes, that's true. The Processor normally comes with DMA controllers and PCI devices also can have DMA controllers built into them. This video shows you how to use the DMA controller of my emulated PCI device. I already made a video showing you how to use a DMA controller on an ARM based system. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-kl9c6DrDnHo.html Sadly I could find a good example for x86 yet.
You can find details to the workshops here: chemnitzer.linux-tage.de/2024/de/programm/beitrag/108 In Prague and Kiel I will basically give this workshop again.
whenever i try to do echo > 1 /dev/my_gpio_driver it doesnt change the value to 1 also there is an error shown in the kernel log as invalid input. can u help me with this?
I am facing the same error and this is the dmesg log when I print the value. [ 1051.874571] read_write - Device Nr. Major: 235, Minor: 1 was registered! [ 1062.880436] dev_nr - open was called! [ 1062.880516] Value is 49 [ 1062.880534] Value is 10 [ 1062.880541] Invalid Input! [ 1062.880575] dev_nr - close was called!
Only just been watching this - useful pointer on how to get the cp2112 board LED to switch on / off as a way of verifying operation. Just a point of interest: you can use i2cdetect -r -y 'bus-number' to get a listing of addresses via the cp2112 adapter.
How feasible would it be to port an existing Linux driver that you have the source code for to an older windows version? More specifically, Windows 98? The reason I ask is that I am kind of into retro computers and retro gaming and some of the old graphics cards that work in windows 98 are becoming increasingly rare and pricey. So having a driver even for a low end modern graphics card for win 98 would be extremely helpful.
Using this approach, is it possible to pass data from kernel to user space? Replacing the button by a temperature sensor, I get the temperature as an int allocated in kernel space memory: is it possible to pass this int (or a copy of it) to a user space application and covert it into an int allocated in user space memory?
I just found that pwm_request and pwm_free is deprecated and it's not found in Kernel v.6.6. May I ask for a tutorial? I try to find tutorial but nothing comes to mind.
Haha what are the odds that I started learning Ethernet and you dropped a series on this.. excellent. Keep going. A suggestion would be to improve audio quality as I can hear little even on full volume. Or maybe adjustments to mic gain levels would help Thanks