0% found this document useful (0 votes)
4 views55 pages

Chapter One Introduction

The document provides an introduction to Operating Systems (OS), defining their role as intermediaries between users and computer hardware, and outlining their main functions such as process, memory, and I/O management. It discusses the structure of computer systems, including hardware, OS, application programs, and users, and explains the goals of an OS, including efficient resource management and user convenience. Additionally, it covers the booting process, the interaction between CPU and I/O devices, and the management of input/output operations.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views55 pages

Chapter One Introduction

The document provides an introduction to Operating Systems (OS), defining their role as intermediaries between users and computer hardware, and outlining their main functions such as process, memory, and I/O management. It discusses the structure of computer systems, including hardware, OS, application programs, and users, and explains the goals of an OS, including efficient resource management and user convenience. Additionally, it covers the booting process, the interaction between CPU and I/O devices, and the management of input/output operations.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Operating Systems (OS)

Chapter 1: Introduction

Operating System Concepts – 8th Edition, Silberschatz, Galvin and Gagne ©2009
Introduction to Operating Systems
🎯 Objectives
By the end of this chapter, learners should be able to:
Define what an Operating System (OS) is.
Explain the main goals of an operating system.
Understand the components of a computer system.
Describe different functions of an operating system: process
management, memory management, storage management,
I/O management, and security.
Identify different types of operating systems and their
environments.
Understand the role of open-source operating systems.

Operating System Concepts – 8th Edition 1.2 Silberschatz, Galvin and Gagne ©2009
Chapter 1: Operating Systems Introduction

What Operating Systems Do


Computer-System Organization
Computer-System Architecture
Operating-System Structure
Operating-System Operations
Process Management
Memory Management
Storage Management
Protection and Security
Distributed Systems
Special-Purpose Systems
Computing Environments
Open-Source Operating Systems

Operating System Concepts – 8th Edition 1.3 Silberschatz, Galvin and Gagne ©2009
Introduction to Operating Systems

An Operating System (OS) is the most important software


in a computer system. It acts as an intermediary between
the user and the computer hardware.
Without an OS, a computer is just a collection of hardware
devices that cannot work together.
The OS ensures that hardware (CPU, memory, storage,
input/output devices) works smoothly with software
(applications).

Operating System Concepts – 8th Edition 1.4 Silberschatz, Galvin and Gagne ©2009
Operating System Concepts – 8th Edition 1.5 Silberschatz, Galvin and Gagne ©2009
What is an Operating System?
An Operating System (OS) is the most important software in a computer.
It works like a bridge (intermediary) between the user (you) and the computer
hardware (CPU, memory, storage, keyboard, mouse, etc.).
Without an OS, you cannot use a computer effectively because the hardware
cannot understand human commands directly. The OS translates user
instructions into machine language that the hardware can understand, and it
also shows the results back to the user in a simple way (like text, windows, or
graphics).
Example of OS as a Middleman
When you type a document in Microsoft Word and press Save, the application
sends a request to the OS.
The OS then tells the hard disk (hardware) where and how to store the file.
You, as the user, don’t need to know the technical details of how the disk works —
the OS handles that.
This shows how the OS makes computers easy to use.

Operating System Concepts – 8th Edition 1.6 Silberschatz, Galvin and Gagne ©2009
Goals of an Operating System
Execute user programs and solve problems easily
The OS runs the applications you want: Word, Excel, games,
browsers, etc.
It makes sure they run smoothly and provide results to you.
Example: When you open YouTube on a browser, the OS ensures the
browser program gets CPU, memory, and internet resources.
Make the computer system convenient to use
Without an OS, you would need to write complicated instructions
directly to the hardware.
The OS provides a user interface like:
 Command-Line Interface (CLI) → example: MS-DOS, Linux terminal.
 Graphical User Interface (GUI) → example: Windows, ma-cOS, Android.
These make it easy for normal users to work with computers.

Operating System Concepts – 8th Edition 1.7 Silberschatz, Galvin and Gagne ©2009
Use the computer hardware efficiently
The OS manages all the hardware resources (CPU,
memory, storage, printers, network).
It makes sure no single program takes all the resources
and that the system runs fast and fairly.
Example: If you are listening to music, downloading files,
and typing a document at the same time, the OS divides
CPU and memory among them so everything works
together.

Operating System Concepts – 8th Edition 1.8 Silberschatz, Galvin and Gagne ©2009
Computer System Structure
A computer system is not just one part. It is made of different layers or
components that work together to perform tasks.
These components can be divided into four main parts:

1. Hardware
Definition: The physical part of the computer (what you can touch).
Main resources it provides:
CPU (Central Processing Unit): The brain of the computer. It executes instructions.
Memory (RAM): Temporary storage for programs and data while running.
I/O Devices (Input/Output): Devices for user interaction and external
communication.
 Input: keyboard, mouse, scanner.

 Output: monitor, printer, speakers.

Example: When you play a video game, the CPU processes the game’s logic,
the memory holds game data, and the monitor + speakers show and play the game
output.

Operating System Concepts – 8th Edition 1.9 Silberschatz, Galvin and Gagne ©2009
2. Operating System (OS)

Definition: A system software that manages and controls


hardware resources.
Functions:
Coordinates how the CPU, memory, and devices are used.
Prevents conflicts when many applications want the same resource.
Provides a user interface (GUI or CLI) to make computers easy to
use.
Example: If you open Word and Chrome at the same time,
the OS ensures both get CPU and memory fairly.

Operating System Concepts – 8th Edition 1.10 Silberschatz, Galvin and Gagne ©2009
3. Application Programs

Definition: Programs designed to help users solve


problems or perform specific tasks.
Examples of applications:
Word processors → MS Word, Google Docs (typing
documents).
Compilers → Convert programming code into machine code.
Web browsers → Chrome, Firefox (internet access).
Database systems → MySQL, Oracle (data management).
Games → Entertainment software.
Example: When you type in Word, the OS provides
memory and CPU, but the actual writing work is handled
by the Word application program.

Operating System Concepts – 8th Edition 1.11 Silberschatz, Galvin and Gagne ©2009
4. Users

Definition: The people or systems that interact with the


computer.
Types of users:
People → students, teachers, office workers, gamers.
Machines → ATM systems, self-service machines.
Other computers → in a network (servers and clients).
Example: A student using MS Word, or a server in a data
center responding to another computer’s request.

Operating System Concepts – 8th Edition 1.12 Silberschatz, Galvin and Gagne ©2009
Four Components of a Computer System

Operating System Concepts – 8th Edition 1.13 Silberschatz, Galvin and Gagne ©2009
Operating System Definition
The Operating System (OS) is the core software that makes a computer system
usable.
It plays two very important roles:
OS as a Resource Allocator
A computer has many resources:
CPU time (who gets to use the processor and when).
Memory (how much space each program gets).
Storage (files on hard drives, SSDs).
Input/output devices (printer, keyboard, USB, etc.).
The OS decides which program gets which resource, when, and for how long.
The goal is to use resources efficiently (no wastage) and fairly (no single
program takes everything).
Example:
If two students are printing assignments at the same time, the OS manages the
printer so both get their documents printed one after the other (queue system).
Without the OS, one job might take over the printer and block the other.

Operating System Concepts – 8th Edition 1.14 Silberschatz, Galvin and Gagne ©2009
OS as a Control Program 🛑
The OS controls how programs run on the computer.
It prevents errors and stops improper use of the system.
It ensures that:
Programs don’t interfere with each other.
A crashed program does not stop the whole system.
Unauthorized users cannot access the system.
Example:
If you are typing in Word and downloading files at the same
time, the OS ensures Word cannot accidentally overwrite the
download.
If a virus tries to access your private files, the OS security
system can block it.

Operating System Concepts – 8th Edition 1.15 Silberschatz, Galvin and Gagne ©2009
Operating System Definition (Cont)

“The one program running at all times on the computer” is the kernel.
Types of Operating System.

Operating System Concepts – 8th Edition 1.16 Silberschatz, Galvin and Gagne ©2009
Computer Startup
When you turn on a computer or restart it, the system goes through a special
process called booting.
This process prepares the computer and loads the Operating System (OS) into
memory so the computer becomes ready to use.

