21

I wanted to know in technical terms; what is the difference between BSD Kernel and Linux Kernel.
In Linux, we can download the source kernel then patch it and make and make modules it. Even we have multiple tools to edit the kernel config such as menuconfig, xconfig and ... .
But I couldn't find such kinda vast field on BSD. First, Could I download the BSD kernel? How could I config it? and ...

So what am I asking is: (Without referring to ancestry and etymology)

  • Is the Kernel in each case (in)dependent of a distribution?
  • Ways to config Each Kernel and tools available for the job?
  • Whether any Patch work could be done in each case?
  • Availability of the kernel outside the realm of distribution? (Kernel Sources)?
  • Flavour of Kernels available in each case (X??BSD/Linux) Like XEN/Vmware/GEN?

closed as too broad by terdon, Anthon, jasonwryan, slm, Braiam Mar 4 '14 at 23:36

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    There is not one BSD kernel as there is one Linux kernel... FreeBSD kernel, NetBSD kernel, OpenBSD kernel, etc. are all different (although they share a same basis). You should select one of them and read the documentation about downloading and compiling it. – lgeorget Mar 4 '14 at 22:09
16

Well, first off, you speak of BSD as if they're is only one. Technically, I suppose, there is the original one they were all derived from—last release was in 1995. Searching for "4.4-Lite2" finds several copies, you can find out more about it at the Wikipedia's Berkeley Software Distribution article.

Derived from it are—among many things*—FreeBSD, OpenBSD, and NetBSD. All three are open source, and you can get their source code. Someone who says BSD nowadays is probably referring to one of them.

If you want to quickly browse them, there is a FreeBSD and Linux Kernel Cross-Reference. That site also has several other Unix-like kernels.

Unlike Linux, however, which exists as a standalone kernel project, the BSD kernels often are part of a larger project—they aren't independent of the distro. For example, the FreeBSD kernel is part of the FreeBSD project and is maintained in the same subversion repository as the rest of the distro.

There are some places the kernel is used without the rest of the userland, e.g., in Debian's kFreeBSD port.


*: Parts of the original BSD have gone pretty far indeed. For example, you'll see the notes about portions of software being copyright The Regents of the University of California all over the place. A lot of that is BSD. If you read the many-page notice included with Windows, for example, it's there.

  • 3
    You mean each BSD distro have it own kernel as oppose to Linux ditros that all have the same? – r004 Mar 4 '14 at 22:23
  • 2
    @r004 yes, each one has its own kernel. – derobert Mar 4 '14 at 22:26
7

This is specific for FreeBSD, but the method and organisation are the same for OpenBSD and NetBSD: this cover the main 3 free BSD systems.

To get the sources (of the whole system) is quite easy, as you can install everything needed during a standard install (see FreeBSD install): enter image description here

You can also get the whole system sources through subversion: getting FreeBSD though svn.

Then you copy / edit your kernel configuration file:

cd /usr/src/sys/<your_arch>/conf
cp GENERIC MYKERNEL

Unfortunately, there is no fancy tool such as menuconfig or xconfig, but the configuration is quite short and quite easy to read / modify

vi MYKERNEL

Finally you can make and install your customized kernel:

make buildkernel KERNCONF=MYKERNEL
make installkernel KERNCONF=MYKERNEL

More information:

Not the answer you're looking for? Browse other questions tagged or ask your own question.