You are on page 1of 33

International University, School of Computer Science

VNU-HCMC & Engineering

IT101- Introduction to Computing

Lect. 3: Operating Systems

Fall 2016

INTERNATIONAL UNIVERSITY, VNU-HCMC 1


Operating Systems
3.1 The History of Operating Systems
3.2 Operating System Architecture
3.3 Coordinating the Machine’s Activities
3.4 Handling Competition Among Processes
3.5 Security

INTERNATIONAL UNIVERSITY, VNU-HCMC 2


3.1 The History of
Operating Systems

INTERNATIONAL UNIVERSITY, VNU-HCMC 3


Functions of Operating
Systems
Oversee operation of computer
Store and retrieve files
Schedule programs for execution
Coordinate the execution of programs

INTERNATIONAL UNIVERSITY, VNU-HCMC 4


History of Operating Systems
 job - an execution of a program
 job queue – jobs are organized in first-in first out (FIFO) fashion

INTERNATIONAL UNIVERSITY, VNU-HCMC 5


Evolution of Shared
Computing
Batch processing
Interactive processing
o Requires real-time processing

Time-sharing/Multitasking
o Implemented by Multiprogramming

Multiprocessor machines

INTERNATIONAL UNIVERSITY, VNU-HCMC 6


Batch processing

Computer operator

INTERNATIONAL UNIVERSITY, VNU-HCMC 7


Interactive processing
Remote user at
a terminal

INTERNATIONAL UNIVERSITY, VNU-HCMC 8


Multiuser, time-sharing OS
Central computer

job
job
job
job

workstation workstation

workstation workstation

INTERNATIONAL UNIVERSITY, VNU-HCMC 9


Operator Sys. Admin.
Overseeing the installation of new hardware & software
Enforcing regulations
o Issuing new accounts
o Establishing mass storage space limits

Resolving problems

INTERNATIONAL UNIVERSITY, VNU-HCMC 10


New problems
Load balancing
o dynamically allocating tasks to various processors

Scaling
o breaking tasks into subtasks compatible with the number of processors

INTERNATIONAL UNIVERSITY, VNU-HCMC 11


3.2 Operating System
Architecture

INTERNATIONAL UNIVERSITY, VNU-HCMC 12


Types of Software
Application software
o Performs specific tasks for users
o Eg. spreadsheets, database systems, desktop publishing systems,
accounting systems, program development software, and games etc.

System software
o Perform common tasks to computer systems in general
o Provides infrastructure for application software
o Consists of operating system and utility software
o Utility software extends the capabilities of operating system
◦ eg. format disks, burn CD/DVDs, compress/decompress data, play multimedia
presentations, handle network communication

Distinction between application s/w and utility s/w can be vague

INTERNATIONAL UNIVERSITY, VNU-HCMC 13


Mac OS Utilities

INTERNATIONAL UNIVERSITY, VNU-HCMC 14


Software classification

INTERNATIONAL UNIVERSITY, VNU-HCMC 15


Operating System
Components
User Interface: Communicates with users
◦ Text based (Shell), e.g. Bourne shell, Bash shell, C shell, and Korn
shell
◦ Graphical user interface (GUI), e.g. GNOME, KDE , Unity, etc.

Kernel: Performs basic required functions


◦ File manager
◦ Device drivers
◦ Memory manager
◦ Scheduler and dispatcher

INTERNATIONAL UNIVERSITY, VNU-HCMC 16


Mac OS Terminal (shell)

INTERNATIONAL UNIVERSITY, VNU-HCMC 17


Linux’s Window Manager
User can select different GUIs
o E.g. GNOME and KDE for Linux

KDE

INTERNATIONAL UNIVERSITY, VNU-HCMC 18


The user interface act as an intermediary
between users and the operating system kernel

INTERNATIONAL UNIVERSITY, VNU-HCMC 19


Kernel
Perform very basic functions
o File manager
o Device drivers
o Memory manger
o Scheduler
o Dispatcher

INTERNATIONAL UNIVERSITY, VNU-HCMC 20


File Manager
Coordinate the uses of mass storage facilities
Directory (or Folder): A user-created bundle of files and other
directories (subdirectories)
Directory Path: A sequence of directories within directories

INTERNATIONAL UNIVERSITY, VNU-HCMC 21


Memory Manager
Allocates space in main memory
May create the illusion that the machine has more memory than
it actually does (virtual memory) by shifting blocks of data
(pages) back and forth between main memory and mass storage

INTERNATIONAL UNIVERSITY, VNU-HCMC 22


Getting it Started
(Bootstrapping = booting)
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 boot
loader

ROM Program
Mass storage counter

OS
Main
memory

INTERNATIONAL UNIVERSITY, VNU-HCMC 23


The booting process

INTERNATIONAL UNIVERSITY, VNU-HCMC 24


3.3 Coordinating the
Machine’s Activities

INTERNATIONAL UNIVERSITY, VNU-HCMC 25


Processes
Scheduler & Dispatcher handle the execution of processes
Process: a running program
Process State: Current status of the running program including
o Program counter
o General purpose registers
o Related portion of main memory

Process
Scheduler table
Dispatcher
Users’ Job1
CPU
programs Job3
Job5
Job2

INTERNATIONAL UNIVERSITY, VNU-HCMC 26


Process Administration
Scheduler: Adds new processes to the process table, removes
completed processes from the process table, and assigns priority
to processes
o ready state
o waiting state

Dispatcher: Controls the allocation of time slices to the


processes in the process table
o The end of a time slice is signaled by an interrupt
o Procedure of changing one process to another is called process
switch or context switch
o interrupt handler handles interrupts

INTERNATIONAL UNIVERSITY, VNU-HCMC 27


Time-sharing between
process A and process B

INTERNATIONAL UNIVERSITY, VNU-HCMC 28


3.4 Handling Competition for
Resources
Semaphore: A “control flag”
o test-and-set instruction

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

INTERNATIONAL UNIVERSITY, VNU-HCMC 29


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

INTERNATIONAL UNIVERSITY, VNU-HCMC 30


A deadlock resulting from competition for
non-shareable railroad intersections

INTERNATIONAL UNIVERSITY, VNU-HCMC 31


Security
Attacks from outside
◦ Problems
◦ Insecure passwords
◦ Sniffing software
◦ Counter measures
◦ Auditing software

INTERNATIONAL UNIVERSITY, VNU-HCMC 32


Security (continued)
Attacks from within
◦ Problem: Unruly processes
◦ Counter measures: Control process activities via privileged modes and
privileged instructions

INTERNATIONAL UNIVERSITY, VNU-HCMC 33

You might also like