1. Bootstrap Program
A small program that runs immediately when the computer is powered on.
It is responsible for starting the system.
Stored in a special type of memory called ROM or EPROM (firmware) so it is not
erased when the computer is off.
Example: When you press the power button, the computer does not immediately
show Windows or Linux. Instead, the bootstrap program first runs to wake up the
system.

Operating System Concepts – 8th Edition 1.17 Silberschatz, Galvin and Gagne ©2009
2. Firmware
The bootstrap program is usually part of firmware (software permanently
stored in chips on the motherboard).
Common firmware systems:
BIOS (Basic Input/output System) in older computers.
UEFI (Unified Extensible Firmware Interface) in modern computers.
Example: When you see the logo of Dell, HP, or Lenovo just after starting
the PC, you are looking at firmware in action.

3. Initialization of Hardware
The bootstrap program checks and initializes hardware:
CPU, memory, keyboard, monitor, hard disk.
Performs a POST (Power-On Self Test) to ensure hardware is working
properly.
Example: If RAM or hard disk is faulty, the system beeps or shows an
error before loading the OS.

Operating System Concepts – 8th Edition 1.18 Silberschatz, Galvin and Gagne ©2009
4. Loading the Kernel
After checking hardware, the bootstrap program looks for the Operating
System in storage (hard disk, SSD, USB, or CD/DVD).
It then loads the kernel (the core part of the OS) into main memory
(RAM).
The kernel starts running and takes control of the system.
Example: When Windows starts showing the loading screen, it means
the kernel is now loading into memory.

5. Start of Execution
Once the kernel is loaded, the OS takes full control of the computer.
Other system services and background processes are started.
Finally, the login screen or desktop appears, and the computer is ready
for use.

Operating System Concepts – 8th Edition 1.19 Silberschatz, Galvin and Gagne ©2009
Operating System Concepts – 8th Edition 1.20 Silberschatz, Galvin and Gagne ©2009
Computer System Organization
Computer-system operation
One or more CPUs, device controllers connect through
common bus providing access to shared memory.

Operating System Concepts – 8th Edition 1.21 Silberschatz, Galvin and Gagne ©2009
Computer-System Operation
A computer is made up of many components that must work together.
The two most important parts are:
CPU (Central Processing Unit) – the brain of the computer that executes
instructions.
I/O Devices (Input/output devices) – devices that interact with the outside world
(keyboard, mouse, disk, printer, monitor, USB, etc.).
CPU and I/O Execution
The CPU and I/O devices can run at the same time (concurrently).
While the CPU is busy processing one task, an I/O device can be reading or
writing data in the background.
This allows the computer to work faster and more efficiently.
Example:
When you are typing a document:
The CPU checks spelling in the background.
The keyboard (I/O device) sends your key presses to memory at the same time.
Both activities happen together, not one after the other.

Operating System Concepts – 8th Edition 1.22 Silberschatz, Galvin and Gagne ©2009
Device Controllers and Local Buffers
Every I/O device (keyboard, mouse, printer, hard disk, etc.) has a device
controller.
The device controller manages the details of how the device works.
Each controller has a local buffer (temporary small memory).
Data moves from the device → buffer.
Then from buffer → main memory (RAM).
Or the reverse direction when sending data out.
Example:
When printing a file:
The document is sent from memory to the printer’s buffer.
The printer controller then takes data from the buffer and prints it line by
line.

Operating System Concepts – 8th Edition 1.23 Silberschatz, Galvin and Gagne ©2009
CPU and Memory Interaction
The CPU does not send data directly to the device most of the time.
Instead, the CPU moves data between main memory and the device
controller’s buffer.
The controller then manages the actual transfer with the device.
Example:
When saving a file:
CPU sends the file data from memory → disk controller buffer.
The disk controller writes it to the hard disk.
CPU is now free to continue with other tasks.

Operating System Concepts – 8th Edition 1.24 Silberschatz, Galvin and Gagne ©2009
I/O Structure
Input/output (I/O) operations are very important because they allow the
computer to communicate with the outside world (keyboard, mouse, disk,
printer, monitor, USB, etc.).
The Operating System (OS) manages all I/O activities using system calls,
device controllers, and status tables.

system Call
A system call is a request made by an application program to the
operating system.
It is used when a program needs to perform an operation that requires
hardware interaction (like I/O).
The program cannot directly control the device, so it asks the OS to do it
through a system call.
Example:
When you save a document, Microsoft Word makes a system call to the
OS to write the file to the hard disk.
The OS then manages the disk controller to complete the request.
Operating System Concepts – 8th Edition 1.25 Silberschatz, Galvin and Gagne ©2009
Device-Status Table
The OS keeps a device-status table in memory.
This table contains an entry for each I/O device connected to the
system.
Each entry records:
Device type (keyboard, printer, disk, etc.)
Device address (location in the system)
Device state (busy, idle, error, etc.)
Example:
If the printer is busy printing a file, the OS updates the device-status table
to show the printer = busy.
If another program tries to print, the OS checks the table and makes the
program wait until the printer becomes free.

Operating System Concepts – 8th Edition 1.26 Silberschatz, Galvin and Gagne ©2009
Direct Memory Access Structure

Used for high-speed I/O devices able to transmit


information at close to memory speeds
Device controller transfers blocks of data from buffer
storage directly to main memory without CPU
intervention

Operating System Concepts – 8th Edition 1.27 Silberschatz, Galvin and Gagne ©2009
Storage Structure

Magnetic disks are round storage devices made of


metal or glass with a special magnetic coating.
They save data using magnetism, which allows the
computer to read and write information.
Structure:
Tracks: The surface of the disk is divided into
circles called tracks.
Sectors: Each track is split into smaller parts
called sectors, where data is stored.
Magnetic disks are commonly used to store large
amounts of data in computers.

Operating System Concepts – 8th Edition 1.28 Silberschatz, Galvin and Gagne ©2009
Storage Hierarchy
Storage systems organized in hierarchy
Speed
Cost
Volatility
Caching – copying information into faster storage system;
main memory can be viewed as a last cache for secondary
storage

Operating System Concepts – 8th Edition 1.29 Silberschatz, Galvin and Gagne ©2009
Storage-Device Hierarchy

Operating System Concepts – 8th Edition 1.30 Silberschatz, Galvin and Gagne ©2009
Caching
Important Principle of Data Storage
Overview: This principle helps speed up how computers
access information. It works at different levels: hardware,
operating system, and software.
How It Works:
Copying Data: Information in use is copied from slower
storage (like hard drives) to faster storage (like cache)
temporarily.
Checking Cache First: The computer checks the faster
storage (cache) first to see if the needed information is
already there.
Using Data:
 If the information is in the cache, the computer uses
it directly, which is fast.
 If it's not in the cache, the data is copied from the
slower storage to the cache, and then used from
there.
This process helps make computer operations quicker and
more efficient.
Operating System Concepts – 8 Edition
th 1.31 Silberschatz, Galvin and Gagne ©2009
Computer-System Architecture

1. Computer System Architecture


2. Single Processor Systems: Most computers use
one processor to handle tasks.
3. Multiple Processor Systems: Some systems have
more than one processor, allowing them to handle
more tasks simultaneously.
4. Clustered Processor Systems: These systems
group multiple processors together to work on
problems as a single unit.
5. Growth of Multiprocessor Systems: The use of
multiprocessor systems is increasing due to their
benefits.

Operating System Concepts – 8th Edition 1.32 Silberschatz, Galvin and Gagne ©2009
Advantages of Multiprocessor Systems
Increased Throughput: They can process more tasks in less
time.
Economy of Balance: Resources are used more effectively.
Increased Reliability: If one processor fails, others can
continue working, enhancing system stability.

Types of Multiprocessing
Asymmetric Multiprocessing (AMP): Each processor has a
specific task. One processor controls the system, while others
handle specific functions.
Symmetric Multiprocessing (SMP): All processors share equal
access to memory and I/O devices, allowing them to perform
tasks independently.
Multiprocessor systems are essential for improving performance and
reliability in modern computing.

