0% found this document useful (0 votes)
22 views

C#4 - Operating Systems

Manages the allocation of CPU time among the processes in memory

Uploaded by

Long Nguyễn
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)
22 views

C#4 - Operating Systems

Manages the allocation of CPU time among the processes in memory

Uploaded by

Long Nguyễn
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
You are on page 1/ 60

OPERATING SYSTEMS

Lecture slides are adapted/modified from slides provided by the textbook, Computer
Science: An Overview by J. Glenn Brookshear and Dennis Brylow
publisher Pearson
Contents

 The History of Operating Systems


 Operating System Architecture
 Coordinating the Machine’s Activities
 Handling Competition Among Processes
 Security

2
Functions of Operating Systems

 Oversee operation of computer


 Store and retrieve files
 Schedule programs for execution
 Coordinate the execution of programs

3
Evolution of Shared Computing

 Batch processing
 Interactive processing
 Requires real-time processing
 Time-sharing/Multitasking
 Implemented by Multiprogramming
 Multiprocessor machines
 Load balancing
 Scaling
 Embedded OS
4
5
6
Batch processing

7
Batch processing

8
Interactive processing

9
10
11
Multi tasking processing

P1 Run Wait Run Wait

Wait Run Wait Run Wait


P2

P3 Wait Run Wait Run Wait

P1, P2, P3 Run Run Run Wait Run Run Run Wait

12
Evolution of CPU Utilization

13
Basic functions of operating
systems
 Five basic functions
 Starts the computer
 Manages
applications
 Manages memory
 Handles input and
output device
messages
 Provides a user
interface for
communication
14
Types of Software

 Application software
 Performs specific tasks for users
 System software
 Provides infrastructure for application
software
 Consists of operating system and utility
software

15
Software classification

16
System Software

 Consists of all the programs that enable


the computer and its peripheral devices to
function smoothly
 Divided into two main categories:
 The operating system
 System utilities (utility programs)

17
The Operating System

 Operation system (OS)


 Set of programs that coordinates:
 Interactions of hardware components to each
other
 Interaction between application software and
computer hardware

18
OPERATING SYSTEM
COMPONENTS
Operating System Components
 User Interface: Communicates with users
 Text based (Shell)
 Graphical user interface (GUI)
 Kernel: Performs basic required functions
 File manager
 Device drivers
 Memory manager
 Scheduler and dispatcher

20
User - User interface - Kernel

21
User interface

 Types of user interfaces


 Graphical user interface (GUI)
 Menu-driven user interface
 Command-line user interface

22
Kernel - File Manager

 Directory (or Folder): A user-created


bundle of files and other directories
(subdirectories)
 Directory Path: A sequence of directories
within directories

23
Kernel - File Manager

 Searching for and managing files


 File manager—utility software that organizes
and manages data
 Copy files
 Determine how and where files are stored
 Delete files
 Search utility—enables you to locate files

24
Kernel - Memory Manager

 Allocates space in main memory


 May create the illusion that the machine
has more memory than it actually does
(virtual memory) by playing a “shell
game” in which blocks of data (pages)
are shifted back and forth between main
memory and mass storage

25
Kernel - Memory Manager
 Virtual memory—uses portion of hard disk to extend RAM
 Pages—units of fixed size, contain program instructions and
data
 When RAM is full, copies of pages are temporarily stored in a
swap file, a special hard disk file.
 Transferring files between RAM and the hard disk—paging
 Excessive paging—thrashing

 Adding more RAM—best way to improve computer


performance:
 Paging slows computer.
 Accessing data from hard disk is slower than accessing from
RAM.

26
Kernel - Memory Manager

27
Kernel - Device drivers
 Device drivers—enable communication
between computer and devices
 Interrupts—signals created by input and
output devices
 Notify the OS when actions are taken
 Interrupt handlers (also called interrupt
service routines)—mini-programs that
immediately respond when an interrupt
occurs

28
Kernel - Device drivers
 Interrupt vector table—holds responses from
multiple interrupts in RAM, where the OS
processes them in highest to lowest priority
order
 Interrupt request (IRQ)—actual interrupting of
an event by an interrupt signal

29
GETTING IT STARTED
Bootstrapping

 Boot loader: Program in ROM (example


of firmware)
 Run by the CPU when power is turned on
 Transfers operating system from mass
storage to main memory
 Executes jump to operating system

 Cold boot: Starting computer when it has not


yet been turned on
 Warm boot: Restarting a computer that is
already on
31
The booting process

32
The booting process
The Six Steps of Booting a System

33
The booting process
 Step 1: Activate the BIOS and Setup
Program
 BIOS (Basic Input Output System) instructions
provide the computer with descriptions of the internal
equipment
 BIOS is encoded on ROM (read-only memory)
 Does not control external devices
 Adjustable energy settings
 Setup program
 Includes settings that control computer hardware
 Do not alter—making incorrect changes to a BIOS device
