You are on page 1of 34

College of Computers & Information Technology

Dep. of Information Technology

Operating
Systems
Lecture 1: Introduction

2019/2020 Modified by: Dr. Rasha Bin-Thalab


Course Syllabus
2

 Introduction to OS (concepts &


structures)
 Process management
 Process
 CPU scheduling
 Process synchronization
 Deadlocks
 Memory management
 Main memory and Virtual memory
 Files management- File system
Course references
3

1. Silberschatz A., Galvin P., and Gagne G.,


2018, Operating Systems Concepts,
10thEdition, Wiley.

2. Tanenbaum, A.S. and Bos, H., 2014,


Modern Operating Systems, 4rdEdition,
Pearson

3. Stalling, W., 2014, Operating Systems:


Internal and Design Principles, 8th
Lecture Out Lines
4

 What is an Operating System and what it


Does?
 Computer-System Organization
 Operations
 Interrupts
 Services
 System calls
 Operating-System Structure
 Operating-System Evolution
What is an Operating
5
System?
 A program that acts as an intermediary
between a user of a computer and the
computer hardware
 Operating system goals:

 Execute user programs and make solving user


problems easier
 Make the computer system convenient to use
 Use the computer hardware in an efficient
manner
?What does OS do
6

 OS is a resource allocator
 Manages all resources
 Decides between conflicting requests for
efficient and fair resource use
 OS is a control program
 Controls execution of programs to prevent
errors and improper use of the computer
Computer Startup
7

 bootstrap program is loaded at power-up


or reboot
 Typically stored in ROM or EPROM, generally
known as firmware
 Initializes all aspects of system
 Loads operating system kernel and starts
execution
Computer system organization
8

 One or more
CPUs, device Outside
controllers world
connect through
common bus
providing access
to shared Video Hard drive USB Network
controller controller controller controller
memory
 Concurrent
execution of
CPUs and CPU
devices Computer internals
competing for (inside the “box”)
Memory
memory cycles
Computer system operation
9

 I/O devices and the CPU can execute


concurrently
 Each device controller is in charge of a

particular device type


 Each device controller has a local buffer

 CPU moves data from/to main memory

to/from local buffers


 I/O is from the device to local buffer of

controller

Common functions of interrupt
10

 Interrupt transfers control to the interrupt


service routine generally, through the interrupt
vector, which contains the addresses of all the
service routines
 Interrupt architecture must save the address of

the interrupted instruction


 A trap or exception is a software-generated

interrupt caused either by an error or a user


request
 An operating system is interrupt driven
Interrupt handling
11

 The operating system preserves the state


of the CPU by storing registers and the
program counter
 Determines which type of interrupt has

occurred:
 Polling: poll (send a signal out to) each device
to determine which one made the request.
 vectored interrupt system: an interrupt signal

that includes the identity of the device sending


the interrupt signal
04/07/2020
Operating systems services
12

.
.
. .
.
. . .

.
.
Documents Phrase Grammar Extraction SOM
Phrase Feature Vectors
System Calls

 Programming interface to the services provided by


the OS
 Typically written in a high-level language (C or C+

+)
 Mostly accessed by programs via a high-level

Application Programming Interface (API)


rather than direct system call use
 Three most common APIs are Win32 API for

Windows, POSIX API for POSIX-based systems


(including virtually all versions of UNIX, Linux, and
Mac OS X), and Java API for the Java virtual
API – System Call – OS Relationship
System Call Parameter Passing

 Three general methods used to pass parameters to


the OS
1. Simplest: pass the parameters in registers
 In some cases, may be more parameters than registers
2. Parameters stored in a block, or table, in memory, and
address of block passed as a parameter in a register
 This approach taken by Linux and Solaris
3. Parameters placed, or pushed, onto the stack by the
program and popped off the stack by the operating
system
 Block and stack methods do not limit the number or
length of parameters being passed
Parameter Passing via Table
Types of System Calls

 1) Process control
 create process, terminate process
 end, abort
 load, execute
 get process attributes, set process attributes
 wait for time
 wait event, signal event
 allocate and free memory
 Dump memory if error
 Debugger for determining bugs, single step
execution
 Locks for managing access to shared data between
Types of System Calls

 2) File management
 create file, delete file
 open, close file
 read, write, reposition
 get and set file attributes
 3) Device management
 request device, release device
 read, write, reposition
 get device attributes, set device attributes
 logically attach or detach devices
Types of System Calls (Cont.)

 4) Information maintenance
 get time or date, set time or date
 get system data, set system data
 get and set process, file, or device attributes
 5) Communications
 create, delete communication connection
 send, receive messages if message passing model to host
name or process name
 From client to server
 Shared-memory model create and gain access to memory
