Amazing how quickly this thread derailed.
Although I really don't like "RTFM" kind of answers my first and foremost advice would still be to "RTFH"; Read The Fine (FreeBSD) Handbook, because it contains all the basic information which you seem to be after. I'm specifically referring to
chapter 9 of the handbook which explains how and why one would build a customized kernel.
The reason I point this out is because of the OP's
second post in this thread where he clearly shows to be unaware that you can indeed customize the kernel. But also seems to be unaware of the modular build. Yes; the FreeBSD kernel is modular, and can load (and optionally unload) kernel modules in the same way as Linux can (look into the
kldload(8) manualpage for that, don't forget to pay attention to the
SEE ALSO section since it contains very useful references as well).
As to the "
which one is better" question my answer would be "It depends" as both have advantages and disadvantages.
When looking at the process of customization I'd say that for single machines and/or servers the Linux process is far out superior because it provides an interactive option to configure your kernel. Not only that but it also supports all commonly used environments such as the commandline (you can even script this if you want), a graphical environment and even X itself. Where (IIRC) it even has native support for both X as well as GNOME. Keep in mind: I could be wrong on the GNOME part (and I'm not interested enough to look this up), but it most certainly knows the
make xconfig
option.
FreeBSD on the other hand provides a common text file with (most) options mentioned which you can use to base your own configuration on. Either by copying the file and editing it to suit your needs or by simply including it and then overruling whatever option you (don't) need. It could be a little more tedious in comparison.
However... When looking at maintaining a whole server park this immediately becomes a different ballgame. Where Linux relies on a single configuration file called
.config which, also due to the hidden nature, isn't very easy to work with, FreeBSD allows you to use whatever you want. I'm now referring to the
KERNCONF compiler option which allows you to specify what kernel configuration you want to use. Not only makes this the configuration file a
lot more portable, it also makes the whole process more flexible (in my opinion) because you could actually build several kernel configurations side-by-side and use them as such.
Fictional example (something I thought about but never got around to implement): building both a customized and a fail-safe kernel, where the latter is basically the kernel provided "as is" by the system (default configuration). On Linux this would require a lot of tinkering, on FreeBSD such a setup can be done "out of the box".
SO yeah, which one is better? I don't know... The real question here which should matter, in my humble opinion naturally, is if this even matters at all? Simply because you can't define "better" in the first place.
Having all the facts out of the way I'd also like to vent my opinion on the matter. Personally I do think the FreeBSD kernel is better in some ways, or perhaps more professional would be a better description for it. It starts with the configuration process of course, but what to think about all the different kernel variables which you can use to tweak the system into doing exactly what you want?
I'm now of course referring to the kernel variables which you can easily check yourself using
sysctl (see for example the
$ sysctl -ah | less
command). And which you can set using that very same command or, if you need this to be set during the boot stage, using the
/boot/loader.conf file (see
loader.conf(5)).
In this field I personally think that the FreeBSD kernel is by far superior feature wise. From controlling user access, RAID (storage) flags, access limits to simply checking up on current activities. However, in all fairness, also keep in mind that I haven't paid any attention to the developments which have happened in the Linux kernel (apart from stuff you sporadically pick up on common tech magazines) for over two - three years or so.
Still; flags like
security.bsd.see_other_uids keep amazing me; all supported "out of the box" ((dis)allowing users to see processes other than their own).
Then another pro (and once again I'm only stating opinions here): the way the kernel interacts with the base system. You don't simply download "the kernel source", but you download the full FreeBSD source code (the base system) from which the kernel can also be built. Effectively allowing you to build both a customized kernel as well as a customized base system. Using that approach you can be fairly sure that the both of them will interact fine with each other. After all; you're using the same source tree in the first place. That's a totally different approach than a kernel with a lot of different ("separate") user-land tools built "around" it.
Finally... To close off with some cold hearted facts again. A very important, yet also usually completely overlooked feature is of course the documentation. It's cool if your kernel can support a thousand and one (night) features, but who is going to use them if only the programmers know for sure how to use them?
I already mentioned
Chapter 9 of the FreeBSD handbook (dealing with kernel configuration), but there's a lot more. If you really wish to know more about the kernel then you'd also want to learn how it actually works. How it functions; how does it get loaded, how does it treat those different modules, what about the whole
architecture? Enter the
FreeBSD Architecture Handbook. Which will explain the bootstrapping process, jail sub systems, (virtual) memory usage/administration and of course how the device drivers ("kernel modules") work, behave and are to be built.
Which immediately touches a different subject: developers. So you want to be a FreeBSD developer? You want the
FreeBSD Developers Handbook then. Not only does this handbook explain more about the whole architecture and the structure behind FreeBSD in general, it also provides
more technical details on how to build and debug your kernel.
That's a whole mouth full
So if we then head over to
kernel.org in comparison I think it's safe to say that the documentation part is a little lacking in comparison; I couldn't find a straight forward link which explained to me how to compile the kernel.
Eventually I checked the
FAQ section and found a reference to the
Kernel newbies website. It still doesn't feature an obvious link which points you to the instructions on how to compile the kernel, but if you check its own
FAQ section you will finally discover the entry on
How to compile the Linux kernel.
Both projects provide the documentation on how to set the whole thing up, but of course I think the FreeBSD documentation is much more straight forward.
Which boils down to my end conclusion here; there is no "better" kernel.
In general both roughly provide the same feature set, both can be customized, both are modular and both are documented.
Would I have to chose between the two then I would say that the FreeBSD counterpart appears to be much more professional, based on both the feature and documentation set it provides.