Help - Search - Members - Calendar
Full Version: [FAQ] How is Linux Layered?
Neowin Forums > *nix Customization & Support > Completed *nix HOWTO & FAQs
markjensen
"I don't understand how the kernel, OS and GUI are layered in Linux..."

This FAQ is a quick run-down that I have written to briefly introduce GNU/Linux (often referred to as just "Linux") to someone completely unfamiliar with how a typical Linux system is structured. The target audience for this is quite likely someone who is considering installing Linux for the first time, or who has installed it recently, but is having difficulty dealing with the variety of choices.

A Linux system usually consists of several layers, many of which have numerous alternatives available for selection. I will start at the base level, and then build up.

The Linux Kernel: The Engine
www.kernel.org
The heart of a Linux system is the Linux kernel. It is the very low-level software that deals directly with the computer's hardware. On its own, a kernel doesn't do anything. It just sits there waiting to be told what is needed.

The Linux kernel has a production branch that uses an even number as the first number after the decimal point (2.2, 2.4, 2.6, etc.). Any development work that is being worked on for the next major revision of the kernel will use an odd number after the first decimal point (2.5, 2.7) Note, that at the time I am writing this, there is no 2.7 version, as all new features are being quickly incorporated into the production 2.6 series.

The GNU OS: What Really is Running
www.gnu.org
A kernel, by itself, doesn't get work done. This is where the GNU Project (part of the Free Software Foundation, or FSF) comes in. they provide the 'tools' needed to accomplish work. Think of these as the basic set of commands to perform operations.

GNU can be used by other kernels, as well. The FSF's own Hurd kernel (under development) uses it, and there are projects to get GNU on BSD (which typically is a self-contained kernel/OS). The nice thing about this is that the higher levels are independent of the kernel, meaning that you can run the same sets of apps (including Window Managers - more on that later) regardless what kernel you choose to run in the future. (and indeed, BSDs can even run the same apps in their BSD kernel)

The X Window System: Graphics!
www.xfree86.org
www.x.org
The "X Window System", often called "X", is really just a system of handling graphics. There are two popular applications that handle the X protocol: XFree86 and X.org. X.org is a fork from the XFree86 code, just before XFree86 changed their licensing terms in 2004.

It is in X11 that your video driver is used. Also your other input and output devices (such as keyboard, mouse and screen) are declared here.

It is important to note that X does not provide for any sort of advanced windowing functions other than the display of them. User manipulation of the windows (and the decorations, such as titlebars, borders and widgets) is handled by the Window Manager, which we will cover next.

The Window Manager: So many choices...
The realm of managing windows in X is populated with a large variety of Window Managers. This is perhaps the most daunting and confusing thing for Microsoft Windows users to understand about the world of Linux.

In Linux, the user may choose a Window Manger that uses very little system resources, or they may choose ones with more features. This level will provide a fully functional GUI for your Linux box. Some examples include Fluxbox, Sawfish, FVWM, Enlightenment, Metacity and IceWM.

Compiz (or, more properly, Compiz Fusion) with its Emerald window decorator is another Window Manager with special appeal to many. It uses graphics card hardware to run visual effects of warping, zooming, shadows and more. Compiz is closely associated with Gnome, and replaces Metacity in a "3D" Gnome setup. If a user decides to switch back away from this Window Manager into a traditional (no GPU) Window Manager, they must replace it, not just remove Compiz.

The Desktop Environment: The Big Two (plus one)
www.kde.org
www.gnome.org
www.xfce.org
Where can you go beyond a Window Manager? Why, a full-blown Desktop Environment, of course! It continues where a Window Manager leaves off by incorporating things such as a "control panel" like item that lets you adjust your settings for a great deal of peripherals (scanners, printers, keyboards, mice, and anything else you can connect).

A Desktop Environment matches what most Microsoft Windows users expect in an operating system. All of these extra features come at the cost of extra resources being consumed. And, in fact, many people get a current Linux system running on an old box by not using the heavier KDE or Gnome, and getting more life out of the PC. The PC can still be updated with the latest kernel and apps (such as GIMP, OpenOffice.org and Firefox) and be a very capable desktop machine.

While KDE and Gnome have all the extra bells and whistles, if you want to slim down your resource usage, but don't want to sacrifice the convenience of having the added features of a Desktop Environment, XFCE may fit the bill. A self-described "lightweight desktop environment for various *NIX systems", screenshots of these desktops are often featured in our "Desktop" threads.

In Summary
How many layers, and which modular options you choose is up to you. The choices are daunting for someone first looking at them, but these choices make Open Source so exciting and you will have all the tools needed to make your PC work the way you want it to.

I hope this brief summary helps some of those who want to understand what makes up a Linux PC, and takes some of the confusion away. The forums here have many knowledgeable members, many of them are IT professionals (which I am not) and with the experience needed to help you out with guidance to get yourself out of a bind.


Those of you who are reading this and notice an error in what I have said, please let me know so that it can be corrected.
sentio
You can't improve on perfect wink.gif

Great contribution, Mark thumbs_up.gif
Blik
Very nice brief and informative explanation thumbs_up.gif
Capiora
Great information for my essay on Linux thumbs_up.gif

Very nice
enklus
Excellent! Super info! thumbs_up.gif
Sawyer12
One spelling mistake tongue.gif

Edit : Otherwise Well Done thumbs_up.gif. Nice Article.
markjensen
QUOTE(Sawyer12 @ Dec 20 2004, 15:03)
One spelling mistake tongue.gif

Edit : Otherwise Well Done thumbs_up.gif. Nice Article.[right][snapback]585135935[/snapback][/right]
pinch.gif
I went back and fixed two spelling errors, and three typos where my fingers had a mind of their own. blush.gif
Colin-uk
Very useful article, thanks smile.gif
CaKeY
Very nice mark! Thank you.
Elmo
awesome guide thanks alot

(fancy doin one about the filesystem and its layout? biggrin.gif)
Si
QUOTE(welshkid @ Dec 20 2004, 22:56)
(fancy doin one about the filesystem and its layout? biggrin.gif)
[right][snapback]585136950[/snapback][/right]

Funny, I was thinking the same thing whistle.gif

Nice work Mark yes.gif
Djmutik1013
good stuff even though I know all this stuff already thanks anyway
The_Decryptor
Good work, nice and informative yes.gif
Aeonandromere
QUOTE
Some examples include Fluxbox, XFCE, Enlightenment, Metacity and IceWM.


Last time I checked XFCE is a lightweight desktop environment and not a window manager.

From www.xfce.org:

QUOTE
"Xfce is a lightweight desktop environment for various *NIX systems.
Designed for productivity, it loads and executes applications fast, while conserving system resources."

markjensen
QUOTE(Aeonandromere @ Dec 20 2004, 20:52)
Last time I checked XFCE is a lightweight desktop environment and not a window manager.[right][snapback]585137503[/snapback][/right]
Their site was very informative.
XFCE uses XFWM4 as the Window Manager.

I will update the first post. thumbs_up.gif


Edit: Updated the DE section (and edited the listing of WMs at the end of the WM section).

Edit 2: Thank you, everyone for your improvements and compliments. biggrin.gif
NetRyder
Well written article, Mark. smile.gif
Marshalus
Very spiffy. I've been playing around with Linux options the last few days and now that I have some more insight from this article I think I may make the jump (in Virtual PC first though) smile.gif.
SaguratuS
Very nice article mark wink.gif
Going to point a few of my less-linux-literate friends to this article, still trying to get them to switch (I'm 2 for 6 so far)
Mike Douglas
Mark, Doesn't BSD have it's own userland?
markjensen
QUOTE(code_monkey @ Dec 26 2004, 01:06)
Mark, Doesn't BSD have it's own userland?[right][snapback]585168657[/snapback][/right]
I don't know... I have never looked at any of the *BSDs.
Avi
Thank you. I enjoyed reading this. Great article.
Powerless
Oh right so Linux isn't the OS it's the Kernel.

GNU is OS pinch.gif
n3wt
Very good article, just one thing, BSD is both an OS and a Kernel, it does not in fact include GNU. (this becomes very apparent when you use a BSD system tongue.gif)
hornett
Very useful thumbs_up.gif Thanks! smile.gif
markjensen
QUOTE(n3wt @ Jan 11 2005, 21:51)
Very good article, just one thing, BSD is both an OS and a Kernel, it does not in fact include GNU.  (this becomes very apparent when you use a BSD system tongue.gif)[right][snapback]585277068[/snapback][/right]
Very correct!
http://www.gnu.org/gnu/linux-and-gnu.html

I will make the appropriate edit. Google shows GNU/BSD as a sourceforge project, and other links with the reference (but some of those may be mis-identified, as I did above).
Shadrack
good work mark!

Hopefully these FAQs you've been writing will eliminate some of the repeat questions in the forum!
Thanks!
RufioPan
An excellent beginner's take on the display layers for Linux/GNU smile.gif

I have some follow up questions though... for example, font rendering is something I would think is handled by the Desktop Environment, but it seems so consistent across all three desktop environments. How is this handled?

Another question -- how difficult is it to start with just the kernel, and build up a system to the Desktop Environment? I assume it is NOT a trivial task smile.gif

Again, great job! Thanks!
kjordan2001
QUOTE(RufioPan @ Jan 12 2005, 15:31)
An excellent beginner's take on the display layers for Linux/GNU  smile.gif

I have some follow up questions though... for example, font rendering is something I would think is handled by the Desktop Environment, but it seems so consistent across all three desktop environments.  How is this handled?

Another question -- how difficult is it to start with just the kernel, and build up a system to the Desktop Environment?  I assume it is NOT a trivial task  smile.gif

Again, great job!  Thanks!
[right][snapback]585281741[/snapback][/right]

X handles most of the font tasks, and actually most of the GUI tasks overall. Everything GUI-wise is built up on top of X and implements more features, such as GUI toolkits like GTK and QT. I'm not sure which handles anti-aliasing of fonts, X or the DE, but anti-aliasing seems different for each environment, so it's more than likely the DE.

I'm uncertain what you mean by your second question, whether you mean a base install and building of from there or building from scratch. The former is much easier than the latter, it's mostly just building some packages. The latter is much more involved and requires a lot of work since you're building everything. Check out LFS and look at the book there.
Keen
Great article! smile.gif

Here I think a word is missing: "The target audience for this is quite likely someone who is considering installing Linux for the first time, or who has installed it recently, but is having ______ understanding the variety of choices."

ninja.gif
markjensen
QUOTE(Keen @ Jan 15 2005, 18:02)
Here I think a word is missing: "The target audience for this is quite likely someone who is considering installing Linux for the first time, or who has installed it recently, but is having ______ understanding the variety of choices."[right][snapback]585300193[/snapback][/right]
Good catch! thumbs_up.gif I'll correct that now. yes.gif

Such is the advantage of Open Source: Enough eyes, and every problem is shallow (to paraphrase Linus Torvald's quote)
GatorV
Great FAQ, it covers lots of things about the Linux OS for us newbies on Linux...
CJC
Great read, very well written. Thanks! smile.gif
Djmutik1013
Very Good Mark as Always. A very well written faq
Capiora
QUOTE
The Window Manger: So many choices...


think that ain't quite right too wink.gif , but it doesn't take away the guide is very helpfull

nice guide smile.gif
markjensen
Oops. blush.gif fixed.

Well, maybe that will be the last typo. wink.gif
EduardValencia
interesting thread markjensen smile.gif
markjensen
QUOTE(EduardValencia @ Feb 27 2005, 10:58)
interesting thread markjensen  smile.gif
[right][snapback]585541731[/snapback][/right]

Thanks. Glad you found it interesting.

This gets asked a lot, and it tough for many newcomers to understand at first.
theotherdave
Great guide mark, same for the other one's in this FAQ section...

this section is gold-dust, only just started looking at it..
Lasker
great information Mark, thanks happy.gif
markjensen
QUOTE(theotherdave @ Jun 24 2005, 06:01)
Great guide mark, same for the other one's in this FAQ section...

this section is gold-dust, only just started looking at it..
[right][snapback]586113058[/snapback][/right]

Thanks. smile.gif

Oh, and several of us Green Mods (fred66, rezza, Armeck and myself) have been working at getting the HOWTO & FAQs moved out to be more visible. Still in the works, though progress seems slow...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.