regions
 transfer status information
Types of System Calls (Cont.)

 6) Protection
 Control access to resources
 Get and set permissions
 Allow and deny user access
Examples of Windows and Unix System
Calls
21
Operating System Structure
22

 General-purpose OS is very large program


 Various ways to structure ones

1. Simple structure (Monolithic)


2. Layered – an abstraction
3. Microkernel –Mach
4. Modules Performanc
e
Security Reliability Scalability

Monolithic High L L L
Layered M L L M
Microkernel M M H M
Modules L H H H
Simple Structure (Monolithic) -- MS-
23
DOS
 The entire operating system runs as a single program in
kernel mode. The operating system is written as a
collection of procedures, linked together into a single large
executable binary program.
 This organization suggests a basic structure for the
operating system:
A main program that invokes the requested service procedure.

 A set of service procedures that

.carry out the system calls


 A set of utility procedures that

.help the service procedures


Layered systems
24

 Organize the operating


system as a hierarchy of
layers, each one
constructed upon the one
below it.
 Instead of layers, MULTICS
was described as having a
series of concentric rings,
with the inner ones being
more privileged than the
outer ones The advantage
Microkernel System Structure – 1
25

 Moves as much from the kernel into user space


 Mach example of microkernel
 Communication takes place between user modules using
message passing
 Benefits:
 Easier to extend a microkernel
 Easier to port the operating system to new architectures
 More reliable (less code is running in kernel mode)
 More secure
 Detriments:
 Performance overhead of user space to kernel space
Microkernel System Structure - 2
26

Application File Device user


Program System Driver mode

messages messages

Interprocess memory CPU kernel


Communication managment scheduling mode

microkernel

hardware
Modules
27

 Many modern operating systems implement


loadable kernel modules
 Uses object-oriented approach
 Each core component is separate
 Each talks to the others over known interfaces
 Each is loadable as needed within the kernel
 Overall, similar to layers but with more flexible
 Linux, Solaris, etc
Hybrid Systems
28

 Most modern operating systems are actually not one pure


model
 Hybrid combines multiple approaches to address
performance, security, usability needs
 Linux and Solaris kernels in kernel address space, so

monolithic, plus modular for dynamic loading of


functionality
 Windows mostly monolithic, plus microkernel for different

subsystem personalities
Evolution of Operating Systems -
1
29

 First generation: 1945 – 1955


 Vacuum tubes
 Plug boards
 Second generation: 1955 – 1965
 Transistors
 Batch systems
 Third generation: 1965 – 1980
 Integrated circuits
 Multiprogramming
 Spooling (Simultaneous Peripheral Operation On
Line)
Evolution of Operating Systems -
2
30

 Fourth generation: 1980 – present


 Large scale integration and Very large scale integration

(LSI & VLSI)


 Personal computers
 OS revolution

 Microsoft DOS
 IBM PC + DOS/BASIC by Bill Gates and Paterson
 80386 and 80 486 + MS/DOS - Command line based
 Engelbart invented the Graphical User Interface, complete
with windows
 Windows = MS DOS + GUI
Evolution of Operating Systems -
3
31

 Fourth generation: 1980 – present (cont.)


 UNIX
 Based on MULTICS
 Open source
 Greatest on enterprise and network servers
 FreeBSD, Solaris, Redhat
 Network operating system
 The users are aware of the existence of multiple computers
and can log in to remote machines and copy files from one
machine to another.
 Each machine runs its own local operating system and has
Evolution of Operating Systems -
4
32

 Fourth generation: 1980 – present (cont.)


Distributed operating system
 One that appears to its users as a traditional uniprocessor
system, even though it is actually composed of multiple
processors.
 The users should not be aware of where their programs are
being run or where their files are located; that should all be
handled automatically and efficiently by the operating
system.
 Example: allow applications to run on several processors at
the same time, thus requiring more complex processor
scheduling algorithms in order to optimize the amount of
Evolution of Operating Systems -5
33

 Fifth generation 1990 – present


 Mobile computers
 Nokia N9000 Combining telephony and computing
device PDA in a phone –like device
 Smartphone – Ericson
 Symbian OS
 RIM’s Blackberry OS (2002)
 Apple’s iOS for iPhone – 2007
 Google’s Android is the dominant OS – 2008
 Nokia ditched Symbian into windows phone - 2011
Evolution of Operating Systems -6
34
 Next generation ???

Cloud computing
Volume, Velocity, and Variety (VVV) of Big
Data
Systems connected by high-speed networks?
Wide area resource management?
 Withthe onset of new devices like wearables, which
includes, Smart Watches, Smart Glasses, VR gears etc,

You might also like