Tag Info

New answers tagged


The main risks developing kernel modules are that you can crash your system much more easily than with regular code, and you'll probably find that you sometimes create modules that can't be unloaded which means you'll have to reboot to re-load them after you fix what's wrong. Yes, a VM is fine for this kind of development and it's what I use when I'm ...


Assuming you aren't trying to write a driver for actual hardware, this is a great way to work on modules. You can snapshot the working system, and if you blow something up, just go back to the snapshot. If you can, make a full duplicate of the VM, just in case the snapshot system is weirder than I think. :)


Initramfs has all the needed information which OS needs to boot the system up.. It has all the file system information (like which devices to from and which devices has root fs which needs to be mounted for system to boot up.) and the contents are generated specific to the kernel. You can boot from another image which should have all needed info. Vmlinux ...


/lib/module/$(uname -r) is a directory on your diskĀ¹. It contains files, most of which (*.ko) are module files: files that contain the code of a kernel module. The files in this directory (and its subdirectories) contain, in principle, modules that you can load into your running kernel. /sys/module is a directory on a virtual filesystem that exposes kernel ...


No, that is not possible because the kernel Makefile that you have to use to compile a module has to call another Makefile defining obj-m. The usual Makefile for an out of tree module loks like that: ifneq ($(KERNELRELEASE),) obj-m := mymodule.o else KDIR := /lib/modules/`uname -r`/build all: $(MAKE) -C $(KDIR) M=$$PWD endif The first time it is ...


The directory /sys/module/ shows all modules in the system by their name as folders with diverse information needed by the system. The directory /lib/module/$(uname -r) contains the kernel module files, stored in a folder hierarchy according to their function. For example, the Software Watchdog kernel module file would be in /lib/module/$(uname ...


Given that you added the tag /kernel in addition to /linux-kernel, I assume that you are interested in the generic case as well. In Solaris since 1991, everything is dynamically loaded, except the basic kernel glue code, the default scheduler and the pager/swapper. Even the root filesystem code and the module loader is dynamically loaded. This avoids the ...


You do this as part of the configuration process, usually when you run make config, make menuconfig or similar. You can set the module as built-in (marked as *), or modularised (marked as M). You can see examples of this in a screenshot of make menuconfig, from here:


Type modprobe and press tab, the autocomplete list should contain all the loadable modules

Top 50 recent answers are included