I remember my dad, an old school linux military man told me that writing drivers was the "initial task" of many linux programmers. Thank you for sharing your experience.
@@wanglin1943 for example, an embedded linux engineer who works touching registers of the SOC. and making drivers for a user developer can use it without worry about the details of how to deal with that specific low level procedures.
It most definitely isn't and shouldn't be. Writing drivers is dangerous if you don't know what you're doing. The idea that some fresh graduate is writing linux drivers for military hardware is down right terrifying. Airplanes would be falling from the sky. No. You should be very comfortable in userspace before you ever venture down to the kernel and start touching hardware.
@@mithrandirthegrey7644 I'll have to disagree with you there, though I understand where you're coming from. Certainly you shouldn't be trying to make robust computing systems from scratch if you've no idea what you're doing, but the best way to learn is by understanding the core principles first and then build a grasp of understanding more complex systems from there. The deeper you go into the files, systems and hardware, the simpler things become, and at the core of all computing lies nothing else but understanding the concept of "on" and "off". Building system drivers used to be something people with no computing background had to figure out themselves just by the instruction manual (this is how the security firm I work at had to do it when they first started introducing electrical equipment at the company). It's far harder to try and figure out why a projector doesn't work when you have no idea to begin with how it's even *supposed* to work. When you understand the basic principles it's much easier to infer where things might have gone awry.
@@crimsomnia1415 I don't disagree that writing hardware drivers is a great exercise for tinkerers and an excellent way to learn things like communication stacks and hardware flow. I vehemently disagree that a pimple faced engineer fresh out of college should be writing hardware drivers for military hardware. That sounds scary.
@@Qizot Imagine your worst nightmare but worse But for real C code becomes a mess, i understand why people use it but it feel like its a chore to start a project in c
Hey @LiveOverflow Regarding 14:30; Python is internally calling the C the standard library's stdio buffered functions (fread/fwrite) which does the buffering which internally makes the syscall specifying the file descriptor, which triggers the char module's read/write function.
That is true, python is not very efficient code in that sense, but you get the ease of writing code. However for the example he could have done manual flush before closing. To show that you can force the write to disk without waiting for close or buffer to get full. Normally it gets buffer full until write happens to avoid excessive write operations on disk. It is all about optimizing operations and not to cause bunch of writes to take up CPU instructions while there is nothing to write. For such a small example it would have shown it maybe more how things work and even how close is doing the flush automatically doing it in a way more like open -> write -> flush -> write -> close. On windows on the other hand I have noticed that it does not respect flush always (more reliable on linux). There can be few cases where it does not even write to device, even if you call it to do it, I do not know all the specifics. Well nvm... Watched half a minute more and it was there already :D
I have a certain understanding of drivers, and I have worked in semiconductor manufacturers before. This video is a driver getting started video. The reason I like this video is that the English pronunciation of the video owner is clearer and I can understand it better, which helps me practice English well.
how you went into the library to analyze the makefile, realized that you have that directory on your linux and then just executed it and it works was just amazing :D
i Just followed the code example and was blown away. Great work. A lot of people say making a series out of that would be amazing and I can only agree!
Great video! It is truly fascinating that one can compose these file and block drivers on top of each other so that a simple open+write to a certain file can go through a Samba client to send the write call to another server, have it written to an ext4 filesystem which uses a virtual block device which stacks in transparent encryption and mirroring to two different underlying disks, which are actually just block devices, or even might span multiple disks via again virtual block devices...
Awesome video, I did the simple hello kernel module a few years ago and was in over my head. I wanted to create a simple way to send commands to an Arduino, ultimately controlling a stepper motor. I thought the best way to do that would be to create a driver and simple "client-side" code to take commands in the terminal, writing to the device "file" to provide a number of steps and direction to the stepper motor. You've re-ignited my interest and I may make another attempt.
My 3rd year computer science project for my university course will require me to write Linux device drivers. This looks like a really good place to start. Thanks so much!
Video starts. Me: I'm not sure if he can keep up the high quality of his videos with daily uploads. Also Me 3 Minutes later: Oh damn thats so interesting and well put together. Keep up the good work! I never regret watching a video of yours!
Hey. I enjoyed the video. I didn't really feel it was 17 minutes long. It went by fast. Just wanted to say this might be a very good, and so far unimplemented type of video format: You pick a free-to-the-public book, like this one, and read/work through it chapter by chapter. Except you might do it in like a live-stream format ? (maybe one livestream per chapter) I know the live part is kinda daunting, but I feel that doing this would either way help you: - You get obviously the benefits from reading/working through the book. - I feel this might attract viewers since in a way, you will pretty much look like you are "noob" while learning. It will show the viewer that learning is a sort of tough process ? And that they shouldn't expect to know it all in one sitting. And in a way, since this actually attracts people, you might feel the freedom of messing up, of not editing, of not having to look too damn professional. Just be yourself, learning. - Get the profit from the views. - I don't know if this one counts but: Sometimes (really uncommon times), knowledgeable viewers might get in the livestream, so if you don't know a certain something, or are working through something they know, they might raise helpful ideas or explanations, thus increasing the dialog, making it more engaging to viewers to stay in the stream. I really wish you could do it with ANY book. Of course copyright :/ (I wonder if it's legal that you could buy the book, and then show it here. Or work through it this way) Maybe you could even do patreon requests every time you want a new book; effectively making us pay for it. Since in the end, you would be providing us with useful info. In the end. You might get a nice catalog of playlists of books you've worked through. Viewers from any point in time [who bought / are interested in a book] can follow along with you in the future. You put a bunch of ads in every live-stream, and PROFIT. Maybe it is nice publicity for the book ? and also for you. So that you can tweet or somehow contact the writers about doing copyright books. Maybe some will allow it? I know for instance there's this open book about reverse engineering, that the guy updates constantly, and he releases totally free. So you might work through it ? learn, and PROFIT. All while making the book more known, increasing the dialogue, etc.
That's actually a really good idea. Since this book is public, there probably wouldn't be any license issues, plus maybe the original authors could explicitly allow it if there was an issue.
We'll probably start seeing a format in the coming years for quite a number of reasons on top of the ones Shire Grin wrote about. A current example to observe is web development tutorials that heavily rely on the W3C standards docs as a reference but barely mention small parts of it across multiple videos often on one feature of the web standards specifications and actually reading of the full spec is left as an exercise to the reader but most developers never do to their detriment. Some other future predictions: * Barrier to entry to make long format video gets lower and lower due to proliferation of online video platforms and modern hardware * Higher job dissatisfaction, or outright unemployment, lower hours due to increasing automation for knowledge workers to have more free time, that ironically creates a catch-22 of more educational materials to make more knowledge workers to increase automation. * Streaming as a service/culture maturing as an viable industry for self-employment and socializing * The need for more and more content hours to get captive views * Creating longform content is hard to come up with let alone make; enter wikibooks,published papers, etc. * Rejection fatigue from the oversaturation of online "course" services * Students/learners using streaming socialization as a way to hold themselves accountable to learn something on a schedule in a culture that pushes for constant connection(human and network). And or using the recording as an notesystem. * Publishers are always looking for ways to sell more books so on the copyright side of things getting a teachers edition and a deal for content creators to make a streaming "course" of the book with presales of the book as a requirement of "attendance" or as a way to supplement MooC's which have waned in lieu of "course" platforms.
I have the first edition of this book, and the "Understanding the Linux Kernel". Those books, starting with Linux in 1994 and reading literally hundreds of Howto documents, and doing a Linux from scratch build, taught me a ton. Too bad that pretty much all of what I learned back then has since been superceded by evolution. Getting X up and running in the 90s was also a major learning experience.
I actually searched for something like this for quite a while and now i randomly stumble over it just by subscribing your channel! Thank you! That helps me so much with one of my projects!
My University exams just ended for now. I was wondering what should I learn and bam notification for this video appeared. Thanks for dropping this awesome resource man!
A bit different than what I expected based on the video''s title... This really doesn't describe or expand on kernel drivers, But as described in the opening minutes the driver interface provides a way to access, manipulate and even write code that can operate against kernel functions. In other words, the kernel driver isn't the real topic of this video but is a sideshow means to the real topic...accessing the kernel. So, although I felt I was misled, This video is still very interesting, educational, clear and well made. Kudos, I think many people can benefit from this.
When I saw the cover of the book I thought it looked familiar.. and guess what I actually still have the printed version and had used it over 15 year ago! Happily surprised to see how younger generations and youtubers are enjoying hacking into the kernel avoiding to just use latest frameworks! Thanks for the video (and to the g recommendation system that made me bump into it!) :)
I just spent the last few weeks in WDM hell, but I'd never seen Linux driver code before. It's so amazing how much simpler Linux driver code is than the equivalent in Windows!
Thanks for making this video explaining this book. I didn't make it very far! Now i get it more! Please consider going through more of this fascinating series!
Honestly this is probably one of the most interesting videos I watched from you so far. I mean the hacking videos are great too, but I never felt so enlightened 😱
Ohh... very Nice .... but i have a problem .... My lib/modules/.../build doesn't exist...🤤🤤🤤😭😭😭 So i can't modify, create or unload some modules... Please can you help me...!??
This is exactly what I was looking for as Im learning how to make my own kernel modules. Maybe you could expand on building makefiles and cross compiling things as is frequently done when working with embedded linux systems. Great video!
Wow, it's so interesting. I always love getting known about how all the things, which were always magic to me, work and how they're connected with each other. Then, everything (some of the magic) clears out to me. I really like that feeling. Thank you.
That is so awesome, I have read tried to read this book in the past but never got far because the examples did not work anymore. Thank you for this video and providing this resource tons of fun writing my own drivers to be had now :)
11:14 This is why people say there is *no* “stable” Linux kernel API as such. Calls to internal kernel routines are subject to change at any time. This is why the kernel developers don’t encourage you to carry your own drivers/modules outside the mainline kernel; it is easier long term to get it accepted into the official source tree, where it can be maintained along with the rest of the source.
I wrote the first Linux kernel device driver for the Linux version 2.4.5, SH -3 (Renesas 7709 and 7727) device drivers. I remember compiling and building many times. In Kernel space, there was no convenient crt0 that called the main function, so it was pretty hard. Before that, I had to fix the device drivers for FreeBSD 2.2, but they were completely different, so I had a hard time. The device driver is basically OK if read, write, ioctrl are implemented. As for interrupts, the handler is not too hard to figure out how the interrupt is occurring, but if you didn't follow kmalloc, kfree in that order, it immediately went out of control.
This was paradigm shifting for me :), been trying to grok device programming for a long time. Though admittedly never focused heavily on the subject, just pieces here and there. Thanks for the video
it's an guide for one want to dive into the kernel. before this i didn't know device driver is a good start point. anyway thank you for introduce this book.
Well, i'm a bit late to the party but this video gave me exactly the missing link I needed to connect some stuff in may thoughts! :) Thank you! Might as well try writing something now.
If you like Python programming and file interfaces, you might love Python Fuse ( _pip install fuse-python_ ) : write a virtual file interface in Python, straighter to the goal without compiling kernel modules. Thanks a lot for this tutorial. Love it!
Sheeeesh, only been a few days since I've finished and submitted my first academic essay, and it did actually refer to "Linux Device Drivers" (Rubini & Corbet) 😂😂
Hey, Kernel dev here. Just wanted to mention that the reason they aren't publishing another book is because O'Reilly didn't want to. GKH was intending to publish another, and had quite a bit written for it. They're including all of his writings in /doc in the kernel itself. They definitely do need new devs working on drivers, in part because industry driver devs often times write bad/unmaintained code. Working on cleaning these up is a great way for someone to break into the kernel dev community.
@@theuser1240 totally, if you enjoy low level stuff! Theres definitely a lot of opportunities out there for people who know the ins and outs of kernel stuff. The community is more welcoming than ever, jump on in!
I learned Unix operating system in school, feel this short video is worth about 2 hour school in-class lecture. Thank you for sharing. This teaching style is more practical than school does
Also interesting: Fuse, which allows you to write filesystem drivers (the same way, with an struct of function pointers for the operations) in userspace, without need for a kernel module. Not as useful if you want to learn about the kernel, though.
Echt cooles Video! Studiere auch gerade Informationstechnik ander DHBW, allerdings mit Keysight. Ich wünschte es gäbe mehr Leute, die bei "Our code was executed" so begeistert sind... ;)
14:50 You can use setvbuf & setbuf in C/C++ (if you're using a FILE*), However in C/C++ it'd probably just be better to call the open, close, read, and write syscalls manually
This looks fun! So effectively I should be able to make my own custom devices for linux (like keyboards, mice, network interfaces, audio interfaces, MIDI devices, etc) by writing a custom driver? I wonder if you can "inherit" from other drivers and modify them so they work a little differently. Or if you can autoload drivers on certain events. A lot to grok here!
The first time I ever learned about everything in linux is a file is in the movie Jurrasic Park when the little girl and her brother tries to lock the room with a computer :-)
If you want to write unbuffered in Python you have to call open() with buffering=0, that way there's no need for the flush(). The manual for 3.x states that this needs binary mode tho, so you need 'wb' as mode.
I remember my dad, an old school linux military man told me that writing drivers was the "initial task" of many linux programmers. Thank you for sharing your experience.
Most programmers are still writing applications, and a few engineers who write drivers usually work in semiconductor chip manufacturers
@@wanglin1943 for example, an embedded linux engineer who works touching registers of the SOC. and making drivers for a user developer can use it without worry about the details of how to deal with that specific low level procedures.
It most definitely isn't and shouldn't be. Writing drivers is dangerous if you don't know what you're doing. The idea that some fresh graduate is writing linux drivers for military hardware is down right terrifying. Airplanes would be falling from the sky.
No. You should be very comfortable in userspace before you ever venture down to the kernel and start touching hardware.
@@mithrandirthegrey7644 I'll have to disagree with you there, though I understand where you're coming from. Certainly you shouldn't be trying to make robust computing systems from scratch if you've no idea what you're doing, but the best way to learn is by understanding the core principles first and then build a grasp of understanding more complex systems from there. The deeper you go into the files, systems and hardware, the simpler things become, and at the core of all computing lies nothing else but understanding the concept of "on" and "off".
Building system drivers used to be something people with no computing background had to figure out themselves just by the instruction manual (this is how the security firm I work at had to do it when they first started introducing electrical equipment at the company). It's far harder to try and figure out why a projector doesn't work when you have no idea to begin with how it's even *supposed* to work. When you understand the basic principles it's much easier to infer where things might have gone awry.
@@crimsomnia1415 I don't disagree that writing hardware drivers is a great exercise for tinkerers and an excellent way to learn things like communication stacks and hardware flow. I vehemently disagree that a pimple faced engineer fresh out of college should be writing hardware drivers for military hardware. That sounds scary.
Thumbs up for LiveOverflow ASMR where he reads Linux Device Drivers (Third Edition).
Fun fact: Linux kernel v2.6 has ~8 million lines of code, v5 has ~26 million lines of code :)
That’s... A lot...
I coded a JS project for ~2 months a few hours per day and it has only 35k lines iirc
I still don't know how C code can be scaled to this amount
Is this where I mention Casey Muratori's "The Thirty-Million Line Problem"?
@@Qizot Imagine your worst nightmare but worse
But for real C code becomes a mess, i understand why people use it but it feel like its a chore to start a project in c
hol' up
Hey @LiveOverflow
Regarding 14:30; Python is internally calling the C the standard library's stdio buffered functions (fread/fwrite) which does the buffering which internally makes the syscall specifying the file descriptor, which triggers the char module's read/write function.
That is true, python is not very efficient code in that sense, but you get the ease of writing code.
However for the example he could have done manual flush before closing. To show that you can force the write to disk without waiting for close or buffer to get full. Normally it gets buffer full until write happens to avoid excessive write operations on disk. It is all about optimizing operations and not to cause bunch of writes to take up CPU instructions while there is nothing to write. For such a small example it would have shown it maybe more how things work and even how close is doing the flush automatically doing it in a way more like open -> write -> flush -> write -> close. On windows on the other hand I have noticed that it does not respect flush always (more reliable on linux). There can be few cases where it does not even write to device, even if you call it to do it, I do not know all the specifics.
Well nvm... Watched half a minute more and it was there already :D
I have a certain understanding of drivers, and I have worked in semiconductor manufacturers before. This video is a driver getting started video. The reason I like this video is that the English pronunciation of the video owner is clearer and I can understand it better, which helps me practice English well.
I now want a 2hr version of this 😂 this was amazing
how you went into the library to analyze the makefile, realized that you have that directory on your linux and then just executed it and it works was just amazing :D
i Just followed the code example and was blown away. Great work. A lot of people say making a series out of that would be amazing and I can only agree!
Hell of a nice coincidence, I had just started reading the first chapter of this book. Thanks for the vid, man
creepy social media tracking
This is a very good book and truly insightful. I used it to start writing a driver for a PCIe based FPGA development board.
Great video! It is truly fascinating that one can compose these file and block drivers on top of each other so that a simple open+write to a certain file can go through a Samba client to send the write call to another server, have it written to an ext4 filesystem which uses a virtual block device which stacks in transparent encryption and mirroring to two different underlying disks, which are actually just block devices, or even might span multiple disks via again virtual block devices...
Awesome video, I did the simple hello kernel module a few years ago and was in over my head. I wanted to create a simple way to send commands to an Arduino, ultimately controlling a stepper motor. I thought the best way to do that would be to create a driver and simple "client-side" code to take commands in the terminal, writing to the device "file" to provide a number of steps and direction to the stepper motor. You've re-ignited my interest and I may make another attempt.
Knew about linux drivers and fs devs a long before this video but to see an actual example... Exceptional! Thank You!
How Linux Works, 2nd Edition: What Every Superuser Should Know by Brian Ward, also a great book regarding an overview of Linux.
yeah i am reading that from few weeks and about to comment that book in this section
GREAT BOOK
Got any more recommendations?
@@0xssff Linux bible
linux programming interface book
ARCH WIKI
this is a website where u can learn a lot
This is mindblownig as you said! I never knew how that devices works and acting like a file - thanks for that daily videos, I'm learning so much stuff
My 3rd year computer science project for my university course will require me to write Linux device drivers. This looks like a really good place to start. Thanks so much!
I love watching tutorial videos with more applicable examples like that. Better than useless entertainment videos.
Video starts.
Me: I'm not sure if he can keep up the high quality of his videos with daily uploads.
Also Me 3 Minutes later: Oh damn thats so interesting and well put together.
Keep up the good work! I never regret watching a video of yours!
Hey. I enjoyed the video. I didn't really feel it was 17 minutes long. It went by fast.
Just wanted to say this might be a very good, and so far unimplemented type of video format:
You pick a free-to-the-public book, like this one, and read/work through it chapter by chapter. Except you might do it in like a live-stream format ? (maybe one livestream per chapter)
I know the live part is kinda daunting, but I feel that doing this would either way help you:
- You get obviously the benefits from reading/working through the book.
- I feel this might attract viewers since in a way, you will pretty much look like you are "noob" while learning. It will show the viewer that learning is a sort of tough process ? And that they shouldn't expect to know it all in one sitting. And in a way, since this actually attracts people, you might feel the freedom of messing up, of not editing, of not having to look too damn professional. Just be yourself, learning.
- Get the profit from the views.
- I don't know if this one counts but: Sometimes (really uncommon times), knowledgeable viewers might get in the livestream, so if you don't know a certain something, or are working through something they know, they might raise helpful ideas or explanations, thus increasing the dialog, making it more engaging to viewers to stay in the stream.
I really wish you could do it with ANY book. Of course copyright :/ (I wonder if it's legal that you could buy the book, and then show it here. Or work through it this way)
Maybe you could even do patreon requests every time you want a new book; effectively making us pay for it. Since in the end, you would be providing us with useful info.
In the end. You might get a nice catalog of playlists of books you've worked through. Viewers from any point in time [who bought / are interested in a book] can follow along with you in the future. You put a bunch of ads in every live-stream, and PROFIT.
Maybe it is nice publicity for the book ? and also for you. So that you can tweet or somehow contact the writers about doing copyright books. Maybe some will allow it?
I know for instance there's this open book about reverse engineering, that the guy updates constantly, and he releases totally free. So you might work through it ? learn, and PROFIT.
All while making the book more known, increasing the dialogue, etc.
That's actually a really good idea. Since this book is public, there probably wouldn't be any license issues, plus maybe the original authors could explicitly allow it if there was an issue.
This is an awesome idea! I'd love to watch it.
This is a great idea
We'll probably start seeing a format in the coming years for quite a number of reasons on top of the ones Shire Grin wrote about.
A current example to observe is web development tutorials that heavily rely on the W3C standards docs as a reference but barely mention small parts of it across multiple videos often on one feature of the web standards specifications and actually reading of the full spec is left as an exercise to the reader but most developers never do to their detriment.
Some other future predictions:
* Barrier to entry to make long format video gets lower and lower due to proliferation of online video platforms and modern hardware
* Higher job dissatisfaction, or outright unemployment, lower hours due to increasing automation for knowledge workers to have more free time, that ironically creates a catch-22 of more educational materials to make more knowledge workers to increase automation.
* Streaming as a service/culture maturing as an viable industry for self-employment and socializing
* The need for more and more content hours to get captive views
* Creating longform content is hard to come up with let alone make; enter wikibooks,published papers, etc.
* Rejection fatigue from the oversaturation of online "course" services
* Students/learners using streaming socialization as a way to hold themselves accountable to learn something on a schedule in a culture that pushes for constant connection(human and network). And or using the recording as an notesystem.
* Publishers are always looking for ways to sell more books so on the copyright side of things getting a teachers edition and a deal for content creators to make a streaming "course" of the book with presales of the book as a requirement of "attendance" or as a way to supplement MooC's which have waned in lieu of "course" platforms.
Shire Grin, you nailed how this vid zoomed by, most YT vids are boring & have nothing to say in the end.
I have the first edition of this book, and the "Understanding the Linux Kernel". Those books, starting with Linux in 1994 and reading literally hundreds of Howto documents, and doing a Linux from scratch build, taught me a ton. Too bad that pretty much all of what I learned back then has since been superceded by evolution. Getting X up and running in the 90s was also a major learning experience.
Your enthusiasm is contagious
Mate, are you reading my search history or something? I've been searching for a good explanation of Linux kernel drivers for a couple of days now xD
Same lol, it all started with figuring out what the mknod command does...
Google youtube algorithm kindof sold your data...to him...but it's okay
haha same!!
reality is not
@@looploopertzg3511 We trust him !!
I actually searched for something like this for quite a while and now i randomly stumble over it just by subscribing your channel! Thank you! That helps me so much with one of my projects!
My University exams just ended for now.
I was wondering what should I learn and bam notification for this video appeared.
Thanks for dropping this awesome resource man!
This is easy enough for me to understand, but still amazing enough to blow my mind.
At the beginning, is that Ben Eater's 8-bit breadboard computer design?
Haha I also recognized it, I am currently building my CPU logic but I burned some stuff so waiting for a delivery from china :-)
Yeah, he is building it on streams
I built a similar one on Logisim! Do check it out github.com/shubham1172/SRM
@@zack3g aye, thanks! It would be amazing if we design some high level language for it 🤣
@@shubham.1172 Logisim is awsome!
And discrete computers are awsome!
i just finished studying this material this semester, and this was spot on, great video!
@MichaelKingsfordGray what?
A bit different than what I expected based on the video''s title...
This really doesn't describe or expand on kernel drivers,
But as described in the opening minutes the driver interface provides a way to access, manipulate and even write code that can operate against kernel functions.
In other words, the kernel driver isn't the real topic of this video but is a sideshow means to the real topic...accessing the kernel.
So, although I felt I was misled,
This video is still very interesting, educational, clear and well made.
Kudos, I think many people can benefit from this.
Wow, really impressed by the explanation you've provided! I'm taking an embedded software course, and I really needed this!
When I saw the cover of the book I thought it looked familiar.. and guess what I actually still have the printed version and had used it over 15 year ago!
Happily surprised to see how younger generations and youtubers are enjoying hacking into the kernel avoiding to just use latest frameworks!
Thanks for the video (and to the g recommendation system that made me bump into it!) :)
>python
ERROR: Gets Permission denied
>SUDO python
time 12:55
sudo !!
S U D O
user is not in the sudoers file. This incident will be reported.
chmod 777 /dev/scull
I just spent the last few weeks in WDM hell, but I'd never seen Linux driver code before. It's so amazing how much simpler Linux driver code is than the equivalent in Windows!
Thanks for making this video explaining this book. I didn't make it very far! Now i get it more! Please consider going through more of this fascinating series!
Honestly this is probably one of the most interesting videos I watched from you so far.
I mean the hacking videos are great too, but I never felt so enlightened 😱
Ohh... very Nice .... but i have a problem ....
My lib/modules/.../build doesn't exist...🤤🤤🤤😭😭😭
So i can't modify, create or unload some modules...
Please can you help me...!??
@@esaieledouxnjongssikouam9326 You entered the correct kernel version right?
@@nikhilchouhan1802 yeah
This is exactly what I was looking for as Im learning how to make my own kernel modules. Maybe you could expand on building makefiles and cross compiling things as is frequently done when working with embedded linux systems. Great video!
Wow, it's so interesting. I always love getting known about how all the things, which were always magic to me, work and how they're connected with each other. Then, everything (some of the magic) clears out to me. I really like that feeling. Thank you.
That is so awesome, I have read tried to read this book in the past but never got far because the examples did not work anymore. Thank you for this video and providing this resource tons of fun writing my own drivers to be had now :)
I just ended a course on Character Devices... I needed this video three months ago, not now!!!
Jk, good video :)
Am I wrong to pronounce 'char' as "care", as in character?
Holy crap… I tried to read this book years ago but was over my head…you just cleared some shit up for me! Bless you sir
"tail -f -n 0 /var/log/syslog" if you don't want to see any previous logs.
Can be shortened to:
tail -fn0 /var/log/syslog
@@lawrencedoliveiro9104 Yeah, I use that way, just wanted to be more readable for beginners.
Use -F so that it follows log rotation.
@@teranokitty follows the name of file and not the fd here 👍👍
Thanks for all your help, been interested in reversing for years and have rarely found a more concise and comprehensive resource.
This is one of the most awesome videos to get started with kernel programming! Thanks for this one.
11:14 This is why people say there is *no* “stable” Linux kernel API as such. Calls to internal kernel routines are subject to change at any time. This is why the kernel developers don’t encourage you to carry your own drivers/modules outside the mainline kernel; it is easier long term to get it accepted into the official source tree, where it can be maintained along with the rest of the source.
Dude, your enthusiasm is contagious. Nice vid, keep it up!
Omg I’m so pumped up to go back to this book.. you helped me significantly on this!!
I wrote the first Linux kernel device driver for the Linux version 2.4.5, SH -3 (Renesas 7709 and 7727) device drivers.
I remember compiling and building many times.
In Kernel space, there was no convenient crt0 that called the main function, so it was pretty hard.
Before that, I had to fix the device drivers for FreeBSD 2.2, but they were completely different, so I had a hard time.
The device driver is basically OK if read, write, ioctrl are implemented. As for interrupts, the handler is not too hard to figure out how the interrupt is occurring, but if you didn't follow kmalloc, kfree in that order, it immediately went out of control.
I really enjoy his extreme enthusiasm
This was paradigm shifting for me :), been trying to grok device programming for a long time. Though admittedly never focused heavily on the subject, just pieces here and there. Thanks for the video
I'm trying to get into developing device drivers. So happy I stumbled across this.
your current video output is insane while maintaining and improving quality. big up bro
it's an guide for one want to dive into the kernel. before this i didn't know device driver is a good start point. anyway thank you for introduce this book.
Well, i'm a bit late to the party but this video gave me exactly the missing link I needed to connect some stuff in may thoughts! :) Thank you! Might as well try writing something now.
If you like Python programming and file interfaces, you might love Python Fuse ( _pip install fuse-python_ ) : write a virtual file interface in Python, straighter to the goal without compiling kernel modules. Thanks a lot for this tutorial. Love it!
I do like your enthusiasm when you saw your code running in the kernel! LOL!
I'm really glad to have found this channel. Extremely interesting, very straight-foward and substantive :)
Really appreciate the book link, been looking for something like this
i wanted to hit the like at least 4 times while watching. would love more of this. thanks.
this is soo cool, what an awesome kickstarter for writing LDD's
Nice introduction! I enjoy videos about what happens under the hood on linux, specially when they are done in such smooth way
Sheeeesh, only been a few days since I've finished and submitted my first academic essay, and it did actually refer to "Linux Device Drivers" (Rubini & Corbet) 😂😂
Such a great and extraordinarily helpful video, for less than 20 mins. Thanks :)
I remember reading this book a few years back. It really is great.
Hey, Kernel dev here. Just wanted to mention that the reason they aren't publishing another book is because O'Reilly didn't want to. GKH was intending to publish another, and had quite a bit written for it. They're including all of his writings in /doc in the kernel itself. They definitely do need new devs working on drivers, in part because industry driver devs often times write bad/unmaintained code. Working on cleaning these up is a great way for someone to break into the kernel dev community.
Is it still a good idea to be a kernel developer in 2020?
@@theuser1240 totally, if you enjoy low level stuff! Theres definitely a lot of opportunities out there for people who know the ins and outs of kernel stuff. The community is more welcoming than ever, jump on in!
Your passion is a font of inspiration for me, hope you can do more content about kernel development
I learned Unix operating system in school, feel this short video is worth about 2 hour school in-class lecture. Thank you for sharing. This teaching style is more practical than school does
Awesome! Best rundown on kmods ever.
why am I just seeing this now?! Amazing video and your enthusiasm :) love it
There needs to be a part two that goes deeper into the more advanced topics.
Nice. I've been meaning to learn about device drivers. This video and the free book is just what I need to get started.
Fantastic video, really enjoy your stuff.
The joy in your eyes is great to see.
Fantastic! I'm just starting the same exercise. So exciting!
Also interesting: Fuse, which allows you to write filesystem drivers (the same way, with an struct of function pointers for the operations) in userspace, without need for a kernel module. Not as useful if you want to learn about the kernel, though.
Thanks for making learning complex stuff enjoyable! Keep it up!
Wow, I am just now doing a course about writing device drivers with a project at my university, that may be useful, thanks
This cool content when u grap a book and look into it like that or more to do a series whene u read book and explain it
Wonderful video, thank you. Editing was done superbly too.
I hope you will have a proper office chair one day. That one looks painful to sit on.
Very informative like all your videos, plus I got a good laugh when you flailed your arms around while saying 'and then, kernel magic happened' LOL
Your passion is contagious!
I would totally share this if I knew anyone interested in Linux device drivers.
It feels like Michael Cera is teaching Linux, how amazing!
Daily liveoverflow videos... cool!
Thanks for the very simple explanation of such a complex topic!
Really enjoyed the video...
It would be great to have a series of videos for all three types of LDD.
I really like your 'File' gesture!
it's better if u upload a playlist like this one!!!
Dude i was just thinking i should learn more about this and this video popped up. Thnx m8
Funny that I was just reading about this haha
Great video, this book is definitely awesome
same xD
I personally wouldn't load a random person's code off of github into my kernel. You are living dangerously.
Awesome, now Linux drivers looks fun! Thanks for posting!
Thanks for sharing! I'm learning a lot when watching your videos.
Echt cooles Video! Studiere auch gerade Informationstechnik ander DHBW, allerdings mit Keysight. Ich wünschte es gäbe mehr Leute, die bei "Our code was executed" so begeistert sind... ;)
14:50 You can use setvbuf & setbuf in C/C++ (if you're using a FILE*), However in C/C++ it'd probably just be better to call the open, close, read, and write syscalls manually
I never thought id learn about Linux kernels from michael cera
Really makes me want to read this book
Oh.. man, you better say: It works! .. instead of: it work!
i love this, can you please consider making a tutorial on stuff related to these? Kernels, Buffer and all the behind the scenes of an OS. Thank you
that is this video
Man, you give me so much inspiration!
This looks fun! So effectively I should be able to make my own custom devices for linux (like keyboards, mice, network interfaces, audio interfaces, MIDI devices, etc) by writing a custom driver? I wonder if you can "inherit" from other drivers and modify them so they work a little differently. Or if you can autoload drivers on certain events. A lot to grok here!
What a video 👏🏻 Awesome Job brother
The first time I ever learned about everything in linux is a file is in the movie Jurrasic Park when the little girl and her brother tries to lock the room with a computer :-)
If you want to write unbuffered in Python you have to call open() with buffering=0, that way there's no need for the flush(). The manual for 3.x states that this needs binary mode tho, so you need 'wb' as mode.