Sign in to follow this  
Followers 0
iPhreak

"The BSD kernel is cleaner than the Linux kernel"

24 posts in this topic

I have heard this a lot, and wondered if anyone can give a simple explanation of how and why the BSD kernel is cleaner than the Linux kernel, if it truely is...

0

Share this post


Link to post
Share on other sites

The main argument for the BSD kernel being 'cleaner' than Linux is because the codebase is managed by a central team that determines the kernel roadmap; Linux uses the 'bazaar' style approach, where any random Joe can contribute source code to add new features, as long as it is approved by Linus or other maintainers. From what I have heard, the NetBSD and the OpenBSD kernels have been described as 'cleaner' by some people (I do not know if cleanliness is also attributed to the FreeBSD kernel). The NetBSD kernel is clean because it has to support 50 different platforms, and to rationally do this, one should segregate any platform specific code and not use '1337 hacks' to gain performance on one architecture while screwing up the rest. The NetBSD team also takes a conservative approach to adding 'features,' so the OS does not always have the latest 'k-rad uber-1337' features, but this practice diminishes feature-creep, which is another reason for code messiness. The OpenBSD kernel is supposedly cleaner because of the strict auditing that Theo and his team have performed on the codebase. Complexity is the preferred hiding place of bugs, so one should eliminate complexity whenever possible (unless the complexity is necessary to Do The Right Thing).

Of course, the cathedral style also comes with some disadvantages, such as the difficulty of trying new ideas, so it seems that 'cleanliness' isn't always what it's cracked up to be.

Edited by Elzair
0

Share this post


Link to post
Share on other sites

I have also heard that BSD works a bit faster than *nix, is this true? If so how and why?

One person that told me this is Dr.Z2A, he said that it seems to work a lot faster.

0

Share this post


Link to post
Share on other sites

It might be faster due to two reasons, one being the filesystem it uses (ufs) and the other being the fact that if you use the ports system, you are compiling everything from source (similar to gentoo / slackware) which will increase the speed of the program.

Personally I notice freebsd performing just a tad faster then my gentoo partition.

0

Share this post


Link to post
Share on other sites

Speed is a very subjective issue and depends on many things, such as resource management, OS optimization, etc. Compiler optimizations rarely improve performance to any noticeable degree; all they typically do is make the system unstable. I have heard that FreeBSD's resourse management is better than Linux's. I have also heard that NetBSD runs faster than FreeBSD on uniprocessor systems, since the FreeBSD team has optimized their system for SMP at the expense of uniprocessor performance.

Yes, you CAN sometimes drastically improve the performance of a program with compile-time options, but, in those special cases, you are better off writing assembly.

Edited by Elzair
0

Share this post


Link to post
Share on other sites
I have also heard that BSD works a bit faster than *nix, is this true? If so how and why?

One person that told me this is Dr.Z2A, he said that it seems to work a lot faster.

BSD is *NIX.

Edited by Merk
0

Share this post


Link to post
Share on other sites
Compiler optimizations rarely improve performance to any noticeable degree; all they typically do is make the system unstable.

How exactly does compiling make the system unstable? (granted that the person doing the compiling knows what they are doing)

0

Share this post


Link to post
Share on other sites

If you know what you are doing, then compiling from source should not break your system. However, a lot of people do not know what they are doing, and (try to) compile their system with crazy settings, such as these:

CFLAGS="-g0 -DTT_CONFIG_OPTION_BYTECODE_INTERPRETER -pipe -O3 -march=pentium4 -fweb -funswitch-loops -funroll-all-loops -funit-at-a-time -fsched2-use-traces -fsched2-use-superblocks -fsched-stalled-insns=12 -frename-registers -fprefetch-loop-arrays -fpeel-loops -fomit-frame-pointer -fmerge-all-constants -finline-limit=32768 -finline-functions -ffunction-sections -ffast-math -fdata-sections -fbranch-target-load-optimize2"

CXXFLAGS="-g0 -DTT_CONFIG_OPTION_BYTECODE_INTERPRETER -pipe -O3 -march=pentium4 -fweb -funswitch-loops -funroll-all-loops -funit-at-a-time -fsched2-use-traces -fsched2-use-superblocks -fsched-stalled-insns=12 -frename-registers -fprefetch-loop-arrays -fpeel-loops -fomit-frame-pointer -fmerge-all-constants -finline-limit=32768 -finline-functions -ffunction-sections -ffast-math -fdata-sections -fbranch-target-load-optimize2 -fvisibility-inlines-hidden -fabi-version=0 -fpermissive -fno-enforce-eh-specs"

You can make your system unstable with just these options:

CFLAGS="-O3  -funroll-all-loops -ffast-math"
CXXFLAGS="$CFLAGS"

More reasonable CFLAGS settings would look like this:

CFLAGS="-O2 -pipe -fomit-frame-pointer -march=pentium4" #NOTE: Replace 'pentium4' with whatever model processor you have.
CXXFLAGS="$CFLAGS"

Edited by Elzair
0

Share this post


Link to post
Share on other sites

Back in the late 90's I used to spend time with the BSD/OS source---that was BSDi's version of BSD for x86 PCs. I felt that the kernel code was quite clean. Some of that was because it was all written out in the consistent BSD indentation style and seemed to be free of kludges. But I think that a significant part of that cleanness was that the kernel implemented relatively few features by today's standards. It implemented only a small set of features that were well-understood, definitely *not* experimental. Features that you could generallly look up in a textbook (perhaps one of the BSD daemon books). And when you looked them up, the BSD implementation was what you saw described there.

At that time, BSD/OS didn't implement loadable kernel modules, and IIRC the 4.4 BSD daemon book said BSD didn't implement LKMs because they were dangerous. That's a very conservative attitude, and I remember it giving me great confidence that the BSD way was The Right Way.

But the "features" bug eventually bit me. I switched to FreeBSD so I could get LKM support. At that time, FreeBSD didn't have too many extra features, and I felt that the FreeBSD kernel was just about as clean as what I was used to in BSD/OS. But over the years, the FreeBSD developers added a lot of features quite quickly. Rightly or wrongly, by the time FreeBSD 5 was under development, I no longer had the sort of near-religious confidence in the kernel that I once had with BSD/OS. It wasn't merely a fear of bugs, it was because the kernel was no longer an unchanging set-in-stone monument that precisely mirrored the ideas in my textbook.

But that's just how I happened to feel. You could probably argue that FreeBSD had to add features to stay "relevant" in a modern environment, and some initial instability was inevitable. I'd say FreeBSD is still quite an admirable achievement.

0

Share this post


Link to post
Share on other sites

Compiling from source brings little to no speed improvement. And unless you are retarded, you won't make unstable binaries. the whole 'It feels faster' thing is really funny to me. If you can 'feel' 0.2 milliseconds, well good for you Mr. Superhuman. No operating system/distro/binary is really gonna be any faster than the other

0

Share this post


Link to post
Share on other sites
I have also heard that BSD works a bit faster than *nix, is this true? If so how and why?

One person that told me this is Dr.Z2A, he said that it seems to work a lot faster.

BSD is *NIX.

Well, Linux. I meant Linux distros.

0

Share this post


Link to post
Share on other sites

"linux kernel is bloated"

linux has alot more useless features the BSD, but you can always disable them.

BSD dose however have supiriour resource manegment.

0

Share this post


Link to post
Share on other sites
I have also heard that BSD works a bit faster than *nix, is this true? If so how and why?

One person that told me this is Dr.Z2A, he said that it seems to work a lot faster.

Strom, I strongly advise you test out BSD. Fairly enough, the syntax slightly differs, but if you try out PC-BSD or DesktopBSD you may find things easier, or simply delve into FreeBSD if you'd want. :)

0

Share this post


Link to post
Share on other sites
"linux kernel is bloated"

linux has alot more useless features the BSD, but you can always disable them.

BSD dose however have supiriour resource manegment.

The Linux kernel is widely known to be messy, but it works efficently. Also, chedder, kindly spell properly. :) Thanks.

0

Share this post


Link to post
Share on other sites
Compiling from source brings little to no speed improvement.  And unless you are retarded, you won't make unstable binaries.  the whole 'It feels faster' thing is really funny to me. If you can 'feel' 0.2 milliseconds, well good for you Mr. Superhuman.  No operating system/distro/binary is really gonna be any faster than the other

I am going to agree I switched from Gentoo (source) to Arch (binary) simply because I didn't have the time (hours and hours) to compile everything anymore. The speed of Arch is pretty much the same if not faster then my previous Gentoo installs.

0

Share this post


Link to post
Share on other sites
I have also heard that BSD works a bit faster than *nix, is this true? If so how and why?

One person that told me this is Dr.Z2A, he said that it seems to work a lot faster.

Strom, I strongly advise you test out BSD. Fairly enough, the syntax slightly differs, but if you try out PC-BSD or DesktopBSD you may find things easier, or simply delve into FreeBSD if you'd want. :)

Actually this is Exvitel. I made this when the whole strom's drawing of himself turned into an iPod commercial, now an iPhreak.

0

Share this post


Link to post
Share on other sites
Actually BSD ISN'T Unix, at least, no more than Linux is.

BSD isnt Unix? What is considered actual Unix?

0

Share this post


Link to post
Share on other sites
I have also heard that BSD works a bit faster than *nix, is this true? If so how and why?

One person that told me this is Dr.Z2A, he said that it seems to work a lot faster.

Strom, I strongly advise you test out BSD. Fairly enough, the syntax slightly differs, but if you try out PC-BSD or DesktopBSD you may find things easier, or simply delve into FreeBSD if you'd want. :)

Actually this is Exvitel. I made this when the whole strom's drawing of himself turned into an iPod commercial, now an iPhreak.

Oh, sorry about that.

0

Share this post


Link to post
Share on other sites
Actually BSD ISN'T Unix, at least, no more than Linux is.

BSD isnt Unix? What is considered actual Unix?

Unix is a trademark of the Open Group. To call your OS a 'Unix' operating system, you must submit your OS to the Open Group, and they will test its comformance to the Single Unix Specification (a combination of the Unix, POSIX, and X specifications). The testing fee is very high (I heard it was about $50,000 US!), so it is not practical for hobbyist projects; the testing process takes a few months, so an open source OS release might be obsolete before it can be called 'Unix'; and the test applies to the entire operating system (not just the kernel), and it only applies to the release of the OS submitted for testing. If Novell submitted Suse 9.3 for Unix certification, and it passed the tests, Debian could not call their Linux distribution a Unix operating system, and Novell would have to resubmit Suse 10 for SUS testing.

The BSD's may not be called Unix, but they are similar enough that most *nix people like them. The BSD's are about as Unixy as any of the 'official' Unix operating systems: Solaris, AIX, HP-UX, Irix (QNX?). Some people think that the BSDs are closer to a more 'traditional' Unix operating system than any of the Linux distributions are. Frankly, I don't give a damn; I use the BSDs and Linux because I like them all.

Edited by Elzair
0

Share this post


Link to post
Share on other sites

BSD derived directly from Unix (AT&T brought it to Berkely and they stole it, hippies!) but after BSD was f orced to make the BSD license, all code that was actually Unix code was re-written. So it might work the same way as Unix, but then so does most GNU stuff, so BSD is about as Unix as Linux

0

Share this post


Link to post
Share on other sites
BSD derived  directly from Unix (AT&T brought it to Berkely and they stole it, hippies!) but after BSD was f orced to make the BSD license, all code that was actually Unix code was re-written.  So it might work the same way as Unix, but then so does most GNU stuff, so BSD is about as Unix as Linux

Well said

BSD is Unix rewritten. AT&T wanted to start charging a license fee for their UNIX (berkely folks happyly "no thanks" and recoded their own OS with similar functionality.

0

Share this post


Link to post
Share on other sites
BSD derived  directly from Unix (AT&T brought it to Berkely and they stole it, hippies!) but after BSD was f orced to make the BSD license, all code that was actually Unix code was re-written.  So it might work the same way as Unix, but then so does most GNU stuff, so BSD is about as Unix as Linux

The Berkeley CSRG did not steal Unix; Ken Thompson freely gave it to them. In the 1970's, the government forbade AT&T from entering the software market, so Unix was not a viable product, and Ken Thompson and Dennis Ritchie were able to give it away to anyone who asked for it. Universities adopted Unix because it ran on a popular platform, the PDP-11, and the source code was free enough that teachers used it in operating systems courses. Many sites made changes to the system, and the most popular changes were implemented in the next official release. Even though AT&T marketed their own fork of the Unix (named System III, IV, & V) versions 8, 9, and 10 of the 'Unix Time-Share System, were based on BSD 4.X.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0