1.4 The Solaris Operating Environment
1.4.2 UNIX operating system
The operating system is a set of programs that manages all computer operations. It also provides a link between the user and system resources, converting requests that come from the mouse and/or keyboard into computer operations. Most operating systems, including UNIX, have three main components: the Kernel, the Shell and the File System. The Kernel manages the operation of the computer. The Shell provides for interaction between the user and the computer, and the File System provides a way to organize and manage the information on the computer's hard disk(s). Much of the following information applies to all varieties of UNIX, although some of the information is Solaris specific.

The OS Kernel
The kernel is the core operating system with the necessary basic capabilities to run the computer. The kernel is the closest to the CPU and hardware. It is an executable file that gets loaded when the computer starts or boots. The name of the file that gets loaded is called
/kernel/genunix. Once the kernel has loaded, it performs the following functions:

  • Manages devices, memory, and processes.
  • Controls the functions (transmission of information) between the system programs (utilities) and the system hardware.
  • Manages functions such as: Swap space, Daemons, and File Systems.

Swap space - A reserved part of the hard disk for the kernel to use during processing. Portions of running programs can be "swapped out" to the hard disk and then brought back in later if needed. This swap space is actually on the hard disk, but it looks like additional memory or RAM and is sometimes called virtual memory.

Daemons - Programs or processes that perform a particular task or monitor disks and program execution. Daemons are special processes that begin after the OS loads. Daemons then wait for something to do in support of the OS. They can be started or stopped as necessary. An example is the printer daemon, lpsched (line printer scheduler). It starts when the system starts up and then waits in the background until someone needs to print something. Daemons in the UNIX world are similar to Services with Windows NT/2000 or NetWare Loadable Modules (NLMs) with Novell NetWare.

File Systems - A hierarchy of directories, subdirectories and files that organize and manage the information on hard disks. File systems can be either local or remote. Local file systems are located on the hard disk of your workstation. Remote file systems are located on another computer, which is usually a server.

The Shell
A shell is an interface between the user and the kernel. It acts as an interpreter or translator. In other words, the shell accepts commands issued by you, interprets these commands, and executes the appropriate programs. Shells can be command-line driven or graphical. Three command line shells are available in the Solaris UNIX environment. It is possible to initiate or switch between these shells when working on the computer. You can use the
ps (process status) command to see which shell you are using.

  • Bourne shell ($) - The Bourne shell was the original shell program for UNIX. It is the default shell for the Solaris computing environment. Stephen Bourne developed the Bourne shell for the AT&T System V.2 UNIX environment. This shell does not have aliasing or history capabilities. It is mostly used by system administrators. The Bourne shell prompt is a dollar sign ($) which is similar to a DOS C:\> prompt.
  • Korn shell ($) - The Korn shell is a superset of the Bourne shell and was developed by Stephen Korn at Bell Labs. It has many of the Bourne shell features plus added features such as aliasing and history. This is the most widely used shell and is the industry standard for system users. The Korn shell prompt is also a dollar sign ($). Note: Examples given in this course are based primarily on the Korn shell.
  • C shell (%) - A shell based on the C programming language. Like the Korn shell, it has additional features such as aliasing and history. The C shell was developed by Sun's Bill Joy and is still widely used today. The C shell prompt is a percent sign (%).

The File System 
The file system provides a way to separate and keep track of the information on a hard disk. The Solaris operating environment file structure is a hierarchy of directories, subdirectories, and files that are grouped together for a specific purpose. The file system is integrated with the Kernel to provide an organizational structure for your software and data. The file structure subdivides hard disks to make them more manageable and enables us to locate files. Hard disks can be divided into file systems, directories, subdirectories, and files. The file system organizes your data similar to the way a file cabinet stores information. The file system is like the file cabinet, directories are like drawers, subdirectories are like folders and files are like the pages in a folder.

A directory hierarchy looks like an inverted tree with the root at the top. The following is the hierarchy of the UNIX file system:

  • File System - A group of directories that can be thought of as a separate tree structure. A hard disk can be divided into multiple separate file systems which are similar to logical partitions in the Windows/DOS world (like drive C: or D: ) or volumes as with Novell NetWare. The file systems can be made available (mounted) or unavailable (unmounted) at the administrator's discretion. Each file system has its own directory structure and can either be local (on your computer) or remote (on another computer).
  • Directory - A location for other files and subdirectories. The Solaris File System, or directory structure, enables you to create files and directories accessed through a hierarchy of directories. A directory is like a file drawer in a file cabinet. The highest directory in the directory structure of a file system is the root directory, which is designated as a single forward slash (/).
  • Subdirectory - Any directory below another directory. For example, some of the subdirectories under the root (/) directory are /usr, /etc, and /kernel.
  • Files - Files are contained in directories and subdirectories. They are the lowest level of the file system. There are usually thousands of files on hard disk and there are several different types:
    • Directories - Directories are considered a type of file under the UNIX file system.
    • Plain ASCII - (American Standard Code for Information Interchange). These files are pure text files with no special formatting characters in them.
    • Applications Files - These files are created by an application such as a Word Processor, Spreadsheet or Database program.
    • Executable Programs - These are UNIX utility commands and application programs.

Common Solaris Directories
The top most directory in a file system is called the root directory. It is the starting point of the file system hierarchy. The root directory (/) is required for the operating system to function and contains critical system files (such as the kernel). The following is a list of some of the more important directories and their purpose. The slash in front of the following directories indicates they are actually subdirectories off the root directory.

  • /usr directory - Contains executable commands, system administration utilities, and library routines.
  • /opt (optional) directory - Contains Sun's unbundled software applications and third party applications.
  • /etc (etcetera) directory - Contains system administration files such as the passwd file.
  • /export/home directory - Contains the user home directories. Depending on how the system has been set up by the administrator, the home directories may instead be found in /home.
  • /dev (devices) directory - Contains files which are pointers to device names. All devices in UNIX have standard file names.
  • /kernel directory - Contains the basic operating system files such as the main UNIX kernel genunix.
  • /var (variable) directory - Contains print spooling and mail system error messages.