Cybit110 Module 01
Cybit110 Module 01
Operating
Systems, 6th
Edition
Module 1: Operating Systems
Fundamentals
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 1
Learning Objectives
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 2
What is an Operating System
• An operating system is a program that acts as an interface between the user and
the computer hardware and controls the execution of all kinds of programs
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 3
Categories of Operating Systems
• Personal (desktop) operating systems - designed to be installed on a single
computer
• Server (network) operating systems - designed to be installed on a network
server
− Client computers still use a personal operating system
− Server operating system controls access to network resources
• Mobile operating systems - used with smartphones and other mobile devices
• Embedded operating systems - built into devices (cars, kiosks, consumer
electronics, etc.
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 4
An Introduction to Operating Systems (1 of 3)
• A computer’s functions and features can be broken down into three basic tasks all
computers perform:
− Input
− Processing
− Output
• The functions above involve some type of computer hardware
− But the hardware is controlled and coordinated by the operating system (OS)
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 5
An Introduction to Operating Systems (2 of 3)
• An OS is a specialized computer program that provides the following features:
− User interface – the user interface provides a method for users to interact with
the computer
− Storage management – the file system is a method by which an OS stores and
organizes files and manages access to files
− Process and service management – a process is a program that’s loaded into
memory and run by the CPU; a service is a type of process that runs in the
background
In Windows, it is a service while in Linux is a daemon
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 6
An Introduction to Operating Systems (3 of 3)
• An OS is a specialized computer program that provides the following features
(continued):
− Memory and I/O management – the OS must determine if sufficient memory
exists to load an application and where in memory it should be loaded
The OS also ensures that I/O devices such as USB ports and video cards
are accessed by only one process at a time
− Security and resource protection – OSs used on business systems provide
methods for securing access to resources
− Kernel – the kernel is the heart of the OS and runs with the highest priority
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 7
Kernel
• Kernel performs many tasks such as:
− schedules processes to run
− making sure high-priority processes are taken care of first
− performs memory and I/O management
− provides a number of security and resource protection functions
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 8
Operating System Categories
• There are three broad categories of operating systems:
− Single-tasking versus multitasking
− Single-user versus multiuser
− General-purpose versus real-time
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 9
Single-Tasking Versus Multitasking Operating
Systems (1 of 4)
• A single-tasking operating system can execute only a single process at a time
− Apple’s iOS 3 (and earlier versions) are examples
Other examples are:
• CP/M, PC-DOS, and MS-DOS
• Command-line OSs that ran on IBM PC in early 1980s.
− An embedded system is a computing device designed for a specific task and
uses a single-tasking OS
• A multitasking operating system quickly switches between all the processes that
are loaded into memory and scheduled to run
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 10
Single-Tasking Versus Multitasking Operating
Systems (2 of 4)
• There are two general types of multitasking:
− Cooperative multitasking – the OS gives CPU control to a process and waits for
it to terminate or enter a waiting state
If the program does not give control back to the OS, it may hog the CPU
until its operations are complete
No other program can run until control is given back to the OS
Found in early Windows versions
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 11
Single-Tasking Versus Multitasking Operating
Systems (3 of 4)
• There are two general types of multitasking (continued):
− Preemptive multitasking – the OS is in control of the computer at all times
The running process can be replaced with another process at any time
based on a system interrupt, a higher-priority task requiring the CPU, or the
time-slice timer expiring
The OS has control over how much of the computer’s resources are
allocated to each program
Computers must use more of their CPU and memory to support the OS, but
the behavior of the computer is more predictable
The user can play music while working in documents and Web browsers
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 12
Single-Tasking Versus Multitasking Operating
Systems (4 of 4)
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 13
Processing Techniques for Increased
Efficiency: Multitasking and Multithreading
• Multitasking refers to the ability of an operating system to have more than one
program (task) open at one time
− CPU rotates between tasks
− Switching is done quickly
− Appears as though all programs are executing at the same time
• Multithreading enables the computer to rotate between multiple threads so that
processing is completed faster and more efficiently
− A thread is a sequence of instructions within a program that is independent
of other thread
• In either case, tasks are performed sequentially
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 14
Multiprocessing and Parallel Processing
• Both involve using two or more CPUs or CPU cores in one computer to perform
work more efficiently
− Multiprocessing: Each CPU or core typically works on a different job
Used with computers and devices that have multi-core CPUs and/or multiple
CPUs
• Parallel processing: The CPUs or cores typically work together to complete one job
more quickly
− Used most often with supercomputers
• In either case, tasks are performed simultaneously
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 15
Sequential versus Simultaneous Processing
• Sequential versus simultaneous processing
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 16
Single-User Versus Multiuser Operating Systems
• A single-user operating system allows only one user at a time to interact with the
OS user interface, start processes, make system configuration changes, and
interact directly with the file system
− Windows 10 and earlier Windows client versions are arguably single-user
systems
• A multiuser operating system allows multiple users to sign in to it, start and stop
processes, interact with the user interface, and access the local file system
− Linux/UNIX OSs have always supported multiple users, and Windows Server
versions also allow multiple users through Remote Desktop Protocol (RDP)
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 17
General-Purpose Versus Real-Time Operating Systems
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 18
General Operating System Design
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 19
Operating System Roles
• OSs can be defined by the role they play from the perspective of the user
• Most OSs can be classified as one of the following:
− Client
− Server
− Standalone
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 20
Client Operating Systems
• The primary purpose of a client operating system is to run applications requested
by a user and request data from network servers as necessary
− Client OSs are usually installed on desktop or laptop computers and mobile
devices and use a graphical user interface (GUI)
− Client OSs usually include client versions of many network applications
For example, Windows 10 comes with Client for Microsoft Networks for
accessing shared files and printers
Linux clients come with the Linux equivalent of Client for Microsoft
Networks, called SAMBA, as well as the Linux native file sharing protocol,
Network File System (NFS).
− Most client OSs are performance-tuned for running foreground applications
(user applications) instead of background services
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 21
Server Operating Systems (1 of 3)
• The primary purpose of a server operating system is to share network resources
and provide network services to clients
• Examples of server OSs include Windows Server, macOS Server, UNIX, and many
Linux distributions
• Server OSs usually come with a DHCP server, a DNS server, a file server protocol,
a Web server, and perhaps a directory service such as Microsoft’s Active Directory
− May also be used as virtualization hosts on which several virtual servers can
run.
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 22
Server Operating Systems (2 of 3)
• Server OSs often have built-in functions for the following:
− Fault tolerance is the ability of a system to recover from a hardware or software
failure
− A server OS typically supports clustering, which is the ability of two or more
servers to act as one
− A load-sharing cluster has two or more servers that alternate in taking client
requests
− Many servers also support hot swapping of components such as hard disks,
memory, or even processors so that if a computer fails, a new component can
be swapped in without shutting down the system down
− For scalability, some servers support hot adding of components so that more
storage, RAM, or processors can be added while the system is running
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 23
Server Operating Systems (3 of 3)
• A server OS is usually installed on a more powerful computer that may have
several high-speed network interfaces and terabytes of storage
• The hardware of a server must support fault-tolerant features such as hot
swapping and failover clustering
− Server hardware can take different forms, including traditional tower computers,
rack-mounted servers, and blade servers
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 24
Standalone Operating Systems
• A standalone operating system is not designed to interact with other OSs or
access network resources
• Most standalone OSs run on embedded systems
• OSs that run older or isolated traffic signal systems are likely to be standalone
− As are the OSs that run automobile electronic systems and industrial
machinery
• This is changing as computer-controlled devices are being built with IoT in mind
− So operational and performance data from these devices can be collected and
analyzed to make processes more efficient
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 25
Primary Operating System Components
• This section will examine the following OS components:
− The boot procedure
− Process and service management
− Memory and I/O management
− Security and resource protection
− The kernel
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 26
The Boot Procedure (1 of 5)
• The boot procedure is a series of steps performed by every computing device that
starts with power to the CPU and other hardware components and ends with a
running system ready to perform work
• The boot procedure can be broken down into six general steps:
− 1. Power is applied to the CPU and other hardware components
− 2. The CPU starts
− 3. The CPU executes the firmware startup routines
− 4. The operating system is located by the firmware
− 5. The OS is loaded into RAM
− 6. OS processes and services are started
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 27
The Boot Procedure (2 of 5)
• Firmware is program code that is stored on computer hardware in non-volatile
memory and is responsible for performing diagnostic tests and booting the OS
• Non-volatile memory is memory that maintains its contents when no power is
applied to the system
− It is typically flash memory in modern systems or electrically erasable
programmable read-only memory (EEPROM) in older systems
• Firmware is called the BIOS or UEFI in newer systems
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 28
The Boot Procedure (3 of 5)
• Firmware contains an initial bootstrap program that locates and then loads the
bootloader program, which is responsible for loading the initial process that makes
up the OS
− The bootloader is typically stored on the disk where the OS is stored.
− The bootloader for Windows Vista and later versions is called Boot Manager
(BOOTMGR); NTLDR is used in older versions of Windows.
− Linux systems use a variety of bootloaders, including Grub and LILO.
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 29
The Boot Procedure (4 of 5)
• The basic input/output system (BIOS) and Unified Extensible Firmware Interface
(UEFI) are firmware programs that play a part in the boot process
• The BIOS has the following properties and performs the following tasks:
− Resides on a chip on the computer’s motherboard
− Initializes I/O devices
− Performs tests at startup, such as memory and hardware component tests
called the power-on self-test (POST)
− Provides a user interface to allow hardware configuration such as CPU
overclocking or disk configuration
− Locates and loads the OS that interfaces with the user
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 30
The Boot Procedure (5 of 5)
• Every PC has a BIOS, which is stored in a flash memory chip.
• BIOS configuration is stored in a complementary metal oxide semiconductor
(CMOS) memory chip
• Users can make changes to the BIOS configuration by accessing the BIOS setup
screen before the computer boots
• When a PC is turned on:
− The machine wakes up and begins executing a startup program inside the
BIOS
− This program initializes the screen and keyboard, tests hardware, and initializes
the hard disk and other drives
− The main operating system is loaded onto the hard disk
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 31
BIOS Setup Screen
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 32
Process and Service Management (1 of 6)
• A process is a program that is loaded into memory and executed by the CPU
• A program can be a user application, an OS service, or even the kernel
• On a Windows 10 system, you can see all running processes by using Task
Manager
• Background processes listed by Task Manager are not essential for the OS to
function
• Windows processes are required for full system functionality and include the
registry service, user interface components, network services, interrupt handlers,
and logon services
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 33
Process and Service Management (2 of 6)
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 34
Process and Service Management (3 of 6)
• Kernel Mode Versus User Mode Processes
− Kernel mode is a CPU mode in which a process has unrestricted access to the
computer hardware and has access to privileged CPU instructions
Privileged CPU instructions include those that switch between kernel and
user mode and those that configure interrupts, timers, and I/O devices
− User mode is a CPU mode in which the process can only access memory
locations allocated to it by the OS, must ask the OS to access I/O devices on
its behalf, and can’t execute privileged CPU instructions
If a user mode process attempts to execute a privileged instruction, an I/O
address, or a memory address outside of its allocated range, an error will be
generated and the process will be terminated.
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 35
Process and Service Management (4 of 6)
• A file handle is an identifier for a file that contains all the information the file system
needs to locate and access the file
• Process Creation and Termination
− When a process is created, it is assigned a process ID (PID), which allows other
processes to communicate with it and the user to manage it
For example, to see processes that you started in Linux, you can type the ps
command; the output contains the PID.
• You can terminate a process using its PID by typing kill PID, where PID is
the process ID.
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 36
Process and Service Management (5 of 6)
− Processes are usually created in one of four ways:
Through a request by the operating system
• After the kernel is loaded and initialized, other kernel mode processes such
as services and device drivers are loaded.
• On Linux systems, a process called systemd or init is the first user mode
process started; it is responsible for starting most of the other user mode
processes that start when the system boots.
• On Windows systems, after the kernel mode processes and device drivers
are loaded, the kernel loads the Windows Session Manager, which loads
several critical processes, including
• wininit – starts most of the services that are configured to start when the
system boots, and the authentication service (called lsass) is used to
verify user credentials.
• Winlogon - handles the user logon procedure, calling lsass to verify
credentials, and starts the Desktop Window Manager (dwm) that
manages much of the Windows 10 user interface.
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 37
Process and Service Management (6 of 6)
− Processes are usually created in one of four ways (cont.):
By the bootloader
• When a computer boots, the initial OS process is loaded and started by the
bootloader
• In Windows and Linux, the kernel is loaded, which in turn starts other kernel-related
processes such as the memory manager
By another process
• When a process creates a new process, the creating process is referred to as the
parent and the new process is called the child
By a user
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 39
Memory and I/O Management (2 of 5)
• Access to all devices is done in an orderly
fashion, through a single process called a
device driver
− A device driver is usually a kernel
mode process that accesses hardware
devices directly on behalf of user mode
processes or other kernel mode
processes
Ideally, the operating system loads
a device driver for each I/O device
on the computer
The driver understands how to
communicate with the device and
keeps track of requests to read or
write to the device from multiple
processes
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 40
Memory and I/O Management (3 of 5)
• Interrupts
− Polling is a process where the OS checks each device one after the other in a
round-robin fashion to see if it requires attention
Because of the shortcomings of polling, most systems use interrupts
− An interrupt is a signal, usually generated by an I/O device, that alerts the CPU
and OS that a device needs attention
− Pins on a CPU are usually called interrupt request (IRQ) lines
When the CPU detects the IRQ line, it stops what it is doing, determines the
source of the interrupt, and starts execution of the interrupt service routine
(ISR), also referred to as an interrupt handler
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 41
Memory and I/O Management (4 of 5)
• Interrupts (continued)
− Interrupts are prioritized
Critical system devices such as the system timer have the highest priority
− A software interrupt is called a trap and can be generated by user mode
programs when they need immediate kernel services
− To prevent unnecessary interruptions, ISRs turn off interrupts of equal or lower
priority; this is called interrupt masking
− A certain class of interrupts called non-maskable interrupts (NMI) cannot be
turned off
NMIs are primarily reserved for error conditions such as divide by zero or
memory errors, but they can also be used for system debugging
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 42
Memory and I/O Management (5 of 5)
• Figure 1-13 shows a list of IRQs and the devices or processes using them
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 43
Security and Resource Protection
• Modern general-purpose OSs and RTOSs running on embedded systems provide
controls to prevent unauthorized access to the system and its data
• Malware protection starts with protected memory space
• Authentication and Authorization
− Authentication verifies that an account trying to access a system is valid and
has provided valid credentials (username and password)
− Authorization verifies that an authenticated account has permission to perform
an action on a system
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 44
The Kernel (1 of 3)
• The kernel runs with the highest priority on the system
− When it needs access to the CPU, it gets access immediately
• Scheduling computer processes and managing resources are key tasks of the OS
kernel
• Jobs performed by the kernel can include the following:
− Managing interactions with the CPU
− Managing interrupt handlers and device drivers
− Handling basic computer security
− Managing use of the computer’s memory
− Managing priority levels assigned to programs and computer processes
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 45
The Kernel (2 of 3)
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 46
The Kernel (3 of 3)
• In Windows systems, the name of the kernel file is ntoskrnl.exe.
• In macOS, the kernel is called XNU.
• The actual kernel name in Linux depends on the distribution and release of Linux.
− You can determine information about the kernel by using the uname -sr
command in Linux.
©2021 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. 47