What are Linux Devices !?

  Рет қаралды 12,737

Mohido

Mohido

Күн бұрын

Пікірлер: 64
@Ozzymand
@Ozzymand 14 күн бұрын
"So you don't have to struggle as much as I did" 🗣🗣🗣🗣 my man spitting generational fire here
@MohidoTech
@MohidoTech 7 күн бұрын
@@Ozzymand I am not that old, come on 😅
@Ozzymand
@Ozzymand 7 күн бұрын
@@MohidoTech Never said you were! Just complimenting your dedication to helping the people!
@MohidoTech
@MohidoTech 7 күн бұрын
@@OzzymandI know brother, was just kiddin 😅. I truly appreciate your kind words, I really do. thank you.
@moussaadem7933
@moussaadem7933 14 күн бұрын
devices communicate through input/output. this make them analogus to files. "Everything is a file" is a great abstraction. linux does this a lot. devices and files are just files. processes and threads are just tasks. directories and filenames are just paths (that's why mv renames and moves)
@MohidoTech
@MohidoTech 14 күн бұрын
I honestly love how Linux kernel work! Once you understand the Linux kernel, you start getting what a computer is and how it really works!
@someoneunknown6894
@someoneunknown6894 16 күн бұрын
Great video! Would love to learn more about the network devices!
@MohidoTech
@MohidoTech 16 күн бұрын
I will create that one soon :)
@tannguyen_91
@tannguyen_91 Күн бұрын
I appreciate your work here
@savagesarethebest7251
@savagesarethebest7251 13 күн бұрын
I find it really intuitive, like do you want some user input? Just open Standard Input. Want to write something, open standard output. Do you want a file from the network, just open it. Do you want a stream of coordinates from GPS or the trackpad, just open the file. This is especially good if your program operates on standard input and output, then it can be used in ways that you have never imagined decades after you made it.
@MohidoTech
@MohidoTech 11 күн бұрын
Exactly, I totally agree in that sense. This abstraction makes it easier for both, driver implementer and applications/kernel communication!
@Momoyon
@Momoyon Күн бұрын
Yes, would love more videos like this! You earned a sub
@MohidoTech
@MohidoTech 13 сағат бұрын
@@Momoyon Thanks! And you will get what you love ;)
@gryzus2475
@gryzus2475 9 күн бұрын
Drivers are not a strict subset of all modules. Most drivers can also be built into the kernel directly and they will not be listed by the lsmod command. I will give you the benefit of the doubt though, they might still technically be modules but of the type "builtin" - check yourself with this command: less /lib/modules/`uname -r`/modules.builtin Another thing, the /dev/random may not require _specific_ hardware but it requires _some_ hardware to function, more precisely, it requires the entropy the hardware produces to generate cryptographically strong random bytes. Not sure whether modern Linux kernel versions block (6.6+) if there is not enough entropy to seed the random number generator, but the point is that you have to obtain these initial random bytes from the hardware (it is not strictly kernel functionality). Not a nit at all, I think you meant to convey the same thing, how succinctly at that! Great video.
@MohidoTech
@MohidoTech 9 күн бұрын
@@gryzus2475 these are very valuable insights!
@le24_qr6nod
@le24_qr6nod 7 күн бұрын
Would love to watch more such videos 🗣️🔥
@arijeetsarkar1512
@arijeetsarkar1512 2 күн бұрын
Thank you ❤
@MohidoTech
@MohidoTech Күн бұрын
Great to hear that you enjoyed it
@willabytes
@willabytes Күн бұрын
Appreciated!
@urebeatsgaming7285
@urebeatsgaming7285 16 күн бұрын
Very informative. Really liked the logical device part, always wondered what things like /dev/null were doing
@MohidoTech
@MohidoTech 16 күн бұрын
I am more than happy that it helped you!
@pabloqp7929
@pabloqp7929 5 күн бұрын
Really enjoyed this video, cheers!
@elidoz9522
@elidoz9522 15 күн бұрын
the part about the network devices sounds interesting, it sounds like it goes against the unix philosophy
@MohidoTech
@MohidoTech 15 күн бұрын
IKR! At first, it does seem odd, but it makes sense when you consider the complexity of networking devices compared to USBs or hard drives. "Linux sticks to 'Everything is a File' but takes a unique approach for networking. Tricks like this are what make tech fun"- *said by a non-'implentist' 😅* Since many people asked❤, the next video is about: Linux networking. I will start working on it tomorrow and hopefully I publish it asap 😄 NOTE Implentist (noun created by Mohido): Someone who unfairly discriminates against or holds biases toward certain implementations of a concept, system, or technology, often based on personal preference or traditional norms. 🤣🤣🤣
@NguyễnLong-o1t
@NguyễnLong-o1t 5 күн бұрын
Thank you very much
@RasyaAnindyaPratama-m9r
@RasyaAnindyaPratama-m9r 19 күн бұрын
great content bro!
@MohidoTech
@MohidoTech 19 күн бұрын
That means a lot, thank you man!🙃
@susugar3338
@susugar3338 13 күн бұрын
"Everything is a file" helps me understand Linux very much. But I always find funny when i get return "rm: dir is a folder, not a file."
@MohidoTech
@MohidoTech 13 күн бұрын
@@susugar3338 In the past, even 'cat' worked on folders.. It was pretty wild backthen lol
@ytnihad
@ytnihad 16 күн бұрын
great video. thank you.
@MohidoTech
@MohidoTech 16 күн бұрын
Don’t mention it!
@DanielNerd
@DanielNerd 9 күн бұрын
great video! i'd love to see a video about how linux handle the network devices, always wondered why they weren't on /dev/ like everything else, but never actually spent the time to check.
@MohidoTech
@MohidoTech 9 күн бұрын
The networking topic is huge to cover to be honest in a single ~5mins video. I just released a video providing a brief overview... kzbin.info/www/bejne/f2mUfWWNh7KWsKM However, I will create another video to explain the details on how it really works from inside the Linux kernel, explaining the kernel Network stack and other stuff. Probably even virtual interfaces.
@DanielNerd
@DanielNerd 9 күн бұрын
@@MohidoTech nice! will go watch it right now!
@muhammadowais2492
@muhammadowais2492 13 күн бұрын
you can treat anything like a file in Linux, Want to check how much memory your system is using? cat /proc/meminfo Want to see what processes are running? cat /proc/cpuinfo Want to change your hardware's settings? Just open /dev/ like it's a folder of random files, and hope you don't break anything.😅
@muhammadowais2492
@muhammadowais2492 13 күн бұрын
Appreciate your this video, hope it'll be helpful for young ones
@MohidoTech
@MohidoTech 13 күн бұрын
@@muhammadowais2492 thank you man for your support! It really means a lot!
@MartinWoad
@MartinWoad 10 күн бұрын
A lot of the time you will not be allowed to write to these files. The fact that they are files is simply an abstraction, an illusion presented to you by the kernel. Remember also that handling files is often slow and introduces overhead. It is fun for the simplicity of it, but things are simple in userland because they are complicated undernearth in the kernel. And this complexity introduces overhead. So always consider if you can use other IPC mechanism instead if you are looking to be performant and often times there is no reason not to.
@MohidoTech
@MohidoTech 10 күн бұрын
@@MartinWoad Exactly, take GPU for onstance, it exists in the /dev/ but really can only be used through System Calls.
@justgold1
@justgold1 12 күн бұрын
Channel will get big
@MohidoTech
@MohidoTech 12 күн бұрын
@@justgold1 Thousand thanks man! Ur words r just gold!! Even if it doesnt go big, I am doing these vids coz I luv it 😅
@MartinWoad
@MartinWoad 10 күн бұрын
I don't quite understand why non-essential drivers are handled as kernel modules. From my perspetice, they should be handled as userland daemons that can be easily turned and off and installed whenever needed. If they need to be in the kernel due to performance overhead then they should be patched later optionally. Adding more and more bloat to the kernel, especially if its mainline, increases the attack surface and decreases the stability of the system. The mainline kernel should only contain things that are absolutely essential.
@MohidoTech
@MohidoTech 10 күн бұрын
TBH, great question! Well, while kernel modules DO add code to the kernel, they're actually separate from the core kernel code and can be loaded/unloaded dynamically using commands like modprobe. The reason drivers need to be kernel modules rather than userland processes is that they need direct access to hardware and must operate at the kernel's privilege level. The kernel's primary job is to safely manage hardware access and provide a consistent interface to userspace programs. Moving drivers to userspace would break this security and abstraction model, as it would require giving userspace programs direct hardware access. I hope this answer provides a better insight on why and how kernel is a middle-man between applications (userland) and hardware (driversland).
@SingularCherubim
@SingularCherubim 9 күн бұрын
This is actually how printers and scanners are handled (CUPS and SANE, respectively): there's a single kernel module that calls out to userland drivers. FUSE is the same thing for filesystems, but you can't use userland drivers (or even dynamic modules) for boot devices.
@MohidoTech
@MohidoTech 9 күн бұрын
@@SingularCherubim This is something new to me. Thank you for sharing this information 🙏
@nonetrix3066
@nonetrix3066 5 күн бұрын
What opened my eye to everything being a file a lot is /dev/amdkfd when I was trying to debug AI related issues on my AMD GPU, I assume ROCm and Vulkan compute just cats stuff there and it just werks somehow
@MohidoTech
@MohidoTech 3 күн бұрын
That is possible especially that the `/dev/dri/card0` is used by the graphics-drivers to do some stuff. But not actually used by the application directly
@justgold1
@justgold1 12 күн бұрын
Yes bro 🔥🔥🔥🔥☄️☄️☄️
@0xPanda1
@0xPanda1 14 күн бұрын
Great video
@MohidoTech
@MohidoTech 13 күн бұрын
@@0xPanda1 thank you man! I truly appreciate your words. I will try to make the next one even better!
@rinatpro-q1r
@rinatpro-q1r 14 күн бұрын
linux devices is files
@MohidoTech
@MohidoTech 13 күн бұрын
@@rinatpro-q1r exactly, it is weird and fun to think that way. That's why linux-ers love linux.. It's always fun 😆
@dasten123
@dasten123 6 күн бұрын
so devices actually are **not** files, they just appear as files in /dev?? That's wild, so "everything is a file" is a total lie...
@MohidoTech
@MohidoTech 6 күн бұрын
@@dasten123 They lied to us.. when I started using linux I thought using: 'touch /dev/mouse' will create an actual new mouse into existence ;P😫
@MohidoTech
@MohidoTech 6 күн бұрын
@@dasten123 But asside from me joking, yeah.. you are correct in that sense. It is the way the kernel developers decided to abstract simple devices.. So the applications can just use a simple file operation instead of a complex system call.
@qwerte6948
@qwerte6948 5 сағат бұрын
i mean it is obvius right? not everything is a file but that doesnt mean you couldnt use it as such
@dzwassim95
@dzwassim95 13 күн бұрын
German?
@MohidoTech
@MohidoTech 13 күн бұрын
@@dzwassim95 nope, y the question tho?
@dzwassim95
@dzwassim95 13 күн бұрын
@@MohidoTech feels like german accent
@MohidoTech
@MohidoTech 13 күн бұрын
@@dzwassim95 lmao 🤣 Well, sorry to disappoint u 😅
@Cloud67TR
@Cloud67TR 13 күн бұрын
sudo mount /dev/sda1 /mnt
@MohidoTech
@MohidoTech 13 күн бұрын
@Cloud67TR 'sudo mount /usr/Cloud67TR /comments' 😁
@Solving_Engineer
@Solving_Engineer 5 күн бұрын
Great video
@MohidoTech
@MohidoTech 5 күн бұрын
Thank you, I hope I helped you with simplifying the idea :)
"BEST C++ CODE ever written" // Code Review
27:38
The Cherno
Рет қаралды 22 М.
Why Are Open Source Alternatives So Bad?
13:06
Eric Murphy
Рет қаралды 732 М.
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
Linux changed in 2024, but 2025 will be MUCH BIGGER
19:36
The Linux Experiment
Рет қаралды 134 М.
Have you ever used the "column" command in Linux?
8:24
Veronica Explains
Рет қаралды 123 М.
How is Internet data Created : Explained in 6 min 🤯
5:51
How Linux Networking Work ?!
6:17
Mohido
Рет қаралды 19 М.
Physicists Say They Know How Cold Fusion Works
7:38
Sabine Hossenfelder
Рет қаралды 57 М.
Why Are Arch Linux Users So TOXIC?
12:32
Eric Murphy
Рет қаралды 575 М.
Why Apple Stopped Using Intel Chips
27:58
Apple Explained
Рет қаралды 214 М.
Wubuntu - An Illegal Windows Like Distro
16:56
Mental Outlaw
Рет қаралды 556 М.
Why Your Backend Shouldn't Serve Files
19:40
Boot dev
Рет қаралды 68 М.
100+ Linux Things you Need to Know
12:23
Fireship
Рет қаралды 1,5 МЛН
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН