Overview
This chapter discusses the history, the main components, and the capabilities of the UNIX operating system. There is a review of operating systems in general, and a comparison of UNIX to other types of operating systems. This chapter introduces the Sun Microsystems version of the UNIX operating system, known as the Solaris Operating Environment or Solaris. An overview of the Linux operating system, which is based on UNIX, is also provided. Most of the information presented here is applicable to all varieties of UNIX including Linux.

 

1.1 Main Components of a Computer
1.1.1 Main computer components
The four main components of a computer are the central-processing unit (CPU), random-access memory (RAM), Input/Output (I/O) devices, and the hard disk or other mass storage devices.

CPU 

The CPU is the computer logic microprocessor chip that processes instructions that are received from the primary computer memory (RAM). These instructions are stored in binary language. The CPU typically plugs into the motherboard of the computer. Modern CPUs have cache memory on board to speed up operation. Examples of CPUs include the proprietary Sun Ultra SPARC (Scaleable Processor Architecture), which is designed strictly for the Sun line of workstations and servers. The following is a list of better-known CPUs designed for microcomputers: 

  • Intel x86, Pentium, Celeron, and Itanium 
  • AMD K6 series, Athlon, and Duron 
  • Power PC (PPC), which is a joint venture by Apple, IBM and Motorola 
  • Motorola 68000 Series 
  • Compaq (formerly DEC) Alpha

RAM 

RAM is physical memory in the form of microchips. It is normally located on either the motherboard or the memory board of the computer. It is the main computer memory, often referred to as primary memory or working memory. Primary memory is the part of memory in which the activity of the running system takes place. The phrase, "The system has 128 MB (megabytes) of memory", is referring to primary memory (RAM). Operating systems and software programs usually reside on the hard disk. When the computer is booted, an image or copy of the operating system is loaded into RAM. When a program is started, an image or copy of that program is loaded into RAM. Images in RAM remain as long as they are needed. When these images are no longer required, they are overwritten by other images. If power is lost or the system is rebooted, images in RAM disappear. RAM is available in many different form factors and performance levels. It is common to add RAM in computers to increase the size of programs they can run and also to improve performance.

I/O Devices 

The I/O portion of the computer accepts or reads input from a device into memory, or it writes output from memory to a device. There are many types of I/O devices. For example, the keyboard and the mouse are the primary user input devices. The monitor and the printer are the primary output devices. Disk drives and tape drives are considered both input and output because they can be read from as well as written to. A normal CD-ROM drive is an input device, but a CD-R (recordable) and CD-RW (read/write) are considered both input and output devices. A monitor can also be an input device if it has a touch screen.

Hard Disks and Other Forms of Mass Storage 

The hard disk is a magnetic storage device in which information is stored. All files, including the operating system and applications or utilities, are stored on a hard disk. The contents of the hard disk are managed by the file system, which will be covered later. Forms of optical storage, such as CD-ROMs, DVDs, and CD-Rs, are becoming standard components on many new computers. Tape drives are also very common as a backup device used primarily on high-end workstations and servers.

Disk drives typically communicate with the computer using Enhanced Integrated Drive Electronics (EIDE) or Small Computer Systems Interface (SCSI). CD-ROMs and tape drives typically connect using the AT Attachment Packet Interface (ATAPI), which is an extension to EIDE. ATAPI, EIDE, and SCSI are industry standards that are widely supported on all modern OSs.

 

1.1 The Components of a Computer
1.1.2 Peripheral components
Peripheral components are those that are independent of the CPU, RAM, and Mass storage. Some of the more common peripherals are discussed here. These include I/O devices and other components such as video hardware, audio hardware, and networking devices found in most modern computers. 

Keyboard and Mouse 

As previously mentioned the keyboard and mouse are the primary input devices. The keyboard and mouse typically interface to the computer using either a PS/2 or universal serial bus (USB) connection. USB is becoming more common.

Video Components 

The primary video components are the video adapter and the monitor. The video adapter provides the ability to display text and graphics. The amount of video memory determines the resolution and number of colors that can be displayed. Video cards are installed in an Accelerated Graphics Port (AGP) slot, Peripheral Components Interface (PCI) slot or can be built into the motherboard. Most modern PC's use an AGP interface for video. Monitors are characterized by screen size, resolution capabilities, refresh rate, and display precision known as dot pitch. The monitor connects to the video card using a 15-pin RGB connector. Flat panel LCD displays are becoming increasingly popular. Video components can also include motion video capture and editing systems.

Audio Components 

Audio usually includes a sound card and speakers. In some cases, audio includes a microphone. Sound cards typically use an Industry Standard Architecture (ISA) or PCI slot on the motherboard. The microphone can be separate or built into the monitor. In either case, it plugs into the sound card. Multimedia, music, and voice recognition applications take advantage of the sound components.

Printing Devices and Scanners 

Printing devices are output-only and include printers and plotters. There are hundreds of different kinds of printers and they can be attached to a workstation, a server, or directly to a network. Plotters are less common than printers and are primarily used for large-scale drawings. Printing devices can be attached to the computer using various interfaces such as parallel, serial, USB, and IEEE 1394 (FireWire).

Networking Components 

Many computers today come with an Ethernet network interface card (NIC) or adapter. This adapter allows computers to communicate with each other through a central hub device using a cabled or wireless connection. This connection forms a local area network (LAN). Most newer network adapters plug into a PCI slot on the motherboard. Older network adapters use the ISA interface. Modems are also considered networking devices, which allow remote dial-up to private networks and Internet Service Providers (ISPs). Modems can be either internal or external.

 

1.2 Computer Roles and Operating Systems
1.2.1 Desktop OSs, PCs, and workstations
Single User Desktop Systems 

All computers require an operating system (OS) to manage their functions. This is true regardless of the manufacturer of the computer or whether it is a microcomputer, midrange computer, or mainframe computer. OSs can be divided into two major categories: single user (desktop) and multiuser (network). Early desktop operating systems were single-user systems. This means that they could track only one user at a time and were designed to run on a Personal Computer (PC) desktop or laptop. DOS and Windows 3.x are examples of true single-user desktop operating systems. The activities of only one user can be managed; so only one user can be logged in at a time. Modern operating systems such as Windows 9x, NT Workstation, Windows 2000 Professional, Windows XP, and Mac OS have some networking capabilities for peer-to-peer workgroup networking. However, they are largely employed as single-user desktop operating systems.

Workstation and Desktop Applications 

UNIX can serve as a desktop operating system, but is most commonly found on high-end computers known as UNIX workstations. Sun Microsystems Ultra and SunBlade line of workstations are UNIX workstations that have powerful CPUs and ample memory. These workstations are employed in engineering and scientific applications, which require dedicated high-performance computers. Some of the specific applications that are frequently run on UNIX workstations are included in the following list: 

  • Computer-aided design (CAD) 
  • Electronic circuit design 
  • Weather data analysis 
  • Computer graphics animation 
  • Medical equipment management 
  • Telecommunications equipment management 

Most current desktop operating systems include networking capabilities and support multi-user access. For this reason, it is becoming more common to classify computers and operating systems based on the types of applications they run. This classification is based on the role or function that the computer plays, such as workstation or server. Typical UNIX desktop or low-end workstation applications might include word processing, spreadsheets, and financial management. On high-end UNIX workstations, the applications might include graphical design or equipment management and others as listed above.

The UNIX operating system can run on a personal computer. Any system that is running UNIX is referred to as either a workstation or a server. A PC is a system running any of the other popular operating systems originally designed for the PC.

 

1.2 Computer Roles and Operating Systems
1.2.2 Network operating system capabilities
All versions of UNIX and most other modern network operating systems (NOS) support advanced features: 
  • Multiuser capability 
  • Multitasking 
  • Distributed processing 
  • High level of security 

Multiuser capability enables more than one user to access the same resources and provides support for many users simultaneously. The OS keeps track of each resource, such as CPU, RAM, hard disk, and printers, and allows them all to be shared. Each program or application that runs is referred to as a task or process. Multitasking enables the OS to keep track of multiple processes simultaneously. This allows more than one tool or application to be used at one time. Distributed processing enables the use of resources across the network. For example, a user at a workstation would be able to access files and applications on the hard disk of another computer, or a printer, located on a remote part of the network.

Network operating systems are also very secure.  Beyond the basic username/password security there are many other security features. These features can be turned on or off, depending on the function of the system and the level of security the user or administrator desires.

 

1.2 Computer Roles and Operating Systems
1.2.3 Servers and the network environment

Network operating systems (NOS) have additional network management tools and features that are designed to support access by large numbers of simultaneous users. On all but the smallest networks, NOSs are installed on powerful servers or central host systems. The focus is on server-based or host-based NOSs. Servers are powerful computers that run a NOS and applications. Many users, known as clients, share these servers. Servers usually have high-capacity/high-speed disk drives, large amounts of RAM, high-speed NICs, and in some cases multiple CPUs.

Server applications and functions include Web services using hypertext transfer protocol (HTTP), File Transfer Protocol (FTP), and Domain Name Server (DNS). Standard E-mail protocols supported by network servers include Simple Mail Transfer Protocol (SMTP), Post Office Protocol (POP3), and Internet Messaging Access Protocol (IMAP). File sharing protocols include Sun Network File System (NFS) and Microsoft Server Message Block (SMB). Network servers, in conjunction with file services, also frequently provide print services. The UNIX print server is Line Printer Daemon (LPD). A Server may also provide the Dynamic Host Control Protocol (DHCP), which automatically allocates IP addresses to client computers. In addition to running services for the clients on the network, servers can be set to act as a basic firewall for the network. This is accomplished using Proxy or Network Address Translation (NAT), both of which hide internal private network addresses from the Internet. Server applications such as these are not normally implemented on a home desktop or LAN workstation.

Interactive Media Activity (Flash, 24 kB)
  Server Functions and Protocols

In this media activity, place a check in the box for each protocol that corresponds to the description on the left.

 

1.2 Computer Roles and Operating Systems
1.2.4 The OS and CPU relationship
Most OSs, in general, are designed to work with the CPUs of a particular manufacturer. Some can run on CPUs from different manufacturers, and some can support multiple CPUs of the same type. The various Windows operating systems (9x/ME/NT/2000/XP) run primarily on Intel-based CPUs. Solaris and Linux run on several different manufacturers CPUs including Intel. Server versions of the Windows OSs (NT and 2000) support multiple CPUs, as do most versions of UNIX including Solaris and Linux.

OSs and CPUs often are classified based on the number of bits they can manipulate. The more bits they can manipulate, the more powerful the CPU and the OS are. Most early NOSs and CPUs were 16-bit. Most modern NOSs and CPUs are 32-bit, with some being 64-bit. The Intel x86 CPU architecture is 32-bit and the Intel Itanium, or IA-64 architecture, is 64-bit. Sun Systems SPARC CPU is 32-bit and the Ultra-SPARC is 64-bit.

