[Prev][Next][Index][Thread]

The X spaghetti was Re: Linux vs. Microsoft



Hi!

> From:          moshec@netvision.net.il (Moshe Cohen)

> What is the difference between an X server for these platforms and an X terminal
> emulator?
> 
> Since the GUI is part of the OS for Windows, an X server must run on top of it
> (or else it is not really on Windows) and therefore it may be called an
> emulator.

This is a rather big undertaking, but let's see if I can untangle 
things for you:

To understand X (as much as X can be understood) we must travel back in 
time to the good 'ole days, when a computer if put on top of a desk 
would just smash it (and probably go right through the floor as 
well):

In the beginning The Computer's (for in those times a computer was not 
just a computer) place was in a air conditioned, dust controlled 
room in the basement of the corporation, behind a massive door with 
the words Sanctum Sanctorium... er... Computer Room on top.
In order for users way up here to communcate with The Computer way 
down there they used terminals, but that's another (hi)story.
Anyway that's how the concept of users communcating with the computer
through terminals wired through networks came to be.
Sometime during the early eighties a company named after a fruit took 
an idea researched at the Xerox labs and made a computer (named after 
a sort of the fruit the company was named after), with a nice user 
interface using squares with with borders called windows and a mouse.
The guys using the 'Real Computers' who until then had been resigned 
to switch between processes using bizarre key convinations and 
commands and used only tekXXX graphic terminals thought to themselves
'hmmm, wouldn't it be great to have different windows for different 
processes and graphics on the same screen using these windows 
thingies?'
But the guys with the 'Real Computers' still had a problem, The 
Computers (for now there were many) were still way down there (or at 
least way over there). So they made what they knew best: a new type of 
Terminal using the new faster networks to connect to the computer.
This terminal however could not be like the terminals of yore if it 
was to support all those processes running on different windows, so a 
termcap or terminfo entry was not enough, they needed a client/server 
architecture. So they called the server X-server and the client what?
X-client? No! X terminal.
So what is the server and what is the terminal?
The server is basically a library which programs written for X use to 
connect to X Terminals using network sockets. X terminals on the 
other hand are pieces of hardware (terminals) which undertstand the 
commands sent to them through the X server, and as such can be 
emulated in much the same way as a communication program can emulate 
ANSI or Avatar.
Simple ah? Well, never fear it gets more complicated.
You see, the interface between the server and the terminal is pretty 
much bare bones, when a server tells the terminal to "open a window" 
it doesn't tell it how the border (if at all) will look, it might not 
even tell it were to put it or what size to give it. Furthermore the 
server doesn't decide which window will be the active window or 
which window is on-top. For these the X terminal uses a special piece 
of software called the window manager, which, surprisingly enough, 
manages windows.
On the other side of the chain, application writers don't usually code 
using the X-server library directly, but rather use a library (i.e 
Motif) which offers them "complex" objects such as buttons ready for 
use.
Still simple? Not to worry, in order to make things clearer the guys 
who made X (latter known as the X-Consortium) coded a few basic 
utilities to make life in X easier, one of them is a program to 
display the output of text based applications. This they call an 
xterm which is NOT an X terminal.
In the same spirit Xfree chose to call the drivers for the various 
SVGA cards, "servers", when what they actually implement is the X 
terminal emulator i.e the client. In fact when you run xinit (through 
startx or whatever) you are actually running the client.
(Which brings me to the question: how can you make turn linux into an 
X-terminal?)

Let's review the X-Chain:


              -----------------    -----
             |Program display/s|  |     |
              -----------------    -----
                      |              |
                      |---------------------  ....
                      |  
              -----------------
             | Display Driver  |
              -----------------
                      |
              -----------------
             | Window manager  |
              -----------------
                      |
                      |               Client
              ------------------
             | Network Interface|
              ------------------
                      |
                      |
--------------------------------------------
                      |
                      |
              -----------------   (Either physical i.e eth0 or virtual 
             |Network Device   |   i.e localhost/loop. This is why 
              -----------------    one needs TCP/IP support to run X) 
                      |
              -----------------
             |Network Socket   | (Part of the OS) 
              -----------------
                      |
              -----------------
             |     X server    |
              -----------------
                 |         |
              -------      |
             |Widget |     |
             | Lib   |     |
              -------      |
                 |         |
                  ---------
                      |
               -----------------
             |     X programs   |
              ------------------

And that's about it. I'm not an expert in the subject so I hope I 
didn't make many mistakes.
Comments? Are my technical/historic entries correct? Did I 
miss/mangle anything? How about putting this in some type-o-FAQ?

Eli Algranti <OR17367@elbit.co.il>


Follow-Ups: