1 00:00:06,639 --> 00:00:10,109 In this video, I'd like to explain how drivers are loaded in Linux. 2 00:00:11,750 --> 00:00:15,919 When Linux is installed, an initial RAM drive or initrd or 3 00:00:15,919 --> 00:00:20,089 an initial RAM file system which is init ramfs is generated. 4 00:00:21,210 --> 00:00:26,219 This is an image that is loaded by the Linux kernel while it is booting. And it contains drivers 5 00:00:26,219 --> 00:00:31,229 that were detected while installing. And that makes sure that you can work with all of your hardware. 6 00:00:31,929 --> 00:00:38,563 This is for essential hardware only. There's also other hardware. This other hardware is taken care of by a 7 00:00:38,563 --> 00:00:45,196 systemd process which is called SYSTEMD UDFD and that is happening while booting or when the hardware is connected. 8 00:00:45,196 --> 00:00:51,829 Systemd UDFD is also a plug and play manager that allows you to load hardware on demand. 9 00:00:53,030 --> 00:00:58,170 Occasionally you can use the modprobe command to load kernel modules manually. 10 00:00:58,170 --> 00:01:03,310 And these kernel modules are drivers. So that is actually pretty important. 11 00:01:04,030 --> 00:01:06,230 Let's talk about kernel modules a little bit more. 12 00:01:06,849 --> 00:01:10,534 If you want to know which drivers are loaded, LSMOD is 13 00:01:10,534 --> 00:01:14,219 a command to use and LSMOD shows currently loaded kernel modules. 14 00:01:15,140 --> 00:01:19,365 LSPCI is also a useful command. It shows PCI devices in the minus 15 00:01:19,365 --> 00:01:23,590 K will show you kernel modules that are loaded for these specific devices. 16 00:01:24,689 --> 00:01:28,609 A little bit less important is LSUSB, which will show USB devices. 17 00:01:29,379 --> 00:01:33,534 ModProbe is what you can use to load kernel modules manually. And modprobe 18 00:01:33,534 --> 00:01:37,689 R is used to remove kernel modules from memory. Let me show you. 19 00:01:38,569 --> 00:01:44,780 Okay, I'm using sudo lsmod and that is showing all the modules that are available. 20 00:01:45,560 --> 00:01:51,850 Now that doesn't mean too much and that is why I rather use sudo lspci k which 21 00:01:51,850 --> 00:01:58,140 is showing the PCI bus and and for every device on the PCI bus it also shows 22 00:01:58,140 --> 00:02:04,430 the kernel module. So here we have the Ethernet controller for instance, with the kernel module E1000E. 23 00:02:06,329 --> 00:02:09,069 Now kernel modules by itself are interesting. 24 00:02:09,590 --> 00:02:14,204 The Linux kernel, the open source kernel, provides modules for most of the 25 00:02:14,204 --> 00:02:18,819 devices. But for some devices you would rather have the proprietary kernel module. 26 00:02:19,419 --> 00:02:25,435 Imagine for instance that you have installed an expensive Nvidia card in your system to perform AI calculations. You 27 00:02:25,435 --> 00:02:31,449 really need the proprietary driver. That's a little bit beyond the scope of what we are doing here. 28 00:02:32,250 --> 00:02:36,229 For here I would like you to be able to investigate what is going on. 29 00:02:37,050 --> 00:02:42,610 So do we see anything for video grab video? Do we have anything? 30 00:02:43,490 --> 00:02:45,509 Oh no, probably grabbing the wrong thing. 31 00:02:47,530 --> 00:02:52,253 Well then we need to look here. Oh look there we have the 32 00:02:52,253 --> 00:02:56,976 VGA compatible controller which is VMW GFX, the VMware graphics driver that's provided 33 00:02:56,976 --> 00:03:01,699 by the virtualization tools and there's nothing you want to change that. 34 00:03:03,039 --> 00:03:08,474 So ModProbe ModProbe R, that's a little bit less common because that is what you 35 00:03:08,474 --> 00:03:13,909 would use to manually load modules, and that's something that you don't do too often. 36 00:03:14,409 --> 00:03:19,480 LSUSB is interesting if you have connected USB devices. LSUSB is giving information 37 00:03:19,480 --> 00:03:24,550 about the USB bus and all the devices that were found there.