3. @Sinaiunieg www.su.edu.eg
info@su.edu.eg
Course Outline: Operating Systems (1)
• Types of operating systems. Operating Systems structures; system
components and services, virtual machines.
• Process management : CPU scheduling, Scheduling concepts, performance
criteria, scheduling algorithm.
• Memory organization and management for single user and multi-user
system.
• Secondary storage management, Disk scheduling, virtual memory.
4. @Sinaiunieg www.su.edu.eg
info@su.edu.eg
Text Book
• Andrew Tanenbaum, Modern Operating Systems,
3rd Edition, Prentice Hall
4
• W. Stallings, “Operating Systems: Internals and
Design Principles”, 8thed, Pearson, 2015.
5. Objectives
• To describe the services an operating system provides to users, processes, and
other systems
• To discuss the various ways of structuring an operating system
• To explain how operating systems are installed and customized and how they boot
• identify the separate components of a process and illustrate how they are
represented and scheduled in an operating system.
• Identify the basic components of a thread, and contrast threads and processes.
• Describe the major benefits and significant challenges of designing multithreaded
processes.
5
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
6. Objectives
• Describe various CPU scheduling algorithms.
• Assess CPU scheduling algorithms based on scheduling criteria.
• Explain the difference between a logical and a physical address and the role of the
memory management unit (MMU) in translating addresses.
• Apply first-, best-, and worst-fit strategies for allocating memory contiguously.
• Explain the distinction between internal and external fragmentation. • Translate
logical to physical addresses in a paging system that includes a translation look-
aside buffer (TLB).
• Describe hierarchical paging, hashed paging, and inverted page tables.
• Define virtual memory and describe its benefits.
• Illustrate how pages are loaded into memory using demand paging.
• Apply the FIFO, optimal, and LRU page-replacement algorithms.
6
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
7. Objectives
• STORAGE MANAGEMENT:
• Describe the physical structures of various secondary storage devices and the effect
of a device’s structure on its uses.
• Explain the performance characteristics of mass-storage devices.
• Evaluate I/O scheduling algorithms.
7
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
8. INDEX
Overview of Operating Systems:
• Describe the basic organization of computer systems and operating systems.
• Explore varied Types of Operating System
• Describe the services an operating system provides to users, processes, and other systems.
• Discuss Operating-System Structures
• Describe the major operating system components
@Sinaiunieg
info@su.edu.eg
www.su.edu.eg
8
Lecture #1
9. Introduction to Operating Systems
Learning Outcomes
• understand what is an operating system and the role it plays
• understanding of the structure of operating systems, applications, and
the relationship between them.
• Some knowledge of the services provided by operating systems.
• Introduction to some details of major OS concepts.
9
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
10. Introduction to Operating Systems
A modern computer consists of:
One or more processors(CPU)
Memory /storage:
(Main memory, Disks,……..)
Various input/output devices
(Printers, keyboard, monitor,…...)
•Managing all these varied components requires a layer of
software – the Operating System (OS)
10
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
11. Introduction to Operating Systems
• An Operating System is a program that acts as an intermediary/
interface between a user of a computer and the computer hardware.
• OS goals:
Control/execute user/application programs.
Make the computer system convenient to use.
Ease the solving of user problems.
Use the computer hardware in an efficient manner
11
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
12. Computer System Components
Computer system can be divided into four components:
• Hardware – provides basic computing resources
CPU, memory, I/O devices
• Operating system
Controls and coordinates use of hardware among various
applications and users
• Application programs – define the ways in which the system
resources are used to solve the computing problems of the users.
Word processors, compilers, web browsers, database systems,
video games
• Users
People, machines, other computers
12
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
13. Hierarchical view of computer system
13
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
• A computer system can be
divided roughly into four
components:
• the hardware,
• the operating system,
• the application programs,
• and a user
14. Types of software (programs)
• user / application programs
– programs used by the users to perform a task
-such as word processors, spreadsheets, compilers, and web
browsers,…………….
• system programs
– an interface between user and computer
-such as Windows, Linux, FreeBSD, or OS X,………………
• driver programs
– communicate I/O devices with computer
- such as video cards, keyboards, monitors, mice, disc drives, etc.
14
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
15. Differences between System Software and Application Software
15
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
System software is meant to manage the system
resources. It serves as the platform to run application
software.
Application software helps perform a specific set of
functions for which they have been designed.
System software is developed in a low-level language
(assembly language for example)
Application software is developed in a high-level
language such as Java, C++, .net and VB.
System software automatically starts running once the
system is turned on and stops when the system is shut
down.
Application software runs as and when the user
requests it.
A system cannot even start without system software Application software is user specific and it is not
needed to run the system on the whole.
System software is capable with a general purpose. Application software carries a specific purpose.
A typical example for a system software is Windows
Operating System
Some characteristic examples for application software
is MS Office, Photoshop and CorelDraw
16. Utility Software
• Utility program is a system software that executes a specific task
• Operating systems such as Windows, macOS and Linux come with their own
set of utility programs to maintain and execute different utility functions such
as formatting, compressing, scanning, exploring and much more.
• A utility is a program that performs a task that is not typically handled by
the operating system.
• Some utilities enhance the operating system's functionality.
• Some of the major categories of utilities include:
File defragmentation
Data compression
Backup
Antivirus
Screen savers
16
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
17. What is an Operating System?
• An operating system (OS) is:
a software layer to abstract away and manage details of
hardware resources
a set of utilities to simplify application development and
execution
• It is an extended machine
Hides the messy details which must be performed
Presents the user with an easy to use machine
• It is a resource manager
17
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
18. @Sinaiunieg www.su.edu.eg
info@su.edu.eg
What is an Operating System?
• An operating system is a collection of system programs (routines), that are
executed as needed to perform functions.
• Used to control the sharing and interaction among various computer units as
they run application programs
• The OS routines perform the tasks required to assign computer resource to
individual application programs
These tasks include receiving and interpreting user commands, running
application programs, managing the storage/retrieval of files in
memory/storage devices, and controlling I/O units to receive input
information and produce output results.
• OS is thus responsible for the coordination of all activities in a computing
system
18
19. @Sinaiunieg www.su.edu.eg
info@su.edu.eg
Types of Operating Systems
1. Simple Batch Operating System
2. Multiprogramming batch Operating System
3. Time-sharing Operating System
4. Multiprocessor Operating System
5. Distributed Operating System
6. Network Operating System
7. Real-time Operating System
8. Mobile Operating System
19
20. Types of Operating Systems
1. Simple Batch operating system
• there is no direct communication between the
user and the computer.
• the user submits a job to the O.S,
• the O.S creates a batch of the jobs on an input
device.
• a special program monitors and manages each
program in a batch.
• Example: Bank Statements, Payroll system, etc.
20
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
21. @Sinaiunieg www.su.edu.eg
info@su.edu.eg
Types of Operating Systems
2. Multiprogramming batch Operating System
users run more than one program at a time as
well.
Multiprogramming increases CPU utilization, as
well as keeping users satisfied, by organizing
programs so that the CPU always has one to
execute.
In a multiprogrammed system, a program in
execution is termed a process.
21
22. @Sinaiunieg www.su.edu.eg
info@su.edu.eg
Types of Operating Systems
3. Time-sharing Operating System
• The Time-sharing systems are also called Multitasking systems.
• assign some time to each job so that all the jobs work efficiently and smoothly.
• The task may be from a single user as well as multiple users.
• The time taken by each job to execute the job is known as quantum.
• After the interval of time is over, the operating system moves to the next task.
• Time-sharing is sharing the processor’s time with multiple users simultaneously.
• The major difference between Time-sharing operating system and
Multiprogramming batch operating system is that the time-sharing operating
system aims to minimize the response time, whereas the Multiprogramming
batch operating system is to increase the use of the processor.
22
23. @Sinaiunieg www.su.edu.eg
info@su.edu.eg
Types of Operating Systems
4. Multiprocessor Operating System
• means the use of two or more processors within a
single computer system. These multiple processors
are in close communication and share the
memory, computer bus, and other peripheral
devices.
• These systems are known as tightly coupled
systems. It offers high speed and computing
power.
• In Multiprocessor operating system, all the
processors work by using a single operating
system.
23
Windows and Linux, run on multiprocessors.
24. @Sinaiunieg www.su.edu.eg
info@su.edu.eg
Types of Operating Systems
5. Distributed Operating System
• distributed operating system
• multiple central processors are used to serve
multiple real-time applications and multiple
users.
• Processor interaction with each other takes
place via communication lines like telephone
lines, high-speed buses, etc.
• The processors can be different in function
and size.
24
There are two types of Operating System:
1. Client-server Systems.
2. Peer-to-Peer system.
25. @Sinaiunieg www.su.edu.eg
info@su.edu.eg
Types of Operating Systems
6. Network Operating System
• called tightly coupled systems.
• is a type of operating system which is created to
help personal computer, workstations.
• are operated on a server and offer the facility of
security, users, applications, data management,
and other networking related functions.
• Its objective is to permit file sharing and printer
access among various computers in a network, i.e.,
local area network (LAN), Private network, etc.
25
Example of Operating System:
Unix, Linux, Novell NetWare, BSD,
Microsoft Windows Server 2008.
26. @Sinaiunieg www.su.edu.eg
info@su.edu.eg
Types of Operating Systems
7. Real-Time Operating System
• in this, time concept is the most crucial part.
• gives the response very fast and quick.
• is used when a large number of events are processed in a short interval of time.
• It is based on clock interrupts.
• the process is executed on the basis of priority.
• The high priority process always executes first.
• When a high priority process enters into the system, the low priority process
preempts to serve a high priority process.
• In this way, resources are used effectively without time-wasting.
26
Types of Real-Time Operating System
1.Hard Real-time
2.Soft Real-time
3.Firm Real-time
Example: – Aircraft systems, Medical critical care System, etc.
Online Transaction System - Multimedia Applications.
27. @Sinaiunieg www.su.edu.eg
info@su.edu.eg
Types of Operating Systems
8- Mobile Operating System
• mainly designed to power smartphones, wearables devices,
and tablets.
• Example: – Android, BlackBerry, Watch OS.
• iOS is designed for the iPhone smartphone and iPad tablet computer.
27
28. Types of Operating Systems
• Mainframe operating systems: perform three kinds of services: batch, transaction
processing, and timesharing
• Server operating systems: serve multiple users at once over a network. Typical server
operating systems are Solaris, FreeBSD, Linux and Windows Server 201x.
• Personal computer operating systems : support multiprogramming, Common
examples are Linux, FreeBSD, Windows 7, Windows 8, and Apple’s OS X
• Embedded operating systems: Typical examples are microwave ovens, TV sets, cars,
DVD recorders, traditional phones, and MP3 players.
Ex: Embedded Linux, QNX and VxWorks are popular in this domain
• Smart card operating systems: The smallest operating systems run on smart cards,
which are credit-card-sized devices containing a CPU chip
• Etc..
• Some operating systems can fit into more than one category
28
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
29. What Operating Systems Do
• Explore operating systems from two viewpoints:
1.User view
Users want convenience, ease of use
Don't care about resource utilization
Users of dedicate systems such as workstations have dedicated resources
but frequently use shared resources from servers
Some computers have little or no user interface, such as embedded
computers in devices and automobiles
29
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
30. @Sinaiunieg www.su.edu.eg
info@su.edu.eg
2- System view.
1. Resource Manager – manages and allocates resources.
2. Control program – controls the execution of user programs
and operations of I/O devices.
3. Command Executer – Provides an environment for running
user commands.
• Modern view: the Operating System as a Virtual Machine.
30
What Operating Systems Do
31. Modern view: Virtual Machine
• Operating System as a Virtual Machine:
• An interface between the user and hardware
that hides the details of the hardware.
• Constructs higher-level (virtual) resources
out of lower-level (physical) resources (e.g.,
files).
• virtual machine = software enhancement =
extended machine = abstract machine
31
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
32. Functions of operating System
• Process Management
• Memory Management
• File Management
• I/O Device Management
• Secondary storage Management
• Security and protection
• Networking
32
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
33. @Sinaiunieg www.su.edu.eg
info@su.edu.eg
Functions of operating System
• Functions of process management in OS:
1. Process creation and deletion.
2. Suspension and resumption.
3. Synchronization process
4. Communication process
• Functions of Memory management in OS:
1. It helps you to keep track of main memory.
2. Determine what part of it are in use by whom, what part is not in use.
3. In a multiprogramming system, the OS takes a decision about which process will get
Memory and how much.
4. Allocates the memory when a process requests
5. It also de-allocates the Memory when a process no longer requires or has been
terminated.
33
34. @Sinaiunieg www.su.edu.eg
info@su.edu.eg
Functions of operating System
• Function of file management in OS:
1. File and directory creation and deletion.
2. For manipulating files and directories. storage,
retrieval, sharing, naming and files protection
3. Mapping files onto secondary storage.
4. Backup files on stable storage media.
• Functions of I/O management in OS:
1. It offers buffer caching system
2. It provides general device driver code
3. It provides drivers for particular hardware devices.
34
35. @Sinaiunieg www.su.edu.eg
info@su.edu.eg
Functions of operating System
• Functions of Secondary storage management in OS:
1. Storage allocation
2. Free space management
3. Disk scheduling
• Security
the operating system prevents the data and information from
unauthorized access and threats.
• Networking: – A distributed system means a bunch of processors
which do not share memory hardware devices and clock. With the
help of the network, the processor communicates with each other.
35
36. Modes of operation:
1. User mode: The user interface program, shell or
GUI, is the lowest level of user-mode software, and
allows the user to start other programs, such as a
Web browser, email reader, or music player
2. kernel mode (also called supervisor mode, system
mode, or privileged mode).
It also acts as a bridge between the software and
hardware of the computer.
It is one of the first program which is loaded on start-up
after the bootloader.
The kernel is the deepest part of the operating system.
36
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
37. Difference Between Kernel and Operating System
• Kernel is the core of the operating system
• An operating system is unable to run without the kernel
• Kernel functions: memory management, process
management, task management, disk management.
• In addition to the responsibilities of Kernel, Operating
System is responsible for protection and security of the
computer.
• Operating System acts as an interface between user and
system hardware
• Kernel is an interface between software and hardware of
the computer.
37
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
38. @Sinaiunieg www.su.edu.eg
info@su.edu.eg
Kernel
Features of Kernel
• Inter-process communication
• Context switching
• Low-level scheduling of processes
• Process synchronization
Types of Kernel
• Microkernel
• Monolithic kernel
• Nano kernel
• Exo kernel
• Hybrid Kernel
38
39. Is Linux an Operating System or a Kernel?
• Linux, in its nature, is not an operating system; it’s a Kernel.
• The Kernel is part of the operating system – And the most crucial.
• For it to be an OS, it is supplied with GNU software and other additions
giving us the name GNU/Linux.
• GNU is an operating system and Linux is a kernel.
• Linux was adopted as the main Kernel for the GNU Operating System,
meant to be a free and open source.
• Since then, Linux has gained popularity and deployed in different
computing systems such as mobile devices (Android), PCs, Servers,
embedded devices, supercomputers, and mainframes.
• GNU/Linux is used by millions, though many call it “Linux” by mistake.
39
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
40. 1- Command-line interface (CUI), or command interpreter
2- Graphical User Interface (GUI)
3- Touch-Screen Interface
40
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
User and Operating system Interface
41. User and Operating system Interface
• When a user gave Command
to perform an operation, then
the command will first serve
to the Shell part.
• The Shell is also known as an
Interpreter which is used to
translate program
in assembly language
to machine language
• and then the made request is
transferred to the Kernel.
41
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
1- Command-line interface, or command interpreter
42. The Shell
• ”Your interface to operating system is called shell”.
• Shells provide a way for you to communicate with the operating system.
• This communication is carried out either interactively (input from the
keyboard is acted upon immediately) or as a shell script.
• A shell script is a sequence of shell and operating system command that
is stored in a file.
• What are the different types of shells available?
most popular commercial shells are:-
1. Korn shell( UNIX shell )
2. Bourne Shell
3. C shell (UNIX shell)
4. POSIX shell
42
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
UNIX Shell and Utilities
43. 43
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
2- User Operating System Interface – GUI
• User-friendly desktop metaphor interface
• Usually mouse, keyboard, and monitor
• Icons repesent files, programs, actions, etc
• Many systems now include both CLI and GUI interfaces
• Microsoft Windows is GUI with CLI “command” shell
• Apple Mac OS X is “Aqua” GUI interface with UNIX kernel
• underneath and shells available
• Unix and Linux have CLI with optional GUI interfaces
(CDE,KDE, GNOME)
User and Operating system Interface
44. 3- Touch-Screen Interface
• Because a either a command-line interface or a mouse-and-
keyboard system is impractical for most mobile systems,
smartphones and handheld tablet computers typically use a
touch-screen interface.
• Here, users interact by making gestures on the touch screen—
for example, pressing and swiping fingers across the screen.
Although earlier smartphones included a physical keyboard,
most smartphones and tablets now simulate a keyboard on
the touch screen.
44
@Sinaiunieg www.su.edu.eg
info@su.edu.eg
45. THANK YOU
Office room: N-2-44-1
Lecturer of Computer Science
For any questions feel free
to contact me by mail
shahira.khairy@su.edu.eg
45