Examples of NOSs include UNIX, Windows NT/2000 Server, Novell NetWare, and various mainframe NOSs. Mainframe NOSs include Digital Equipment VMS, Hewlett-Packard MPE, IBM MVS, and several varieties of UNIX. Solaris or SunOS is the Sun Microsystems version of UNIX. A Sun workstation or server normally comes with Solaris, but can also be ordered with Linux. It is possible to order Intel-based servers with Windows 2000, Novell NetWare, or Linux pre-installed.

Although UNIX is used frequently as a workstation OS for high-performance applications, it is not generally considered an end-user desktop OS. It is most often used as a NOS on servers, and is often used with Internet Web servers. Linux can be used as a server or a high-end workstation, and is becoming increasingly popular as a desktop operating system for home or office use.

 

1.2 Computer Roles and Operating Systems
1.2.5 Operating systems, hardware, and drivers
Operating systems such as Windows 2000, Solaris, and Linux interact with computer hardware through the use of device drivers. A driver is a piece of software written for a particular operating system that allows the system to control a particular hardware device properly. Nearly all major computer components and peripherals, such as keyboards, mice, monitors, printers, scanners, and disk drives, require a driver to operate. Most operating systems come with basic drivers for the most common types of hardware and peripherals.

Solaris and Drivers 

The original Sun operating system, based on UNIX, was designed to run on computers manufactured by Sun Microsystems. The Sun operating system comes pre-installed on a consistent and stable hardware platform. This allows for maximum compatibility between the OS, the drivers, and the hardware. Solaris for Intel is designed to run on Intel-compatible (x86) computers, with a considerable variety of hardware, and with many different peripheral manufacturers. Either the operating system or the hardware manufacturer provides drivers. Drivers may not be available for all types of peripheral hardware.

Linux and Drivers 

Linux was also developed to run on Intel-based computers. The OS may not support some types of hardware, especially the latest peripherals. Linux, in the Intel-compatible environment, supports most CPUs including Intel and AMD, most types of RAM, and standard mass storage interfaces such as EIDE, ATAPI, and SCSI. Standard USB and PS/2 keyboards and mice are also well supported. Other USB devices may not be and will need to be checked. Most video card chip sets that are compatible with the XFree86 graphics system, which comes with Linux, are not a problem. However, the latest technology devices may not have drivers available yet. Network interface cards and modems are generally well supported, except for some internal modems that may require a special driver.

 

1.3 Overview of the UNIX Operating System
1.3.1 Brief history of UNIX
In the mid-1960s, the UNIX operating system was developed at AT&T Bell Labs with involvement from General Electric and the Massachusetts Institute of Technology. UNIX was developed as a multi-user operating system called Multiplexed Information and Computing Service (Multics). Multics was an interactive operating system written for a specific General Electric computer. After several years of development, Multics proved to be too expensive and Bell Labs withdrew from the project. 

Ken Thompson, a Multics programmer at Bell Labs, wrote a space travel game for the GE computer before the Multics project lost funding. With the help of another programmer, Dennis Ritchie, he rewrote the game to run on a Digital Equipment Corporation (DEC) PDP-7 computer that had a better graphics display. The DEC computer was great for running the space travel game, but it lacked a viable OS. In 1969, Thompson got the urge to develop his own OS. Originally, Thompson called the new OS that he had developed, with a colleague, Uniplexed Information and Computing Service (UNICS). The name was eventually changed to UNIX. The space travel game later was modified to run under UNIX. 

UNIX was first written in assembly language, a primitive set of instructions that control the internal instructions of the computer. However, UNIX could only run on a specific computer. In 1971, Ritchie created the C language. In 1973, he and Thompson rewrote the UNIX system programs in C language. Because C is a higher-level language, UNIX could be moved (or ported) to another computer with far less programming effort. The decision to develop this portable operating system proved to be the key to the success of UNIX. 

The early UNIX source code was made available to universities all over the United States. Programmers at the University of California at Berkeley made significant modifications to the original source code and called it Berkeley Software Distribution (BSD) UNIX. They sent this new version of the UNIX environment to other programmers around the United States. These programmers added tools and code as they saw fit. Possibly the most important advance made to the software by the programmers at Berkeley, was the addition of networking software. The networking software allowed the OS to function in a local-area network (LAN). BSD UNIX became popular with computer manufacturers such as Hewlett-Packard, Digital Equipment Corporation, and Sun Microsystems. 

The Sun Microsystems original version of UNIX, the Sun operating system (SunOS) was based on BSD UNIX Version 4.2. At that time, the AT&T version of the UNIX environment was known as System V (system 5). The Microsoft version of UNIX, developed for PCs with Intel processors, was known as XENIX. In 1988, Sun OS/BSD, AT&T System V Release 3, and XENIX were combined into what became System V Release 4 (SVR4). This new generation of the OS was an effort to combine the best features of both BSD and AT&T UNIX, to create an industry standard for the OS. This enabled software to be developed for UNIX without consideration for whether it was System V or BSD 4.2. The new SVR4 became the basis for most of the current varieties of UNIX. The timeline shown in the Figure lists some of the major events in the evolution of the UNIX OS.

The Open Group (www.opengroup.org) currently owns the UNIX standard and now guides UNIX development using a set of standard operating interfaces called POSIX (Portable Operating System Interface) and the Single UNIX Specification with the goal of increasing the compatibility of the UNIX operating system between vendors.

 

1.3 Overview of the UNIX Operating System
1.3.2 UNIX varieties
The two main versions of UNIX are System V (SVR4) and BSD. Currently, a number of varieties of UNIX exist. Most are similar because they are based on the industry standard SVR4. The other varieties are based on BSD. The command used for printing indicates whether the version of UNIX is System V-based or BSD-based. The command used for System V-based systems is lp and the command used for BSD-based systems is lpr. The command used to determine what processes are running is also an indicator. System V uses ps -ef and BSD uses ps -aux. Other differences exist with system administration commands. 

