Tag Info

Hot answers tagged

19

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 ...


11

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 ...


10

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 ...


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 ...


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

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

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

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 ...


6

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 ...


6

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


6

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 ...


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


5

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 ...


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

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 ...


5

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 ...


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 ...


5

Just go to your kernel source directory, make the changes you want, and make, then make modules_install. That's all it takes. If you want to build only one specific module, use: make M=path/to/module/directory For instance (from the kernel toplevel directory): make M=fs/ext4 make M=fs/ext4 modules_install To activate the changed modules, you must ...


5

It is not possible because system call table (called sys_call_table) is a static size array. And its size is determined at compile time by the number of registered syscalls. This means there is no space for another one. You can check implementation for example for x86 architecture in arch/x86/kernel/syscall_64.c file, where sys_call_table is defined. Its ...


5

In order to compile kernel modules for your running kernel, you need install the kernel headers. The following command should work: apt-get install linux-headers-$(uname -r) build-essential


5

Kernel modules (which you see under /proc/modules) are part of the Linux Kernel and needed for hardware support (like device drivers) or some other operating system feature. Loadable kernel modules in Linux are loaded (and unloaded) by the modprobe command. They are located in /lib/modules and have had the extension .ko ("kernel object"). You don't deal with ...


5

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 ...



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