Operating System Concepts – 8th Edition 1.33 Silberschatz, Galvin and Gagne ©2009
How a Modern Computer Works

Operating System Concepts – 8th Edition 1.34 Silberschatz, Galvin and Gagne ©2009
Asymmetric Multiprocessing

Operating System Concepts – 8th Edition 1.35 Silberschatz, Galvin and Gagne ©2009
Symmetric Multiprocessing Architecture

Operating System Concepts – 8th Edition 1.36 Silberschatz, Galvin and Gagne ©2009
A Dual-Core Design

Operating System Concepts – 8th Edition 1.37 Silberschatz, Galvin and Gagne ©2009
Operating System Structure
Multiprogramming and Timesharing
Multiprogramming: This technique keeps the CPU busy by
organizing jobs (code and data) so that at least one job is ready
to execute at all times. When a job waits (e.g., for I/O), the OS
switches to another job.
Timesharing (Multitasking): An extension of
multiprogramming where the CPU switches between jobs
frequently, allowing users to interact with multiple processes
simultaneously. The goal is to maintain response times under 1
second.
Processes: Each user has at least one program running in
memory (process). CPU scheduling manages which process runs
when multiple jobs are ready.
Memory Management: If processes don’t fit in memory,
swapping moves them in and out. Virtual memory allows
processes to run even if they are not fully loaded in memory.
These techniques improve CPU utilization and enhance user
experience in computing systems.
Operating System Concepts – 8th Edition 1.38 Silberschatz, Galvin and Gagne ©2009
Memory Layout for Multiprogrammed System

Operating System Concepts – 8th Edition 1.39 Silberschatz, Galvin and Gagne ©2009
Process Management
Definition: A process is a program in execution, serving as a unit of
work within the system. It is an active entity that performs tasks.
Resource Requirements: A process needs various resources to
complete its task, including:
CPU: For processing instructions.
Memory: To store data and instructions.
I/O Devices: For input and output operations.
Files: For data storage and retrieval.
Single-Threaded Process: This type of process has one program
counter, which indicates the next instruction to execute.
Multi-Threaded Process: This type has multiple threads, each with its
own program counter, allowing for concurrent execution of multiple
tasks.
Concurrency: Typically, a system runs many processes at the same
time, including user processes and operating system processes, on one
or more CPUs.
Understanding processes is crucial for managing tasks and resources
efficiently in a computing environment.

Operating System Concepts – 8th Edition 1.40 Silberschatz, Galvin and Gagne ©2009
Process Management Activities

The operating system is responsible for the following activities


in connection with process management:
Create and delete processes → The OS starts and stops
programs (user and system).
Suspend and resume processes → It can pause a process
and continue it later.
Manage processes → It makes sure each process gets the
CPU and memory it needs.
Allow communication between processes → It lets
programs share information safely.
Handle deadlocks → It detects and fixes problems when
two processes are stuck waiting for each other.
Operating System Concepts – 8th Edition 1.41 Silberschatz, Galvin and Gagne ©2009
Memory Management
All data in memory before and after processing
All instructions in memory in order to execute
Memory management determines what is in memory when
Improving CPU utilization and computer response to users
Memory management activities
Keeping track of which parts of memory are currently being
used and by whom
Deciding which processes (or parts there of) and data to
move into and out of memory
Allocating and deallocating memory space as needed

Operating System Concepts – 8th Edition 1.42 Silberschatz, Galvin and Gagne ©2009
Storage Management
File-System management
Files usually organized into directories
Access control on most systems to determine who
can access what
OS activities include
Creating and deleting files and directories
Allows to manipulate files and dirs
Mapping files onto secondary storage
Backup files onto stable (non-volatile) storage
media

Operating System Concepts – 8th Edition 1.43 Silberschatz, Galvin and Gagne ©2009
Mass-Storage Management
Usually disks used to store data that does not fit in main
memory or data that must be kept for a “long” period of time
Proper management is of central importance
OS activities
Free-space management
Storage allocation
Disk scheduling
Some storage need not be fast
Relating storage includes optical storage, magnetic tape
Still must be managed