UNIX is now a trademarked name owned by The Open Group, so each vendor called its version of UNIX by a unique name. Sun's version of UNIX is called Solaris and is the most widely used version in networking today. The AT&T version is referred to as UNIX, the IBM version is AIX, and the Hewlett-Packard version is HP-UX. Digital Equipment, which is now Compaq, has a version called Tru64 that was formerly called Digital Unix. These versions of UNIX are designed to run on the hardware and CPUs made by the specific vendor. Solaris runs not only on Sun computers, but also on Intel-based machines. Linux, another version of UNIX that is becoming increasingly popular, also runs on different CPUs. By learning any one of these UNIX varieties, it is fairly easy to move to one of the others. The Figure shows some of the CPU manufacturers, and the various UNIX versions and operating systems that they can run.

 

1.3 Overview of the UNIX Operating System
1.3.3 Overview of Linux
The latest version of UNIX to emerge is called Linux. Linux was developed in 1991 by Linus Torvalds at the University of Helsinki, Finland. Torvalds posted it on the Internet and encouraged others to contribute to its development. It has features from both SVR4 and BSD. Linux has become very popular among computer enthusiasts, those looking for an alternative to traditional PC operating systems, and companies looking for a stable, low-cost OS. The icon for Linux, chosen by Linus Torvalds, is the little penguin shown in Figure . The Linux web site is www.linux.org and includes information on: 
  • Applications - Programs written to run on Linux 
  • Documentation - Linux documentation project and HOW-TOs 
  • Distributions - Organizations providing Linux packages 
  • Hardware - Compatible systems and components 
  • Courses - Tutorial for new users - Getting started with Linux 
  • Projects - General, hardware, software and scientific 
  • News - Linux news and articles

Linux was originally developed to run on the Intel x86 microprocessor (starting with the 30386) as a workstation or server. The Linux kernel has since been modified to run on several different CPUs in addition to the Intel x86. These CPUs include Intel IA-64, DEC Alpha, SUN SPARC/UltraSPARC, Motorola 68000, MIPS, PowerPC, and even the IBM mainframe S/390. In fact, Linux now runs on CPUs from a wider variety of manufacturers than any other OS.

GNU/Linux 

Many other components of the OS have been added through the efforts of independent developers and the Free Software Foundation's GNU (GNU's not UNIX) project (www.gnu.org). The GNU operating system uses the Linux kernel. The kernel is the heart of the OS that controls interaction between the hardware and applications. The GNU project refers to Linux as GNU/Linux, since many components of the OS are GNU applications. A good source of information and resources is the Linux documentation web site: www.linuxdoc.org

Open Source Software 

Linux is available at no expense under the GNU General Public License (GPL), as are other versions of UNIX such as FreeBSD and NetBSD. Linux is open source software, which means that the source code is publicly available and can be modified to suit specific needs. It can also be distributed freely among users. This concept is the opposite of commercial software, where the source code is not publicly available and each user must pay a license fee. Commercial software is based on copyright laws, which seek to limit what the user can do with respect to source code and distribution. Linux can be downloaded at no cost from various web sites.

Linux Distributions 

A number of for-profit companies and non-profit organizations make Linux available along with various combinations of applications, utilities and other software. These combinations of the OS and software are called distributions. As an example, Red Hat, Inc. bundles the Linux CDs, source code, and manuals along with a collection of applications and other products for a modest fee. These additional products include an office-suite, a choice of graphical desktops, Web server software, and so on. A level of customer support is also provided. Red Hat includes the Sun StarOffice suite of productivity software.

The primary component of any distribution is the Linux kernel itself. In addition to the kernel and applications, other components in a distribution include installation tools, the boot loader, and utility programs. Some distributions are more graphical and oriented toward the new user. Others are more basic and focus on developers and people who are already familiar with UNIX. Figure is an alphabetical list of some of the more common Linux distributions and their web sites:

Caldera OpenLinux        http://www.caldera.com 

Corel Linux                   http://linux.corel.com 

Debian GNU/Linux        http://www.debian.org 

Linux Mandrake            http://linux-mandrake.com/en 

Red Hat Linux               http://www.redhat.com 

Slackware Linux            http://www.slackware.com 

SuSE Linux                   http://www.suse.com 

Turbo Linux                   http://www.turbolinux.com

 

1.3 Overview of the UNIX Operating System
1.3.4 Benefits of UNIX and Linux
UNIX is a standards-based operating system and, although it varies somewhat from one version to another, the basis of the system is still UNIX. Nearly all-major computer manufacturers support some form of UNIX, which is a tribute to its importance as an operating system. It is one of the most powerful, flexible, and scalable OSs in the world. Most versions of UNIX in use today are commercial versions such as IBM AIX or Sun Solaris. The source code is not modifiable by the end user and there is a license fee for the OS. This is one of the reasons for the increasing popularity of Linux, which is open source and is relatively low cost to deploy. Nearly every computer manufacturer, in addition to having their own commercial version of UNIX, now offers and supports the Linux OS. These include Sun, HP, IBM, and others.

In general, UNIX in its various forms, continues to advance its position as the reliable, secure OS of choice for mission-critical applications that are crucial to the operation of a business or other organization. UNIX is also tightly integrated with the Transmission Control Protocol/Internet Protocol (TCP/IP). TCP/IP basically grew out of UNIX because of the need for LAN and WAN communications. TCP/IP is the acknowledged standard protocol of the Internet and many private networks. All workstations and servers running the TCP/IP protocols are referred to as "hosts" and are given an IP address and a host name. The IP address is what allows the host to be uniquely identified on the Internet. If a local translation file or a name server is available, the computer can be referred to by its name, which then is translated to its IP address. TCP/IP, IP addresses, and name servers will be covered more in Chapter 16, "Networking Concepts". 

