BSD Kernel Vs. Linux kernel?

428

Solution 1

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.

Solution 2

This is specific for FreeBSD, but the method and organization are the same for NetBSD: this cover two of the main 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 git (FreeBSD kernel moved to git in December 2020).

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:

Share:
428
PlanetUnknown
Author by

PlanetUnknown

Updated on September 18, 2022

Comments

  • PlanetUnknown
    PlanetUnknown over 1 year

    I have a custom business logic written in python - there are various reasons I can't write it directly in C#/.Net (time constraints etc.).

    I tried integrating the python program into .Net using IronPython but cannot (lxml being one of the reasons).

    I'm turning to the simpler solution of exposing this python logic as a web service which .Net can call.

    -

    First I thought I'd have to host my python code on a separate domain.. But I realized, I can install python on the same server & run this python service !!

    The functionality is simple - .Net passes a URL & the python program returns data as a long string.

    1.) What would be the simplest way to do this ?
    2.) Do I need to use a framework like web2py/werkzeug or is there something built in I can use ?!

    • Andrii Kalytiiuk
      Andrii Kalytiiuk over 11 years
      Please tell, have you considered option of starting Python part from command line with .NET part of the application (and re-directing output)? It seems to be simpler than implementation of web services.
    • Prasanth
      Prasanth over 11 years
      Have you checked out django? it's mvc in python. You can just write a view to achieve what you wanted: accept request, return data.
    • PlanetUnknown
      PlanetUnknown over 11 years
      @AndriiKalytiiuk - hmmm... I thought about that but how do I get the data returned from the python program ? Storing result of each function-call in a file would be cumbersome..
    • PlanetUnknown
      PlanetUnknown over 11 years
      @goldenparrot - thanks, yes have used dJango, but that'd be too heavy for this.
    • mpen
      mpen over 11 years
      What Andrii said... just use pipes. I'm using them to communicate between JS and Python right now quite successfully.
    • PlanetUnknown
      PlanetUnknown over 11 years
      AndriiKalytiiuk & @Mark - I did try invoking the python script directly & I think I can make the output files work. I used the regular Process.start(). What are you referring to when you say "pipes" ?
    • mpen
      mpen over 11 years
      @PlanetUnknown: en.wikipedia.org/wiki/Anonymous_pipe I just mean communicating over stdin/stdout.
    • lgeorget
      lgeorget about 10 years
      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.
  • PlanetUnknown
    PlanetUnknown over 11 years
    Thanks Tim, but compiling doesn't look possible especially given the issues I had creating a dll from lxml.
  • PlanetUnknown
    PlanetUnknown over 11 years
    I like what I see here.. ! If invoking the python using Process.start does pose any issues I will definitely try this.
  • Tim Hoffman
    Tim Hoffman over 11 years
    There is no need to compile anything. Did you see the chapter I referred to, this is normal python, with some addition python code registering the com interface.
  • Maciek Talaska
    Maciek Talaska over 11 years
    Please note, that using web-services seems to be more flexible, and starting python as a process has 2 drawbacks: 1) it will not perform that well, as python has to be started each time you want to get the result; it will not be possible to cache results as well. 2) it will be easier to replace each part (client or server) when the REST API is defined and working. It may seem to be more complicated than using Process.Start, but it is not tighly coupled.
  • r004
    r004 about 10 years
    You mean each BSD distro have it own kernel as oppose to Linux ditros that all have the same?
  • derobert
    derobert about 10 years
    @r004 yes, each one has its own kernel.