will cause the system not to boot

34
The booting process
 BIOS Settings
 Change the Boot Order
 Load BIOS Setup Defaults
 Remove a BIOS Password
 Create a BIOS Password
 Change the Date and Time
 Change Floppy Drive Settings
 Change Hard Drive Settings
 Change CD/DVD/BD Drive Settings
 View Amount of Memory Installed
 Change the Boot Up NumLock Status
 Enable or Disable the Computer Logo
 Enable or Disable the Quick Power On Self Test (POST)

35
The booting process

 Step 2: Initiate the Power-On Self-Test


 Power-on self-test (POST)—to confirm that
both the computer and its peripheral devices
are working properly

 If the POST fails:


 A beep will sound.
 An error message will appear on the monitor.
 The computer will stop.

36
The booting process

 Step 3: Load the Operating System


 BIOS
 Looks for the operating system
 Loads the kernel into memory—the central part of
the operating system

 The operating system loads the system


configuration information.

37
The booting process

 Step 4: Configure the System


 Operating system
 Checks the registry
 Database that stores information about software and
peripherals choices, for configuration information
 Checks the configuration for drivers
 Utility programs containing instructions for the proper
functioning of peripheral devices.
 Automatically detects plug-and-play (PnP) devices
 Checks for conflicts between devices
 Installs and loads needed drivers

38
The booting process

 Step 5: Load System Utilities


 Antivirus software
 Speaker volume control
 Power management options

39
The booting process

 Step 6: Authenticate a User


 Verifies authorized users
 Enter an authentication/login user name and
password
 Profile—a record of a specific user’s preferences
for the desktop theme, icons, and menu styles
 Account—for multiuser computer systems each
user has an account
 Consists of user name, password, and storage space
 Created by server/computer administrator

40
COORDINATING MACHINE’S
ACTIVITIES
Processes

 Process: The activity of executing a


program
 Process State: Current status of the
activity
 Program counter
 General purpose registers
 Related portion of main memory

42
Process Administration

 Scheduler: Adds new processes to the


process table and removes completed
processes from the process table
 Dispatcher: Controls the allocation of
time slices to the processes in the
process table
 The end of a time slice is signaled by an
interrupt.

43
Time-sharing

44
HANDLING COMPETITION FOR
RESOURCES
Handling Competition for
Resources
 Semaphore: A “control flag”
 Critical Region: A group of instructions
that should be executed by only one
process at a time
 Mutual exclusion: Requirement for
proper implementation of a critical region

46
Deadlock

 Processes block each other from


continuing
 Conditions required for deadlock
1. Competition for non-sharable resources
2. Resources requested on a partial basis
3. An allocated resource can not be forcibly
retrieved

47
A deadlock resulting from competition
for nonshareable railroad intersections

48
Security

 Attacks from outside


 Problems
 Insecure passwords
 password cracker, network sniffer, Trojan horse
login
 Sniffing software
 spyware, sniffing software
 Counter measures
 Auditing software

49
Security

 Attacks from within


 Problem: Unruly processes
 Counter measures: Control process activities
via privileged modes and privileged
instructions

50
QUESTIONS AND ANSWERS

51
Quiz

 Which OS is not designed for


smartphones and PDAs?
A. Android
B. Mac OS
C. Symbian
D. Windows Mobile

52
Quiz

 What utility program reduces a file size by


as much as 80 percent by substituting
short codes for lengthy data patterns?
A. Defragmentation
B. Compression
C. Interrupt
D. Cleanup

53
Quiz

 Which of the following is an OS function?


A. Creating letters
B. Defragmenting a disk
C. Managing memory
D. Writing an e-mail

54
Quiz

 Virtual memory is used when:


A. booting fails.
B. an IRQ conflict occurs.
C. RAM is full.
D. a power-on-self-test fails.

55
Quiz

 Which test makes sure the computer and


its peripherals are working correctly
during the start-up process?
A. BIOS
B. Upgrade
C. ReadyBoost
D. POST

56
Quiz

 Which of following are functions of the


operating system?
A. File management
B. CPU management
C. Task management
D. Booting
E. All of these

57
Quiz

 Which of the following refers are


specialized software programs that allow
input and output devices to communicate
with the rest of the computer system?
A. Multitasking
B. Boot-disks
C. Utility programs
D. Device drivers
E. Service packs
58
Quiz

 Which is the common consumer computer


interface used today?
A. command-line interface
B. graphical user interface
C. menu-driven interface
D. electronic user interface
E. biometric user interface

59
Quiz

 Which type of software can you download


and duplicate without any restrictions
whatsoever and without fear of legal
prosecution?
A. commercial software
B. shareware
C. public-domain software
D. pirated software
E. rentalware
60

You might also like