Sun Solaris Benefits 

The Sun Microsystems Solaris Operating Environment and its core OS, SunOS, is a high-performance, versatile, 64-bit implementation of UNIX. Solaris runs on a wide variety of computers, from Intel-based personal computers to powerful mainframes and supercomputers. Solaris is currently the most widely used version of UNIX in the world for large networks and Internet Web sites. Sun is also the developer of the "Write Once, Run Anywhere" Java technology. The benefits of UNIX and Solaris are summarized in the Figure.

Linux Benefits 

In general, Linux includes the same benefits as UNIX. It is most often used for workstations and for small to medium servers. It is not currently widely implemented on high-end servers, but this is changing. In addition to those listed, Linux has the added benefit of being open source software and is available at very low cost. There is also a huge Internet user community that supports and promotes Linux.

 

1.4 The UNIX Operating Environment
1.4.1 Overview
UNIX is a collection of components that together make up an operating environment. Each version of UNIX varies somewhat from the others but all share the same basic characteristics.

Solaris

The OS environment on Sun systems is called the Solaris Operating Environment. The Solaris environment consists of the SunOS 5.x operating system, the Open Network Computing (ONC) protocols, and a graphical user interface (GUI). SunOS 5.x is a multiuser, multitasking network operating system that is based on the standard SVR4 UNIX operating system. ONC is a family of published networking protocols and distributed services that enable remote resource sharing, among other things. The Solaris environment supports four graphical interfaces: Common Desktop Environment (CDE) and Sun's Open Windows (bundled with the Solaris Operating Environment), GNU Network Object Model Environment (GNOME), and the K Desktop Environment (KDE). This course introduces CDE, GNOME, and KDE.

Linux

The Linux operating environment is similar to that of Solaris but the components can vary depending on the distribution. All distributions include, at a minimum, the Linux kernel, standard TCP/IP networking protocols, an installation package, the GNOME or KDE graphical desktop, and various configuration and management utilities.

 

1.4 The UNIX Operating Environment
1.4.2 The OS and the kernel
The OS 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 or the keyboard into computer operations. Most operating systems, including UNIX, have four main components: 
  • The kernel manages the operation of the computer. 
  • The shell provides for interaction between the user and the computer. 
  • The file system provides a way to organize and manage the information on the computer's hard disk(s). 
  • The commands, or utilities, are used to instruct the computer to perform tasks. 

These main components are summarized in Figure . Much of the following information applies to all varieties of UNIX, although some of the information is Solaris or Linux specific.

UNIX Kernel Overview 

The kernel is the core OS 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 boots and is conventionally named "unix" in System V-based systems or "vmunix" in BSD-based systems. Solaris contains two kernel files: a platform-independent generic kernel file that is combined with a platform-specific kernel file for a specific Sun system. These two combined files create the static core kernel that initializes and controls the system.

The Linux Kernel 

The development process for the Linux kernel is interesting and somewhat unique. Linus Torvalds maintains control of how the Linux kernel evolves, with input from people all over the Internet. Periodically, a group of developers review and test the latest contributions and release a stable version of the OS kernel. The most current version of the kernel is 2.4.7. In this numbering sequence, the numeral 2 represents the major version number and the numeral 4 represents the minor version number. The numeral 7 in the kernel number is a release or patch number. If the minor version is even, then this indicates a stable version of the OS that can be distributed to the Linux community. If the minor version is odd, then this is a development version.

Kernel Functions 

After the kernel loads, it performs the following functions (see Figure ): 

  • Manages devices, memory, and processes 
  • Controls the functions, or transmission of information, between the system programs and the system hardware 
  • Manages functions such as swap space, daemons, and file systems 
    • Swap space is a reserved part of the hard disk that the kernel uses during processing. Portions of running programs can be "swapped out" of RAM into the hard disk, and then brought back into RAM if necessary. This swap space is actually on the hard disk, but it looks like additional memory to a running program. Swap space is a raw slice, or disk file, that is set-aside during system installation. As previously mentioned, RAM is physical memory. The swap space on the hard disk represents "virtual memory" and is used to increase the size and number of programs that can be run. Most UNIX systems set up a swap space of twice the amount of RAM, or a minimum of 32 MB. Swap space is not RAM, but the operating system treats it like RAM to provide extra memory to the programs that are running. In Figure , the kernel is swapping programs in and out of the swap space on the hard disk. 
    • Daemons are programs 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, line printer scheduler (lpsched). 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 are 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 a workstation. Remote file systems are located on another computer, which is usually a server.

 

 

1.4 The UNIX Operating Environment
1.4.3 The OS 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 the user, 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. The process status (ps) or echo $SHELL commands are used to determine which shell is in use. The Solaris Operating Environment has six available shells that come with Solaris 8. The three primary command-line shells that are available in all UNIX versions are the Bourne shell, the Korn shell, and the C shell. These are common to most commercial versions of UNIX. The other three shells, BASH, Z shell, and TC shell, have been gaining in popularity among UNIX users. The BASH shell is the default for most Linux distributions, though others are also supported. CDE, GNOME, and KDE are sometimes considered to be graphical shells.

The following list explains the different shells available within a UNIX environment: 

  • The Bourne shell (/bin/sh) 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 (see Chapter 14 - "Shell Features and Environment Customization"). System administrators mostly use it. The Bourne shell prompt is a dollar sign ($) which is similar to a DOS C:\> prompt. 
  • The Korn shell (/bin/ksh) is a superset of the Bourne shell and was developed by David 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 ($).
  • The C shell (/bin/csh) is based on the C programming language. Similar to 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 Bourne-Again Shell (bash) has the feel of the Bourne and Korn shells and incorporates features from the C and Korn shells. Bash is the most popular shell with Linux and is the default for most distributions. Bash can be downloaded from GNU (www.gnu.org). 
  • The TC shell (tcsh) is a popular variant of the C shell that supports command-line editing and command-line completion. 
  • The Z shell closely resembles the Korn shell, but it has many other enhancements.

Note: Examples given in this curriculum are based primarily on the Korn and Bash shells.

Lab Activity
  UNIX Computing Environment

This lab exercise will review UNIX computing environments terminology and help to reinforce concepts introduced in Chapter 1. The student will also investigate the use of UNIX at their institution or another organization and research web sites to see what organizations are using Solaris UNIX.

 

1.4 The UNIX Operating Environment
1.4.4 The file system
The file system provides a way to separate and keep track of the information on a hard disk. The file system determines the type, characteristics, and arrangement of files that can be stored on disk. A file system is created on a disk partition using the formatting process. A partition can occupy the entire hard disk or can be a subdivided segment of the disk. Partitions will be discussed further in chapter 8, "File System Systems and File Utilities". 

Formatting is similar to putting up street signs in a new residential area. No one lives there yet, but the home locations are identified.

There are many different types of file systems supported by various operating systems. Those file systems common in the Windows environment include the File Allocation Table 32-bit (FAT32) and New Technology File System (NTFS). Sun Solaris uses the UNIX File System (UFS). Linux uses primarily the Second Extended File System (ext2) or Third Extended File System (ext3). A hard disk may have one or more partitions or file systems defined on it.

The file system provides for the definition of a file structure. The file structure is a hierarchy of directories, subdirectories, and files that are grouped together for a specific purpose. File system support is integrated with the kernel to provide an organizational structure for software and data (see Figure ). The file structure organizes the information on hard disks to make them more manageable, and it enables users to locate files. Hard disks can be divided into partitions with file systems, directories, subdirectories, and files. The file system organizes 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 (see Figure ). The following is the hierarchy of the UNIX file system: 

  • The file system is a formatted structure set up on one or more partitions to store files and directories. Partitions and the associated file systems are similar to the drive C: or D:, in the Windows/DOS world or like volumes with Novell NetWare. File systems can be either local, meaning on the user's computer or remote, meaning on another computer but accessed as if it were local. 
  • The directory is a location for files and other subdirectories. The Solaris file system, or directory structure, enables the user 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 (/). 
  • The subdirectory is any directory below another directory. For example, some of the subdirectories under the root (/) directory are /usr, /etc, and /home. 
  • The files are contained in directories and subdirectories. They are the lowest level of the file system. There are usually thousands of files on a hard disk and there are several different types: 
    • Directories are considered a type of file under the UNIX file system. 
    • Plain ASCII (American Standard Code for Information Interchange) files are pure text files, with no special formatting characters in them. 
    • Application files are created by an application such as a word processor, spreadsheet, or database program. 
    • Executable programs are UNIX utility commands and application programs.

Common UNIX Directories 

The topmost 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 it contains critical system files such as the kernel. The following list contains some of the more important directories and their purposes. The slash in front of these directories indicates that they are actually subdirectories of the root directory. See Figure . UNIX directory structures such as directory names, locations, and contents can vary from one version to another. Linux directory structures are relatively consistent with most distributions adhering to the Linux File System Standard (FSSTND) or the Filesystem Hierarchy Standard (FHS). 

The following list of directories is not intended to be all-inclusive, but does include those most commonly found on UNIX systems:

Note: The directories followed by a * (single asterisk) are specific to Solaris. Those followed by a ** (double asterisk) are specific to Linux. All others are common to both.

  • The /bin (binary) directory contains many of the UNIX commands. 
  • The /boot directory** contains most of the files necessary to boot a Linux system. 
  • The /dev (devices) directory contains files that are pointers to device file names. All devices in UNIX have standard filenames. 
  • The /etc (etcetera) directory contains system administration files, such as the password file. This directory is commonly referred to as et-cee. 
  • The /export/home directory* contains the user home directories. Depending on how the system has been set up by the administrator, the home directories could be found in /home. 
  • The /home directory contains the user home directories. 
  • The /kernel directory* contains the basic operating system files, such as the main UNIX kernel genunix. 
  • The /lib (library) directory contains common library files used by programs in the /bin and /sbin directories. 
  • The /mnt (mount) directory** is the standard mount point for files systems such as the floppy disk and CD-ROM. 
  • The /opt (optional) directory contains Sun's unbundled software applications and third-party applications. This directory is not always used with Linux. 
  • The /proc (process) directory** contains files relating system information used by the kernel. 
  • The /root directory** is the super users home directory. 
  • The /sbin (single user binaries) directory contains essential executables used in the booting process and in system failure recovery. This directory also includes some system-administration utilities. 
  • The /tmp (temp) directory contains temporary files placed by users. Occasionally, files in /tmp get deleted by an administrator or automatically are deleted as part of system startup. 
  • The/usr directory contains files and programs used by all users. 
  • The /usr/bin (user) directory contains executable commands, system administration utilities, and library routines. 
  • The /usr/src directory** contains the Linux source code. 
  • The /usr/ucb directory contains commands originally developed under BSD UNIX. They exist because some users prefer the BSD version of a command to the System V version. 
  • The /var (variable) directory contains dynamic and variable data such as print spooling and mail system error messages.

