Linux
eBook - ePub

Linux

The Textbook, Second Edition

Syed Mansoor Sarwar, Robert M Koretsky

Share book
  1. 658 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Linux

The Textbook, Second Edition

Syed Mansoor Sarwar, Robert M Koretsky

Book details
Book preview
Table of contents
Citations

About This Book

Choosen by BookAuthority as one of BookAuthority's Best Linux Mint Books of All Time

Linux: The Textbook, Second Edition provides comprehensive coverage of the contemporary use of the Linux operating system for every level of student or practitioner, from beginners to advanced users. The text clearly illustrates system-specific commands and features using Debian-family Debian, Ubuntu, and Linux Mint, and RHEL-family CentOS, and stresses universal commands and features that are critical to all Linux distributions.

The second edition of the book includes extensive updates and new chapters on system administration for desktop, stand-alone PCs, and server-class computers; API for system programming, including thread programming with pthreads; virtualization methodologies; and an extensive tutorial on systemd service management.

Brand new online content on the CRC Press website includes an instructor's workbook, test bank, and In-Chapter exercise solutions, as well as full downloadable chapters on Python Version 3.5 programming, ZFS, TC shell programming, advanced system programming, and more. An author-hosted GitHub website also features updates, further references, and errata.

Features

  • New or updated coverage of file system, sorting, regular expressions, directory and file searching, file compression and encryption, shell scripting, system programming, client-serverā€“based network programming, thread programming with pthreads, and system administration
  • Extensive in-text pedagogy, including chapter objectives, student projects, and basic and advanced student exercises for every chapter
  • Expansive electronic downloads offer advanced content on Python, ZFS, TC shell scripting, advanced system programming, internetworking with Linux TCP/IP, and many more topics, all featured on the CRC Press website
  • Downloadable test bank, workbook, and solutions available for instructors on the CRC Press website
  • Author-maintained GitHub repository provides other resources, such as live links to further references, updates, and errata

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weā€™ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Linux an online PDF/ePUB?
Yes, you can access Linux by Syed Mansoor Sarwar, Robert M Koretsky in PDF and/or ePUB format, as well as other popular books in Computer Science & Operating Systems. We have over one million books available in our catalogue for you to explore.

Information

Year
2018
ISBN
9781351768290
Edition
2

1

Overview of Operating Systems

OBJECTIVES

  • ā€¢ To explain what an operating system is
  • ā€¢ To briefly describe operating system services
  • ā€¢ To describe character and graphical user interfaces
  • ā€¢ To discuss different types of operating systems
  • ā€¢ To briefly describe the Linux operating system
  • ā€¢ To give an overview of the structure of a contemporary system
  • ā€¢ To briefly describe the structure of the Linux operating system
  • ā€¢ To detail some important system setups
  • ā€¢ To briefly describe the history of the Linux operating system
  • ā€¢ To provide an overview of the different types of Linux systems

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.
Images
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.
Images
FIGURE 1.2 Software architecture of the Linux operating system.

1.3 Operating System Services

An operating system provides many ready-made services for users. Most of these services are designed to allow you to execute your software, both application programs and program development tools, efficiently and securely. Some services are designed for housekeeping tasks, such as keeping track of the amount of time that you have used the system. The major operating system services therefore provide mechanisms for the following secure and efficient operations and processes:
  • ā€¢ Execution of a program
  • ā€¢ Input and output operations performed by programs
  • ā€¢ Communication between processes
  • ā€¢ Error detection and reporting
  • ā€¢ Manipulation of all types of files
  • ā€¢ Management of users and security
A detailed discussion of these services is outside the scope of this textbook, but we discuss them briefly when they are relevant to the topic being presented.

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.

1.5 Types of Operating Systems

Operating systems can be categorized according to the number of users who can use the system at the same time and the number of processes (executing programs) that the system can run simultaneously. These criteria lead to three types of operating systems:
  • ā€¢ Single-user, single-process system: These operating systems allow only one user at a time to use the computer system, and the user can run only one process at a time. Such operating systems are commonly used for PCs. Examples of these operating systems are earlier versions of Mac OS, DOS, and many of Microsoft's Windows operating systems.
  • ā€¢ Single-user, multiprocess system: As the name indicates, these operating systems allow only a single user to use the computer system, but the user can run multiple processes simultaneously. These operating systems are also used on PCs. Examples of such operating systems are OS/2, Windows XP Workstation, and batch operating systems. Batch processing is still commonly used in mainframe computers, and ...

Table of contents