1.1 Introduction
Many operating systems are available today, some general enough to run on any type of computer (from handheld, Internet of things (IoT) devices, to cloud-based, warehouse-scale server clusters) and some specifically designed to run on a particular type of computer system, including real-time embedded computer systems used to control the movement of mechanical devices such as robots, IPads, and a plethora of cell phone models. In this chapter, we describe the purpose of an operating system and the different classes of operating systems. Before describing the different types of operating systems and where Linux fits in this categorization, we present a layered diagram of a contemporary computer system and discuss the basic purpose of an operating system. We then describe the different types of operating systems and the parameters used to classify them. Finally, we identify the class that Linux belongs to and briefly discuss the different members of the Linux family.
The people who use Linux comprise application developers, systems analysts, programmers, administrators, business managers, academicians, and people who just wish to read their e-mails. From its inception in the early 1990s as a hobbyist project, it was explosively developed in conjunction with the development of the Internet, via a vast community of developers, and then completely adopted for commercial uses. In the fully developed and mature versions of today, Linux has an underlying functionality that is complex but easy to learn, and extensible yet easily customized to suit a user's style of computing. One key to understanding its longevity and its heterogeneous appeal is to study the history of its evolution.
1.2 What Is an Operating System?
A computer system consists of various hardware and software resources, as shown in a layered fashion in Figure 1.1. The primary purpose of an operating system is to facilitate easy, efficient, fair, orderly, and secure use of these resources. This purpose can be conveniently described as a controlling function that ensures concurrency, virtualization, and persistence. It allows the users to employ application software—spreadsheets, word processors, Web browsers, e-mail software, and other programs. Programmers use language libraries, system calls, and program generation tools (e.g., text editors, compilers, and version control systems) to develop software. Fairness is obviously not an issue if only one user at a time is allowed to use the computer system, including single-user desktop systems, laptops, tablet computers, and cell phones. However, if multiple users are allowed to use the computer system, fairness and security are two main issues to be addressed by the operating system designers.
FIGURE 1.1 A layered view of a contemporary computer system.
Hardware resources include keyboards, touch pads, display screens (may also be touch screens), main memory (commonly known as random access memory or RAM), disk drives, network interface cards, and central processing units (CPUs). Software resources include applications such as word processors, spreadsheets, games, graphing tools, picture- and video-processing tools, and Internet-related tools such as Web browsers. These applications, which reside at the topmost layer in the diagram, form the application user interface (AUI). The AUI is glued to the operating system kernel via the language libraries and the system call interface. The system call interface comprises a set of functions that can be used by the applications and library routines to execute the kernel code for a particular service, such as reading a file. The language libraries and the system call interface comprise what is commonly known as the application programming interface (API). The kernel is the core of an operating system, where issues such as CPU scheduling, memory management, disk scheduling, and interprocess communication (IPC) are handled. The layers in the diagram are shown in an expanded form for the Linux operating system in Figure 1.2, which are described briefly.
There are two ways to view an operating system: top down and bottom up. In the bottom-up view, an operating system can be viewed as a software system that allocates and deallocates system resources (hardware and software) in an efficient, fair, orderly, and secure manner. For example, the operating system decides how much RAM space is to be allocated to a program before it is loaded and executed. The operating system ensures that only one file is printed on a particular printer at a time, prevents an existing file on the disk from being accidentally overwritten by another file, and further guarantees that, when the execution of a program given to the CPU for processing has been completed, the program relinquishes the CPU so that other programs can be executed. Thus, in the bottom-up view, the operating system is a resource manager.
In the top-down view, which we espouse in this textbook, an operating system can be viewed as a piece of software that isolates you from the complications of hardware resources. You therefore do not have to deal with the extremely difficult (and sometimes impossible for most users) task of interacting with these resources. For example, as a user of a computer system, you don't have to write the code that allows you to save your work as a file on a hard disk, use a mouse as a point-and-click device, use a touch screen or touch pad, or print on a particular printer. Also, you do not have to write new device driver software for a new device (e.g., mouse, disk drive, or DVD) that you buy and install in your system. The operating system performs the task of dealing with complicated hardware resources and gives you a comprehensive machine with a simple, ready-to-use interface. This machine allows you to use simple commands to retrieve and save files on a disk, print files on a printer, and play movies from a DVD. In a sense, the operating system provides a virtual machine that is much easier to deal with than the physical machine. You can, for example, use a command such as cp memo letter to copy the memo file to the letter file on the hard disk in your computer without having to worry about the location of the memo and letter files on the disk, the structure and size of the disk, the brand of the disk drive, and the number or name of the various drives (hard drive, Solid State Drive (SSD), DVD, etc.) on your system.
FIGURE 1.2 Software architecture of the Linux operating system.
1.4 Character (Command Line) versus Graphical User Interfaces
To use a computer system, you have to give commands to its operating system. An input device, such as a keyboard, is used to issue a command. If you use the keyboard to issue commands to the operating system, the operating system has a character user interface (CUI), commonly known as the command line interface. If the primary input device for issuing commands to the operating system is a point-and-click device, such as a mouse, a touch screen, or a touch pad, the operating system has a graphical user interface (GUI). Most, if not all, operating systems have both CUI and GUI, and you can use either. Some have a command line as their primary interface but allow you to also run software that provides a GUI. Operating systems such as UNIX and Linux have CUIs, whereas Mac OSX and Microsoft Windows primarily offer GUIs but have the capability to allow a user to enter text in a terminal screen. Although Linux comes with a CUI as its fundamental interface, it can just as easily run the GUI-based software that uses Wayland to provide the GUI interface. We primarily discuss the Linux GUI in Chapters 17 and W28.
Although a GUI makes a computer easier to use, it gives you an automated setup with reduced flexibility. A GUI also presents an extra layer of software between you and the task that you want to perform on the computer, thereby making the task slower. That is because this GUI layer of software consumes a significantly larger part of system resources to maintain its operability. In contrast, a CUI gives you ultimate, fine-grained control of your computer system and allows you to run application programs any way you want. A CUI is also more efficient because a minimal layer of software is needed between you and your task on the computer, thereby enabling you to complete the task faster. The CUI software consumes a significantly smaller part of system resources to maintain its operability. It is also malleable and gives the user more control. Because many people are accustomed to the graphical interfaces of popular gizmos and applications, such as IoT devices, high-powered video games, and Web browsers, the character interface presents an unfamiliar, and sometimes less intuitive, and difficult style of communicating commands to the computer system. However, computer science students are usually able to meet this challenge after a few hands-on sessions.