UNIX Commands 

Unix commands are key to maintaining the file system. The UNIX operating system comes with more than 350 commands and utility programs. These UNIX commands and utility programs are used to perform the following functions: 

  • File maintenance such as creating, editing, copying, deleting, and so on 
  • Administration such as adding new users, printers, disks, and so on 
  • Printing 
  • Networking and communication 
  • Programming 
  • Obtaining help 

Commands tell the shell what to do, such as list the contents of a directory or copy a file. Some commands are built into the shell program, such as change directory (cd) and exit. Most commands reside on the hard drive in a directory named bin, which is short for binary code.

 

1.4 The UNIX Operating Environment
1.4.5 Graphical user interface (GUI) options
All modern operating systems include a graphical user interface (GUI). A number of popular ones, including Microsoft Windows, UNIX CDE, and several others, will be covered. 

Common Desktop Environment (CDE) 

Sun Microsystems was the first company to use a windowing environment in conjunction with the UNIX OS. In 1993, a consortium of UNIX platform vendors was formed to develop an integrated, standard, and consistent GUI desktop environment. The contributors included Hewlett-Packard, IBM, Novell, and Sun Microsystems. Many other companies and members of the Open Software Foundation (OSF), X/Open, and the X Consortium also contributed. CDE is Motif-based and users of other UNIX and personal computer (PC) desktops should be comfortable using CDE. Many of the features of CDE are common to other desktop environments. 

The Common Desktop Environment (CDE) offers the following for users: 

  • Provides a GUI between the user and the OS 
  • Includes built-in menus for users to select and run utilities and programs without using Solaris Environment commands 
  • Provides more than 300 utility programs and tools 
  • Enables users to control multiple documents or applications on the screen at the same time 
  • Controls activities in windows using both the mouse and the keyboard 

Figure represents some of the major programs and tools available with CDE, including Calendar, file management, e-mail, printer management, and notes. Figure shows a typical CDE screen. CDE is discussed in greater detail in subsequent chapters.

Open Windows 

Open Windows is Sun's original GUI developed for the Solaris environment (see Figure ). It is similar to CDE, but it is proprietary and not well supported. The user has a choice when logging into a Solaris workstation to select either CDE or Open Windows.

GNU Network Object Model Environment (GNOME) 

