UNIX

The job of an operating system is to orchestrate the various parts of the computer -- the processor, the on-board memory, the disk drives, keyboards, video monitors, etc. -- to perform useful tasks. The operating system is the master controller of the computer, the glue that holds together all the components of the system, including the administrators, programmers, and users. When you want the computer to do something for you, like start a program, copy a file, or display the contents of a directory, it is the operating system that must perform those tasks for you.

More than anything else, the operating system gives the computer its recognizable characteristics. It would be difficult to distinguish between two completely different computers, if they were running the same operating system. Conversely, two identical computers, running different operating systems, would appear completely different to the user.

What Is UNIX?

UNIX is an operating system. It was created in the late 1960s, in an effort to provide a multiuser, multitasking system for use by programmers. The philosophy behind the design of UNIX was to provide simple, yet powerful utilities that could be pieced together in a flexible manner to perform a wide variety of tasks.

The UNIX operating system comprises three parts: The kernel, the standard utility programs, and the system configuration files. Many texts identify the components of the Unix system differently.  The separation is not important, except in the context of breaking the Unix Operating System into chunks for presentation to new users.

The kernel

The kernel is the core of the UNIX operating system. Basically, the kernel is a large program that is loaded into memory when the machine is turned on, and it controls the allocation of hardware resources from that point forward. The kernel knows what hardware resources are available (like the processor(s), the on-board memory, the disk drives, network interfaces, etc.), and it has the necessary programs to talk to all the devices connected to it.

The shell

The shell acts as an interface between the user and the kernel. When a user logs in, the login program checks the username and password, and then starts another program called the shell. The shell is a command line interpreter (CLI). It interprets the commands the user types in and arranges for them to be carried out. The commands are themselves programs: when they terminate, the shell gives the user another prompt (% on our systems).

The adept user can customise his/her own shell, and users can use different shells on the same machine. Staff and students in the CDCR departments have the tcsh shell by default, and the C shell is also available.

The tcsh shell has certain features to help the user inputting commands.
 
 

The standard utility programs

These programs include simple utilities like cp, which copies files, and complex utilities, like the shell that allows you to issue commands to the operating system.

The system configuration files

The system configuration files are read by the kernel, and some of the standard utilities. The UNIX kernel and the utilities are flexible programs, and certain aspects of their behavior can be controlled by changing the standard configuration files. One example of a system configuration file is the filesystem table "fstab" , which tells the kernel where to find all the files on the disk drives. Another example is the system log configuration file "syslog.conf", which tells the kernel how to record the various kinds of events and errors it may encounter.

Accessing a UNIX System

There are many ways that you can access a UNIX system. The main mode of access to a UNIX machine is through a terminal, which usually includes a keyboard, and a video monitor. For each terminal connected to the UNIX system, the kernel runs a process called a tty that accepts input from the terminal, and sends output to the terminal. Tty processes are general programs, and must be told the capabilities of the terminal in order to correctly read from, and write to, the terminal. If the tty process receives incorrect information about the terminal type, unexpected results can occur. You may experience this - especially when you are trying to connect to a Unix system for the first time.

Console

Every UNIX system has a main console that is connected directly to the machine. The console is a special type of terminal that is recognized when the system is started. Some UNIX system operations must be performed at the console. Typically, the console is only accessible by the system operators, and administrators.

Dumb terminals

Some terminals are referred to as "dumb" terminals because they have only the minimum amount of power required to send characters as input to the UNIX system, and receive characters as output from the UNIX system. Personal computers are often used to emulate dumb terminals, so that they can be connected to a UNIX system. Dumb terminals can be connected directly to a UNIX machine, or may be connected remotely, through a modem or a terminal server.

Smart terminals

Smart terminals, like the X terminal, can interact with the UNIX system at a higher level. Smart terminals have enough on-board memory and processing power to support graphical interfaces. The interaction between a smart terminal and a UNIX system can go beyond simple characters to include icons, windows, menus, and mouse actions.

Files and processes

Everything in UNIX is either a file or a process.

A process is an executing program identified by a unique PID (process identifier).
A file is a collection of data. They are created by users using text editors, running compilers etc.

Examples of files:

The Directory Structure

All the files are grouped together in the directory structure. The file-system is arranged in a hierarchical structure, like an inverted tree. The top of the hierarchy is traditionally called "root".