Tag Info

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


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:


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


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


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


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

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