FreeBSD 9.1: HowTo Load a Kernel Module

by on July 29, 2013 · 0 comments· LAST UPDATED July 29, 2013

in , ,

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?

Tutorial details
DifficultyEasy (rss)
Root privilegesYes
Requirementskldload
Estimated completion timeLess than a minute
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

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 0 comments… add one now }

Leave a Comment

Tagged as: , , , , ,

Previous Faq:

Next Faq: