Blog

03/06/2019

FreeBSD 9.1: HowTo Load a Kernel Module



I am a new FreeBSD Unix users. I am using FreeBSD version 9.1 and how do I load a kernel module called drm using command line option?

You need to use the kldload command. It loads file.ko (kernel module or device drive) into the kernel using the kernel linker. The syntax is:

kldload module-name

OR

kldload module-name-1 module-name-2

OR

kldload [option] module-name

Please note that if multiple modules are specified then an attempt will be made to load them all, even if some fail. The .ko extension name is not mandatory when loading a given module using kldload. It does not hurt to specify it though.

/boot/kernel directory

/boot/kernel# ls -l /boot/kernel/
# ls -l /boot/kernel/ | more

Examples

Open a terminal or login using ssh. You must login as root user:
# kldload foo
# kldload drm

To load by file name within the module path:
# kldload drm.ko
To load by relative path in the current dir:
# kldload ./name.ko
To load by full path:
# kldload /boot/kernel/drm.ko
To see all loaded modules, enter:
# kldstat
To remove or unload module, enter:
# kldunload drm

Posted by: SXI ADMIN

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

14/08/2019

How to KVM, QEMU start or stop virtual machine from command line (CLI)

KVM or Kernel Based Virtual Machine is a popular virtualization technology. It allows you to run virtual guest machines over a host machine. To start...
14/08/2019

How to Docker backup Saving and restoring your volumes

Running a Docker volume backup First, we spin up a temporary container, and we mount the backup folder and the target Docker volume to this container....
12/08/2019

How to Start and Enable Firewalld on CentOS 7

In this article, we discuss how to start and enable firewalld. It is highly recommended that you have a firewall protecting your server.Pre-Flight CheckThese...