Operating System Concepts – 8th Edition 1.44 Silberschatz, Galvin and Gagne ©2009
Performance of Various Levels of Storage
Movement between levels of storage
hierarchy can be explicit or implicit

Operating System Concepts – 8th Edition 1.45 Silberschatz, Galvin and Gagne ©2009
Migration of Integer A from Disk to Register

Multitasking environments must be careful to use


most recent value, no matter where it is stored in the
storage hierarchy

Multiprocessor environment must provide cache in


hardware such that all CPUs have the most recent
value in their cache.
Operating System Concepts – 8th Edition 1.46 Silberschatz, Galvin and Gagne ©2009
I/O Subsystem
One main job of the operating system is to hide the complex or
unusual parts of hardware from the user.
This makes the computer easier to use.
The I/O subsystem (Input/output system) is responsible for managing
data transfer between devices and memory.
I/O Functions:
Buffering – Storing data temporarily while it’s being moved between
devices.
Example: When downloading a file, the data is stored in a buffer first.
Caching – Storing important data in faster memory to make the system
work faster.
Example: Recently used files may open more quickly because they are in
the cache.

Operating System Concepts – 8th Edition 1.47 Silberschatz, Galvin and Gagne ©2009
Protection and Security
Protection
Protection means controlling who can use or open system resources
like files, memory, and devices.
The operating system decides what each user can do.
Example: Only the correct user can open a private file.
Security
Security means keeping the computer safe from inside and outside
attacks.
Common security threats include:
Denial-of-Service (DoS) – making the system slow or stop.
Worms and viruses – harmful programs.
Identity theft or theft of service – stealing information or access.

Operating System Concepts – 8th Edition 1.48 Silberschatz, Galvin and Gagne ©2009
User Identification
The system uses user IDs to know who the user is.
Each user has:
A name and a number (ID)
This ID is linked to all files and processes of that user.
This helps the OS decide who can access what.
Group Identification
A group ID is used to manage many users together.
It allows setting common access rules for the group.
Privilege Escalation
This allows a user to switch to a higher-level ID with more rights.
Example: An administrator can change settings that normal users
cannot.

Operating System Concepts – 8th Edition 1.49 Silberschatz, Galvin and Gagne ©2009
Computing Environments
In the past, traditional computers were mostly used in
offices.
PCs were connected to a main server or mainframe using
cables or terminals.
People shared one big system through timesharing.
Today, users can connect to the same resources from
different places using portals or remote access.
Home Networks:
Before, there was only one computer at home with a
modem.
Now, many home devices are connected to a network with
firewalls for protection.

Operating System Concepts – 8th Edition 1.50 Silberschatz, Galvin and Gagne ©2009
Computing Environments (Cont)
Client-Server Computing
Many systems now servers, responding to requests
generated by clients
Compute-server provides an interface to client to
request services (i.e. database)
File-server provides interface for clients to store and
retrieve files

Operating System Concepts – 8th Edition 1.51 Silberschatz, Galvin and Gagne ©2009
Peer-to-Peer Computing
Another model of a distributed system is
when computers and devices are
connected using wires (like cables) to share
data and resources.

Operating System Concepts – 8th Edition 1.52 Silberschatz, Galvin and Gagne ©2009
Web-Based Computing

The web is everywhere today.


Many devices can now connect to the
internet.
Old systems like Windows 10 were only for
users (clients).
Now, modern systems like Linux and
Windows 11 can work as both client and
server.

Operating System Concepts – 8th Edition 1.53 Silberschatz, Galvin and Gagne ©2009
Open-Source Operating Systems
Some operating systems are shared as
source code, not just as closed programs.
This is different from systems that use strict
copy protection (DRM).
The idea started with the Free Software
Foundation (FSF).
They use a license called GNU Public
License (GPL), which allows anyone to use
and share the code.
Examples: GNU/Linux, BSD UNIX (part of
Mac OS X), and Sun Solaris.

Operating System Concepts – 8th Edition 1.54 Silberschatz, Galvin and Gagne ©2009
End of Chapter 1

Operating System Concepts – 8th Edition, Silberschatz, Galvin and Gagne ©2009

You might also like