Let's code a Linux Driver: 1: A minimal Hello World Linux Kernel Module

  Рет қаралды 6,845

Johannes 4GNU_Linux

Johannes 4GNU_Linux

Күн бұрын

Пікірлер: 35
@jholloway77
@jholloway77 Ай бұрын
Oh hells yeah!!! I've decided to not only do these projects on a linux box, but to recreate each of the drivers you make on a FreeBSD machine. That way not only will I learn in a more hands on way, but I can compare and contrast the different *nix systems
@ExplosiveAnyThing
@ExplosiveAnyThing Ай бұрын
I am really excited about the new series. I followed the old one but I am very hyped for this and I will definitely follow this one as well! Thank you very much for this!
@sergiogcollado
@sergiogcollado Ай бұрын
First comment? Thanks for the video Johanes! ❤
@rodrigoolmos9202
@rodrigoolmos9202 Ай бұрын
So good video dude 😊
@cat_dev_random
@cat_dev_random Ай бұрын
This video series came at a great time! I'm looking at writing a custom tty line-discipline module that extends n_tty, so I can do ^K (ctrl+k) to send SIGKILL just like ^C (ctrl+c) sends SIGINT Partially an exercise, but at the same time useful
@ΝίκοςΙστοσελίδα
@ΝίκοςΙστοσελίδα Ай бұрын
The first of the updated videos? Congrats!
@johannes4gnu_linux96
@johannes4gnu_linux96 Ай бұрын
Yes, the first of the new ones. More are coming :)
@ΝίκοςΙστοσελίδα
@ΝίκοςΙστοσελίδα Ай бұрын
@@johannes4gnu_linux96 Just one question, does the old video about installing the necessary tools still hold with updated versions, or did I miss a video?
@johannes4gnu_linux96
@johannes4gnu_linux96 Ай бұрын
@@ΝίκοςΙστοσελίδα This video is still valid for setting up everything on Raspberry Pi OS: kzbin.info/www/bejne/iHvVYZZqmdV-rqs
@adedayoeniola2118
@adedayoeniola2118 Ай бұрын
Welldone Johannes, this is so much better
@fluctura
@fluctura Ай бұрын
Nice, thank you! I remember fixing a sound driver for Linux 2.4 in 2003 or so.. was fun. I since moved on to macOS but it's nice to see the modern Linux way -- it's EXACTLY like it used to be 20 years ago haha -- schöne Grüße.. und aufpassen.. deine Website hat kein Impressum..
@anthony2623
@anthony2623 Ай бұрын
its great you are using Raspberry pi for your kernel module. It's a common board in my opinion
Ай бұрын
Well done. Thanks!
@jamesross3939
@jamesross3939 Ай бұрын
Liked and subscribed!
@0x8F
@0x8F Ай бұрын
Great video! I noticed that I can do 'sudo rmmod hello' without specifying the .ko file, I guess that is using the running module name directly
@johannes4gnu_linux96
@johannes4gnu_linux96 Ай бұрын
Yes, that is also possible. The module name of a loaded module or the path and filename of the module can be used to remove the module. We will dive into this a little bit more in the next video.
@jeffinphilip3876
@jeffinphilip3876 29 күн бұрын
How did you navigate to /build? There isn't even a file or directory named build when we see the ls command
@nikolasemov2822
@nikolasemov2822 27 күн бұрын
PLS correct me if I am wrong but : Thats the command: cd /lib/modules/$(uname -r)/build . If you don't find it make sure that you have installed the kernel headers (sudo apt install raspberrypi-kernel-headers).
@jeffinphilip3876
@jeffinphilip3876 27 күн бұрын
I'm working on a x84 machine, FYI. Is something different for that configuration?
@johannes4gnu_linux96
@johannes4gnu_linux96 16 күн бұрын
Yes, thats correct.
@johannes4gnu_linux96
@johannes4gnu_linux96 16 күн бұрын
On an x86 machine the package name for the kernel headers is different. E.g. for debian based distros it should be linux-headers-$(uname -r)
@Optmzdlyz
@Optmzdlyz Ай бұрын
Hey Johannes What would be the difference between using Static variable for the module init and exit functions vs not using one? We do not need them to retain their value after the driver is unloaded so we can just use int only?
@johannes4gnu_linux96
@johannes4gnu_linux96 Ай бұрын
In the next video I explain it in more details. But basically static only reduces the visibility and linkage of the function. If I declare them static, they can only be used within the module.
@Optmzdlyz
@Optmzdlyz Ай бұрын
@@johannes4gnu_linux96 Makes a lot of sense now, thanks a bunch :D
@rohithkapse9090
@rohithkapse9090 Ай бұрын
kernel headers installed proper version still not able to do make , its throws an make oldconfig && make prepare still that command is issue
@johannes4gnu_linux96
@johannes4gnu_linux96 Ай бұрын
Ok, are you also using Raspberry Pi OS with the kernel headers installed? Can you give me the exact error message of make?
@rishidivakar6865
@rishidivakar6865 18 күн бұрын
Hello, I have reached till compiling the ko file. But, when I enter the tmux command, I don't see another window like in this video where I can enter insmod command. Is there any other package I need to install?
@rishidivakar6865
@rishidivakar6865 18 күн бұрын
I'm just a novice in Linux, please ignore my silly questions. Ctrl+b % will open a new pane
@johannes4gnu_linux96
@johannes4gnu_linux96 18 күн бұрын
@@rishidivakar6865 for a novice it is not a silly question. Maybe i should have mentioned it. Bit good to Here you find it out yourself 😉
@nyeeesss2424
@nyeeesss2424 Ай бұрын
Hi! Loved the tutorial. However, I'm getting the error: ""insmod: ERROR: could not insert module hello.ko: Invalid module format" Any help? I'm using PopOS
@johannes4gnu_linux96
@johannes4gnu_linux96 Ай бұрын
Thank you. Hmm, maybe run modinfo hello.ko and uname -r to verify if you have build the module against the correct kernel version. If they match, maybe you have turned on secure boot and it only allows you to load signed modules. But that should be a different error message...
@nyeeesss2424
@nyeeesss2424 29 күн бұрын
@@johannes4gnu_linux96 Hi! Thank you for your reply, I was trying to follow the tutorial with linux running in a VM. Maybe that was the issue, because I tried the same on my actual system and it ran perfectly. Once again love how easy you made it all seem!
@ralify
@ralify Ай бұрын
Btw are you using arch?
@johannes4gnu_linux96
@johannes4gnu_linux96 Ай бұрын
Yes, I do
@preetamdas4048
@preetamdas4048 Ай бұрын
yay
Let's code a Linux Driver - 2: Device Numbers and Files
16:43
Johannes 4GNU_Linux
Рет қаралды 45 М.
this new Linux feature makes hacking IMPOSSIBLE
11:08
Low Level
Рет қаралды 533 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 97 МЛН
路飞做的坏事被拆穿了 #路飞#海贼王
00:41
路飞与唐舞桐
Рет қаралды 25 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 11 МЛН
Let's code a Linux Driver - 1: Hello World Linux Kernel Module
12:05
Johannes 4GNU_Linux
Рет қаралды 105 М.
How a Microcontroller starts
28:49
Artful Bytes
Рет қаралды 56 М.
Making a New Compiler
15:36
Modern Retro Dev
Рет қаралды 7 М.
Linux Kernel 6.12 | This is Historic
1:07:22
Maple Circuit
Рет қаралды 118 М.
How Linux Kernel Runs Executables
16:46
Nir Lichtman
Рет қаралды 48 М.
Why Compile a Linux Kernel from Source?
13:38
DJ Ware
Рет қаралды 32 М.
Setting Up the Perfect Developer Environment on Linux for 2025
11:58
why do header files even exist?
10:53
Low Level
Рет қаралды 437 М.
Creating a window - Software from Scratch
1:04:12
Muukid
Рет қаралды 155 М.
How to build a Linux loadable kernel module that Rickrolls people
11:46
This feature of Huawei is really useful. It is 100% original
0:11
TECH CRAZY CRANE
Рет қаралды 10 МЛН
High Performance Hardware Tools, Good Tools For Recommendations #shortsfeed
0:14
HARDWARE TOOLS OFFICIAL
Рет қаралды 3,8 МЛН
APT APT tutorial #rosé #apt #cute #robot #tutorial
0:28
Dr. EMO
Рет қаралды 6 МЛН