Reading currently running kernel configuration

Hi!

Is it possible to read configuration options for currently running kernel (without having the configuration file)? I need to find out if kernel was compiled with for example smp option.

Thanks in advance,

pbd
 
In addition to that, there are some commands to find out what's in your kernel:

strings /boot/kernel/kernel
dmesg -a

There's also a kernel option to include the entire kernel config file in the kernel itself, but I'm drawing a pre-coffee blank atm.
 
trev said:
Code:
options INCLUDE_CONFIG_FILE

Thanks everybody. Where can I find the configuration, if I build kernel with this option? Is it just included in plain text in the kernel file?
 
From sys/conf/NOTES:
Code:
strings -n3 /boot/kernel/kernel |sed -n 's/^__//p'
though, this seems to be broken on my -CURRENT machine.
 
A simple
Code:
> kldstat -v
will give you an idea of what devices are in the kernel, though if all you really want is to know if smp is on
Code:
> sysctl kern.smp
kern.smp.forward_roundrobin_enabled: 1
kern.smp.forward_signal_enabled: 1
kern.smp.topology: 0
kern.smp.cpus: 2
kern.smp.disabled: 0
kern.smp.active: 1
kern.smp.maxcpus: 32
kern.smp.maxid: 1
should suffice.
 
I realize this is a very old thread but a search for finding out if my kernel had the COMPAT_FREEBSD11 option on led me here. With the hints from above I've found that sysctl kern.conftxt yields the complete list of options and devices.
 
With the hints from above I've found that sysctl kern.conftxt yields the complete list of options and devices.
Only if the kernel has been compiled with this option:
Code:
options         INCLUDE_CONFIG_FILE     # Include this file in kernel
 
Back
Top