[lug] X, Window Managers and KDE/gnome 101

Tkil tkil at scrye.com
Mon Dec 18 01:55:56 MST 2000


>>>>> "John" == John Starkey <jstarkey at advancecreations.com> writes:

John> How does linux go from command line to gui? Like, what does X
John> do, then Enlightenment, and then finally gnome. What part do
John> they play individually?

well, first off, you understand that linux boots, gets comfortable,
then calls `init'.  init, in turn, accesses ``/etc/inittab'' to see
what it should do.

depending on what "run level" the initdefault is set to, your linux
box will boot to either a text or graphical login screen.  in the
former case, this is simply running `getty' on the various virtual
consoles, and usually the first one is displayed, so that is what you
really interact with.  after getting a username, it tries to run
`login', which asks for a password.  if everthing goes well, `login'
assumes your identity, then `exec's a shell.  you're in.

in the other case (typically known as runlevel 5), the `getty's are
spawned as well -- but init also launches `xdm', the ``X Display
Manager''.  there are also `gdm', and i wouldn't be surprised if there
were a `kdm' for the KDE folks.  this process is, as its name might
imply, the manager for all X sessions on that display.  well, that
display has to be created first, so it will make sure that X is
running at the console.  to varying degrees of detail, it can call
`xinit', 'startx', or `X' directly.  this last is typically a link to
the actual server binary being run, often redirected through
`Xwrapper'.  on my box:

note that ``gnome'' implies a level even higher than window manager;
it's a set of libraries and protocols designed to enable things like
drag and drop, etc.  in this sense, you have kernels, x displays,
window managers, and normal x clients; the last two can be said to be
``KDE aware'' or ``gnome compliant'', depending on whether or not they
understand the add-ons to the X protocol that enable things like drag
and drop, themes, etc.

| $ ls -al `which X`
| lrwxrwxrwx    1 root     root            8 Sep 29  1999 /usr/X11R6/bin/X -> Xwrapper
| $ ls -al /etc/X11/X
| lrwxrwxrwx    1 root     root           29 Sep 29  1999 /etc/X11/X -> ../../usr/X11R6/bin/XF86_SVGA

having started the display, `xdm' then presents the login box.  at
this point, it's very similar to `getty'; after you type in your
username and password, it checks to see if they're valid.  if they
match, then it launches everything in your `~/.Xsession' as your
userid, and that's your session.  when you quit your session, it kills
everything left over, and it goes back to the login box -- just as
getty goes back to simple ``login:'' prompt after you log out of a
shell.

John> My guess is that X acts as an interpreter between the kernel and
John> the video card. Enlightenment, window manager(?), tells the
John> screen what and where to draw the content and gnome controls the
John> general interactivity.

not quite.  all the window managers (sawmill, enlightenment) do is
tell other windows where to put themselves.  all the drawing is done
by the clients.  (but it is usually done relative to their main
window, so if the window manager puts that main window at 200x200 or
at 300x800, the clients generally don't care.)

as a bit of a final tangent, note that window resizing is generally
done by the window managers; this involves more subtlety than might be
visible at first, since things like `xterm' only want to be resized in
particular increments.

hopefully this has been more informative than confusing.  i welcome
corrections; much of this was done from memory, and i don't personally
use runlevel 5 on my box, so i'm not sure exactly how accurate my
depiction of this situation is.

t.




More information about the LUG mailing list