The latest windowing system to emerge in the UNIX world is GNOME. GNOME is part of the GNU open source software project. GNOME has an easy-to-use desktop environment for the user, a powerful application framework for the software developer, and it is free of cost. GNOME (http://gnome.org) is included in most BSD versions of UNIX and with GNU/Linux distributions. GNOME also works with many other UNIX systems, including Solaris (www.sun.com/gnome). 

GNOME combines advanced desktop organization and navigational features that enable easy access to information. See Figure . It provides usability, appearance, and personalization to match a user's unique working style. 

The GNOME Desktop key features include the following: 

  • Attractive, intuitive user interface 
  • Personalization capabilities 
  • Convenient front panel for rapid access to favorite programs 
  • Full suite of powerful applications 
  • Capability to run existing CDE and Java-based applications

K Desktop Environment (KDE) 

KDE is a mature, full-featured desktop environment that is used primarily with Linux. As with GNOME, KDE is also open source software and is freely available. KDE can run with several varieties of UNIX. Most distributions of Linux come with KDE as well as GNOME. The K does not stand for anything in particular. It is just the first letter in the alphabet before L, which represents Linux. Solaris also supports KDE and is available on the Solaris Software Companion CD co-packaged with Solaris or downloaded from http://wwws.sun.com/software/solaris/freeware/.

 

  Summary
The main components of a computer are RAM, CPU, I/O, and disk. They are controlled by the operating system. 

Most desktop operating systems are intended for use by a single user. Network operating systems such as UNIX are usually installed in servers that can support many users and large networks. 

UNIX originally was developed at Bell Labs, and significant improvements were made at UC Berkeley, including the addition of networking capabilities. The industry standard SVR4, lead to the development of several current varieties of UNIX including Sun Microsystems Solaris. 

The key pieces of the Solaris Operating Environment are the SunOS, the Open Network Computing (ONC) protocols, and the Common Desktop Environment (CDE) GUI. 

The main components of the SunOS are the kernel, the shell, the file system, and commands. The kernel manages hardware, daemons, swap space, and the file system. The shell is an interpreter that provides an interface between the kernel and the user. The file system manages and organizes information on the hard disk. Commands dictate what action the shell is to take. 

Several graphical desktop shells are available for UNIX. CDE is used primarily in the commercial environment. GNOME and KDE are open source desktops used primarily with Linux.

 

  Overview
In this chapter the student will learn the requirements for user accounts and passwords. Also covered in this chapter is the procedure for logging in and out of the system using both the command line and graphical login manager. Students will become familiar with the UNIX Common Desktop Environment (CDE), basic features and functions of CDE, and how to use the Style Manager to customize the CDE workspace. GNU Network Object Model Environment (GNOME) and K Desktop Environment (KDE) graphical desktop managers will be introduced as well as working with GNOME panels and menus.

 

2.1 User Accounts
2.1.1 Account types
Users must have an account to access resources on a UNIX system. User accounts identify a user to the system. Accounts also determine what activities a user can perform and what files a user can access. Two types of accounts exist on a UNIX computer. They are the root or superuser account and user accounts.

The Root Account

The root account is the system administration account and is created automatically during the operating system installation process. The root account is the only account on the system when it is first installed. The root login account owns all system files and has access to all files. It is similar to the Administrator account with Windows NT/2000 and the Admin account with Novell NetWare.

The root account creates new users, manages file systems, installs software, and performs other high-level system administration tasks. The root account can access and modify any file or directory on the system. Because it is "all powerful," the root account should be used sparingly. Most UNIX administrators have a user account with special administrative privileges that they use on a daily basis and log in as root only when necessary. This minimizes the risk of leaving the root account exposed by accidentally walking away from the system while logged in as root and potentially having the system compromised.

User Accounts

User accounts are created and maintained by the system administrator when logged on as root. Every user who needs access to the system must have a user account to log in and use the computer. Regular users can run applications and customize their working environment. They also can create and modify files in their home directory and subdirectories below it (See figure).

2.1 User Accounts
2.1.2 Login ID and password requirements
Login ID

For users to log in, they must have a user account that includes a login identification (ID) and password. The login ID is the user's public name and is commonly referred to as the user name. Depending on the system administrator, login IDs are usually some combination of a user's first and last names. For example, user Bob Wood's login ID might be bobw, bwood, woodb, or bw2. The login ID must be unique on the system and there are usually some limitations on the type and number of characters that can be used. Login IDs on Solaris systems are limited to eight alphanumeric characters. Solaris system login IDs can be any combination of upper or lowercase letters, numbers, and special characters such as: !, $, -, _, and so on. See Figure . Most versions of Linux limit the login ID to 32 alphanumeric characters or less. It is best to keep login IDs to eight or less alphanumeric characters and use special characters sparingly. Dashes and underscores are recommended. When creating the user, the administrator can also include the user's full name. The login ID, user's full name, and other account information are stored in the password (/etc/passwd) file, which can be viewed by all users. User passwords, in encrypted form, are stored in the /etc/shadow file.

Passwords

The user's password protects the account from unauthorized access. In both Solaris and Linux there are specific rules for creating passwords to help ensure system security.

Solaris and Linux passwords must be at least six characters in length and different from the login ID. The first six characters of the Solaris password must contain at least two alphabetic characters and at least one numeric or special character. Linux passwords can be any combination of alphanumeric or special characters and there is no requirement for what the first six must contain.

Passwords are case sensitive. This means that they can be created with uppercase or lowercase letters and must be entered exactly the same way when logging in. For example, the password ABc123 is different from the password ABC123. When changing Solaris passwords, the new password must differ from the previous password by at least three characters. When changing Linux passwords, the new password must contain no more than two successive characters from the previous one and cannot contain dictionary words. Passwords may contain spaces and special characters. As an example, the password a9$B7 c5 is perfectly valid. The length is six or more characters, it also has upper and lowercase letters, numbers, a special character, and a space. See Figure for a list of Solaris password requirements that apply to user accounts.

Note: The password requirements above do not apply to the Solaris root account password or to any user password assigned by the root user. These rules apply when a Solaris user changes their password. The Linux root user password follows the same rules as a regular user account.

 

2.1 User Accounts
2.1.3 Local and remote access
Local Access

Most UNIX systems provide two ways to directly access a system. The user can login using either a graphical interface such as CDE, or the standard character based login.

Remote Access

A user can also access a UNIX system from another computer such as a Windows PC, Apple Macintosh, or even another UNIX system. To login to a remote UNIX workstation or server the character based Telnet program or a graphical terminal emulator is used. The UNIX command rlogin, for "remote login", can also be used to log into another Solaris host on an accessible network.

CDE provides a graphical user interface for local access to a UNIX system. However, the login can be performed using any UNIX GUI or any graphical programs remotely from a Windows PC using an X-Windows terminal emulator program. X-Windows is the standard graphical support system for UNIX. Emulators are available from such companies as StarNet (www.starnet.com), Hummingbird (www.hummingbird.com), or Tarantella (www.tarantella.com). When finished working with UNIX exit the emulator program and return to Windows. It is also possible to cut, copy, and paste between the two environments.

CDE Login Manager

Most Solaris workstations have the graphical Common Desktop Environment (CDE) installed and will boot automatically to a graphical environment. Before logging into the account, CDE displays the graphical Login Manager screen shown in Figure .

Four buttons are located at the bottom of the Login Manager screen:

  • OK, accepts the username and password as entered
  • Start Over, clears the username and password fields
  • Options, provides several choices for logging in
  • Help, provides assistance for using Login Manager

Logging in identifies the user to the system. To log in, use the login screen shown or log in at the command line. When the CDE Login Manager screen is used, the user enters the CDE graphical user interface (GUI) environment.

Options Button

The CDE Login Manager Options drop down menu provides a set of choices for logging in. Five choices are available with the Options menu as summarized in Figure :

  • The Language option typically is set at installation and is not used often.
  • The Session option offers a choice of GUI desktop environments (CDE or Open Windows) and provides a Failsafe login option, which can be used for troubleshooting.
  • Remote Login allows the user to log into another Solaris machine, such as a server or another workstation on the network.
  • The Command Line Login option bypasses the GUI environment and goes directly to a console prompt. It stays at the command line.
  • The Reset Login Screen option restores all settings to their defaults.

 

2.1 User Accounts
2.1.4 Logging in and out using the CDE login screen
Logging In with CDE 

The CDE login screen replaces the usual login prompt common in UNIX systems. The Login screen is the entry point into the system. If a login ID, or user name, and password have not been assigned, the system cannot be accessed. The username for the interactive media activities will be user2. 

Enter the login name in the appropriate boxed area and then press the Return key or left click the OK button. If the login name or password are typed incorrectly, the process must be repeated using the correct information. 

The Start Over button completely refreshes the screen and removes any typed entries