next up previous
Next: Computer Languages Up: ho Previous: Operating Systems

Subsections

The User Interface

The User Interface

Textual User Interfaces

The simplest user interface provided by Linux is keyboard and character oriented. The shell allows commands to be typed. In many operating systems the language for command input is fixed and cannot be changed but this is not true of the Linux shell. Because the shell is outside the privileged and protected kernel of the operating system, different shells can be provided. However, most shells provide similar facilities.

In Linux, there is an executable file in the filestore corresponding to nearly every possible shell command. The shell just creates a process executing the required file. The executable files can invoke the operating system as and when required by means of system calls. For example an `ls' command must make a system call to obtain the contents of the directory, which it then formats and outputs.

Many shell facilities have been developed, in addition to just typing commands. Some of these are:

A glance at the on-line manual page for a shell such as `bash' will convince you that the shell is exceedingly powerful but also exceedingly cryptic. It is very easy to confuse everyone with unusual paths and aliases. Textual interfaces have been superseded by GUIs for the majority of users, who just want to be able to run applications. The challenge is to make GUIs sufficiently complete to replace the shell in all circumstances.

Graphical User Interfaces

Most Microsoft systems have their window system integrated with the operating system, so the upgrades from Windows 3.1 to Windows 95 to Windows 98, or from Windows NT to Windows 2000, bring with them changes of user interface.

However, on Linux computers the window system is essentially independent of the operating system. Each user process needs an associated terminal device from which it receives input and to which it sends output - Linux handles the details of moving information to the correct place. In a Linux timesharing system there are many such terminals. When a window system is used, it simply appears to Linux that there are as many terminals as windows. The window system helps Linux to route information, including mouse events, depending upon which windows are active or where the mouse is pointing. In particular, the window system converts output sent to the terminals corresponding to windows into patterns of pixels in the right place on the screen.

Given a simple application program with character based input and output, it is possible to operate without any window system, or to choose from a variety of different window systems, without having to change the application program.

X Windows

Linux uses version 11 of the X Windows system (X11), which originated at MIT. X Windows uses a client server model, implemented using remote procedure calls. An application process is a client, running on a computer known as the `host'. The windows are actually displayed by a window server process, running on the computer that the user sits at. Client and server communicate using the X11 protocol.

Often the display and server process will be on the same computer as the client process. However, client processes can request that windows be displayed on, and input be received from, displays on a different computer. (To do this on departmental computers you need to run xhost +client.computer.name on the server computer and DISPLAY=server.computer.name:0.0 on the client computer.)

A remote X windows server is usually a general-purpose computer, but may be an X terminal. This is a graphical terminal which just runs an X server and communicates using X11 protocol. It will be microprocessor based (all terminals are these days) but is only required to run the X11 server software.

X windows, as used with Linux, comes as a number of independent but related software packages:

The window server

is the lowest level of Window software. It is responsible for managing the keyboard, mouse and screen. It receives information about each of the different windows and subwindows to be displayed and is responsible for combining them correctly and displaying them on the screen. It receives input events from the mouse and the keyboard and is responsible for sending them on to the correct process, depending on the position of the mouse.

The window manager

is essentially responsible for the borders of the windows. It determines the User Interface associated with manipulating the windows. It includes facilities for manipulation of windows such moving, resizing, opening, closing and quitting using the `window' menu (in `fvwm' the `Window Ops button bar') or accelerators. There is a choice of window managers under Linux. `fvwm2' (F Virtual Window Manager version 2), which we run as the default on our Linux PCs, is derived from `twm' (TAB Window Manager) which forms part of X11. Because of the flexibility of Linux and XWindows software we can easily switch to another manager without changing the operating system or most of our application programs. We can also have differently configured flavours of these window managers such us `Fvwm95' or `AnotherLevelUp' in `fvwm2'.

Only one window manager is active on a computer at one time, so you cannot have a mixture of two different sorts of windows on the screen at once. The use of the window manager means that the borders of all the windows look similar and manipulating the windows uses the same basic mouse operations. However internally the windows can be quite different - compare your `Netscape' window with your `Nedit' or `xterm'.

The application packages

Each application runs in one or more windows. For example, you can still run a shell, but to do so you need to run e.g. xterm to create a text window and start your favourite shell up connected to it. There are also many applications that can only run using a GUI.

There are now many WIMP style interfaces to the Linux filestore, such as the xfm File Manager - instead of typing commands like `ls', the file manager displays your files as icons which you can click on to select and perform operations on. The file manager converts your mouse actions into the usual Linux operations on your normal filestore, so you don't have to learn and type Linux file commands all the time. Double-clicking on a text file under the file manager opens your default editor (e.g. Nedit). Double clicking on an executable file runs it. Double-clicking on a directory opens it, so you can see the files it contains. Menus of customised commands can be created within the file manager Applications window. You can click on these commands or drag files onto them.

There are also Desktop environments, such as Gnome and KDE, which provide integrated suites of GUI applications. The intention is that these should give the same broad range of functionality and interoperability as e.g. MS Windows does.

The user interface toolkit

The file manager application has a number of buttons and menus to select file operations. These buttons, menus and windows all need to have to same look and feel as the basic window border, with consistent use of the mouse buttons. The basic elements - buttons, sliders, menus etc. - are defined as a widget set. There are many widget sets, such as OSF/Motif and Open Look. Consistent use of a particular widget set gives a consistent look and feel to the application, and saves application-writers wasting effort reinventing the widgets. The reason different X11 aplications tend to have a different look and feel is because they use different widget sets.

In order to interface correctly with the window manager and to generate correct buttons and menus within the tool, a toolkit is used by the writer of the application. Various toolkits exist, such as OLIT (Open Look Intrinsics Toolkit) for the Open Look Widget Set. Similar toolkits exist for use with other window managers and widget sets.


next up previous
Next: Computer Languages Up: ho Previous: Operating Systems
Pete Jinks 2003-09-25