Tag Info

Hot answers tagged

20

A kernel module is a bit of compiled code that can be inserted into the kernel at run-time, such as with insmod or modprobe. A driver is a bit of code that runs in the kernel to talk to some hardware device. It "drives" the hardware. Most every bit of hardware in your computer has an associated driver[*]. A large part of a running kernel is driver code; the ...


19

To get this information from sysfs for a device file, first determine the major/minor number by looking at the output of ls -l, eg $ ls -l /dev/sda brw-rw---- 1 root disk 8, 0 Apr 17 12:26 /dev/sda The 8, 0 tells us that major number is 8 and the minor is 0. The b at the start of the listing also tells us that it is a block device. Other devices may ...


16

When the kernel is tainted, it means that it is in a state that is unsupported by the community. Most kernel developers will ignore bug reports involving tainted kernels, and community members may ask that you correct the tainting condition before they can proceed with diagnosing problems related to the kernel. In addition, some debugging functionality and ...


14

Finding the Kernel Driver(s) The victim device $ lsusb Bus 010 Device 002: ID 046d:c01e Logitech, Inc. MX518 Optical Mouse Bus 010 Device 003: ID 051d:0002 American Power Conversion Uninterruptible Power Supply We're going to try to find out what driver is used for the APC UPS. Note that there are two answers to this question: The driver that the kernel ...


13

I have two suggestions to start. The first you're not going to like. No matter how stable you think your overclocked system is, it would be my first suspect. And any developer you report the problem to will say the same thing. Your stable test workload isn't necessarily using the same instructions, stressing the memory subsystem as much, whatever. Stop ...


9

It is, unless your root volume is on an LVM, on a dmcrypt partition, or otherwise requires commands to be run before it can be accessed. I haven't used an initrd on my server in years. You need at a minimum these modules built in: the drivers of whatever controller where your root volume disk lives the drivers necessary to "get to" that like PCI, PCIe ...


9

For the first part of the question, I've looked and couldn't find a better way to detach a USB driver than what you're already doing with libusb. As for the second part of the question, udev can react to driver loading, but not force a specific driver to be assigned to a device. Every driver in the Linux kernel is responsible for one or more devices. The ...


8

Udev loads modules automatically depending on what kind of hardware it finds. You can "blacklist" modules in order to stop them being autoloaded as described in the Gentoo udev guide.


8

There are pretty good directions on doing it here, titled: Disable / enable keyboard and mouse in Linux. Example You can list the devices with this command. $ xinput --list "Virtual core pointer" id=0 [XPointer] "Virtual core keyboard" id=1 [XKeyboard] "Keyboard2" id=2 [XExtensionKeyboard] "Mouse2" id=3 [XExtensionKeyboard] And ...


7

First things first, debug the module? Just see if you can load it up in gdb it might point you straight at a line that uses the relevant variable(or close to it). oh, and you might find this article useful


7

A patch or a git pull request is submitted with a request for comments. This is sometimes done to the kernel mailing list, but is frequently done on other lists pertaining to the subject of the patch first. Sometimes discussion about a proposed module is brought up before any code is even written. People ask why the patch is necessary, state their ...


7

There are many kernels in existence. Linux is not the only game out there, but it's the most widely used. Some people recommend the minix kernel to understand operating system concepts. I would go with Linux 2.6.x series as it's the most common and it won't be wasted on something (almost) nobody uses. Solaris, XNU (Mac), FreeBSD and Dragonfly are ...


7

Firstly: For the baby stages, writing various variations on "hello world" modules, and virtual hardware drivers, are the best way to start (real hardware introduces real world problems best faced when you have more of an idea what you are doing). "Linux Device Drivers" is an excellent book and well worth starting with: http://lwn.net/Kernel/LDD3/ LDD ...


7

You can use the udevadm tool to discover this. The command would be udevadm info -a -n /dev/sda, and then look at the DRIVER== parameters. # udevadm info -a -n /dev/sda | grep -oP 'DRIVERS?=="\K[^"]+' sd ahci This shows that there are actually 2 drivers involved in providing this device, sd and ahci. The first one, sd is directly responsible for the ...


7

Because those programs are build to use things defined in the kernel headers: busybox-1.22.1]$ egrep -RHn '^#include <linux' modutils/modutils-24.c:194:#include <linux/elf-em.h> include/fix_u32.h:17:#include <linux/types.h> libbb/loop.c:11:#include <linux/version.h> console-tools/openvt.c:23:#include <linux/vt.h> ...


6

Find a module or driver you want to modify or start with a null / hello world type of module and build from there. Specifically work with a module because it will allow you to load, unload, recompile and reload the code into a running kernel. Later you can get into the core bits, but basically modules have all kinds of and you can do pretty much whatever you ...


6

It depends. If you have a small amount of memory, the use of modules may improve the resume as they are not reloaded every time (I found it significant on 2 GiB of RAM but not on 4 GiB on traditional harddrives). This is especially true when due to some bug in the battery module (regardless of being compiled-in or as module), it took very long to start ...


6

Have a look at the CONFIG_FIRMWARE_IN_KERNEL, CONFIG_EXTRA_FIRMWARE, and CONFIG_EXTRA_FIRMWARE_DIR configuration options (found at Device Drivers -> Generic Driver Options). The first option will enable firmware being built into the kernel, the second one should contain the firmware filename (or a space-separated list of names), and the third where to look ...


6

Read the documentation about Submitting Drivers as well as about Submitting Patches: You can find the appropriate address in the MAINTAINERS file You driver must be licensed under GPL but you can dual-license it, e.g. put it under GPL and a BSD license.


6

I found the following answer here: The short answer is that the .ko file is your object file linked with some kernel automatically generated data structures that are needed by the kernel. The .o file is the object file of your modules - the result of compiling your c files. The kernel build system then automatically creates another C file ...


6

Your nvidia module is perfectly loaded and working. The problem lies in modinfo. modinfo fetch the list of known modules by reading the /lib/modules/$(uname -r)/modules.* files, which are usually updated with depmod. If depmod -a has not been run after installing the nvidia module, then modinfo does not knows about it. This does not prevent anybody from ...


6

If you're on fedora (or any other distro using systemd) you can automatically load the module via modules-load.d: create the config file: /etc/modules-load.d/rt2800usb.conf open it and edit like this (add the module name): rt2800usb next time you reboot the module should be automatically loaded Troubleshooting: Check if systemd service loaded the ...


6

You can find the answer in the wiki: the idea is that one does not use /etc/modprobe/blacklist.conf. Instead, say you want to blacklist pcspkr. You create a pcspkr.conf file in /etc/modprobe and put blacklist pcspkr inside. Then run depmod -ae && update-initramfs -u


6

The make localmodconfig command is still the right tool for the job. In fact make localmodconfig runs scripts/kconfig/streamline_config.pl. File input When reading the streamline_config.pl (perl) source code, there is an undocumented feature my $lsmod_file = $ENV{'LSMOD'}; that allows file input for loaded module detection instead of the output from the ...


6

I had the exact same problem when i was trying to install arch on virtualbox earlier today. The solution is to run depmod $ depmod 3.14.4-1-ARCH After running modprobe again, it should work. You can use uname -r to find your kernel version string. Source


6

os-prober (used by update-grub) requires the following kernel features to detect the Windows 8 boot loader. Device Drivers -> Multiple devices driver support (RAID and LVM) (CONFIG_MD) -> Device mapper support (CONFIG_BLK_DEV_DM) File Systems -> FUSE (Filesystem in Userspace) support (CONFIG_FUSE_FS) DOS/FAT/NT Filesystems -> NTFS file system support ...


5

As far as I know, there is no speed difference. I think you will gain a few kB of kernel memory as the granularity of allocations is one page, so on typical architecture each module wastes an average of about 2kB (½ page) per would-be module. Even on embedded systems, that's hardly significant. You also gain a little disk space as the modules can be ...


5

insmod isn't the best tool to load modules - use modprobe instead, it's smarter. In modprobe's man page, you'll find that it has a --force option which might load a module with conflicting version information. As you said, this is dangerous and should essentially never be used. You pick up the pieces if your system blows up.


5

lsmod lists all loaded modules, and has a Used by column. If that is 0 for module A, then no other loaded module has a dependency on it. This does not mean that removing the module is safe. There is no way that I can think of that you could determine if a module is "in use". Device driver modules will (usually) increase their Used by count when they are ...


5

The modules listed in /etc/mkinitcpio.conf are included in the intitrd when it is generated with mkinitcpio -p linux. This loads the temporary filesystem into memory, and needs to include modules necessary to create this successfully, depending on your setup. An example would be adding raid1 to your modules line in /etc/mkinitcpio.conf to assemble a Raid1 ...



Only top voted, non community-wiki answers of a minimum length are eligible