0% found this document useful (0 votes)
9 views67 pages

Introduction to Operating Systems Overview

The document provides an overview of operating systems, defining their roles as intermediaries between users and hardware, resource allocators, and control programs. It discusses the structure of computer systems, the history of operating systems, and various architectures including monolithic, layered, virtual machines, exokernels, and microkernels. Key functions of operating systems such as process management, memory management, and device management are also highlighted.

Uploaded by

2950molta
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)
9 views67 pages

Introduction to Operating Systems Overview

The document provides an overview of operating systems, defining their roles as intermediaries between users and hardware, resource allocators, and control programs. It discusses the structure of computer systems, the history of operating systems, and various architectures including monolithic, layered, virtual machines, exokernels, and microkernels. Key functions of operating systems such as process management, memory management, and device management are also highlighted.

Uploaded by

2950molta
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

Chapter One:
Introduction to Operating System
and its Structures

College of Computing
Department of Department of Computer
Science
College of Computing
Department of Department of Computer
Science
What is an Operating 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.
• Three major objectives of operating system are:
– To hide details of hardware by creating abstraction.
– To allocate resources to processes/manage resources.
– To provide a pleasant and effective user interface.
College of Computing, Department of Computer Science
3
Tekalign T.(MSc., Assit Prof)
Operating System Definition
▪ 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
▪ Basic function of the OS are :
– Process management – Security management
– Memory management – User interfacing
– Device management – Coordination of communication
– File management on the network.

College of Computing, Department of Computer Science


4
Tekalign T.(MSc., Assit Prof)
Operating System Definition (Cont.)
▪ Operating system is the first layer of software loaded in
to the computer working memory.
▪ It provides a software platform on top of which other
program can run
▪ “The one program running at all times on the
computer” is the kernel.
▪ Everything else is either a system program (ships with
the operating system) or an application program.

College of Computing, Department of Computer Science


5
Tekalign T.(MSc., Assit Prof)
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

College of Computing, Department of Computer Science


6
Tekalign T.(MSc., Assit Prof)
Four Components of a Computer System

College of Computing, Department of Computer Science


7
Tekalign T.(MSc., Assit Prof)
Operating system History
(Assignment(#Q.1))
• First generation: 1945 – 1955
– Vacuum tubes
– Plug boards
• Second generation: 1955 – 1965
– Transistors
– Batch systems
Briefly Discuss
• Third generation: 1965 – 1980 history of
– Integrated circuits Operating
– Multiprogramming
• Fourth generation: 1980 – present System.
– Large scale integration
– Personal computers
• Next generation: ???
– Systems connected by high-speed
networks?
– Wide area resource management?
College of Computing, Department of Computer Science
8
Tekalign T.(MSc., Assit Prof)
Computer Startup
• 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

College of Computing, Department of Computer Science


9
Tekalign T.(MSc., Assit Prof)
Computer System Organization
▪ Computer-system operation
– One or more CPUs, device controllers connect through
common bus providing access to shared memory
– Concurrent execution of CPUs and devices competing for
memory cycles.

College of Computing, Department of Computer Science


10
Tekalign T.(MSc., Assit Prof)
Computer-System Operation
▪ 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.
▪ Device controller informs CPU that it has finished its
operation by causing an interrupt.

College of Computing, Department of Computer Science


11
Tekalign T.(MSc., Assit Prof)
Common Functions of Interrupts
▪ 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.
▪ Incoming interrupts are disabled while another
interrupt is being processed to prevent a lost
interrupt.
▪ A trap is a software-generated interrupt caused
either by an error or a user request.
▪ An operating system is interrupt driven.
College of Computing, Department of Computer Science
12
Tekalign T.(MSc., Assit Prof)
I/O Structure
▪ After I/O starts, control returns to user program only upon I/O
completion.
– Wait instruction idles the CPU until the next interrupt
– Wait loop (contention for memory access).
– At most one I/O request is outstanding at a time, no simultaneous
I/O processing.
▪ After I/O starts, control returns to user program without
waiting for I/O completion.
– System call – request to the operating system to allow user to wait
for I/O completion.
– Device-status table contains entry for each I/O device indicating its
type, address, and state.
– Operating system indexes into I/O device table to determine device
status and to modify table entry to include interrupt.
College of Computing, Department of Computer Science
13
Tekalign T.(MSc., Assit Prof)
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.
▪ Only one interrupt is generated per block, rather than the
one interrupt per byte.
▪ Pros:
▪ Free up CPU
▪ Use CPU instead of DMA if:
▪ Device speed is fast
▪ CPU has nothing to do
▪ Wants to save Money(by getting ride of DMA)
College of Computing, Department of Computer Science
14
Tekalign T.(MSc., Assit Prof)
College of Computing, Department of Computer Science
15
Tekalign T.(MSc., Assit Prof)
Storage Structure
▪ Cache Memory-contain copy of main memory.
▪ Use of high speed memory to hold recently-accessing data.
▪ Main memory – only large storage media that the CPU
can access directly.
▪ Secondary storage – extension of main memory that
provides large nonvolatile storage capacity.
▪ Magnetic disks – rigid metal or glass platters covered
with magnetic recording material
– Disk surface is logically divided into tracks, which are
subdivided into sectors.
– The disk controller determines the logical interaction
between the device and the computer.
College of Computing, Department of Computer Science
16
Tekalign T.(MSc., Assit Prof)
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.

College of Computing, Department of Computer Science


17
Tekalign T.(MSc., Assit Prof)
Storage-Device Hierarchy

Less
High
Cost
Cost
and slow
and fast

College of Computing, Department of Computer Science


18
Tekalign T.(MSc., Assit Prof)
Caching: Issue of Coherency and consistency
▪ Information is copied from secondary storage to cache
memory on a temporary basis.
▪ Use of high-speed memory to hold recently-accessed data.
▪ Data transfer from cache to CPU is an hardware function:
No OS is involved.
▪ Transfer of data from disk to OS is controlled by OS.
▪ Cache coherency is the discipline that ensures that changes
in the values of shared operands are protected throughout
the system in a timely fashion.
– Requires a cache management policy.

College of Computing, Department of Computer Science


19
Tekalign T.(MSc., Assit Prof)
…con’t
• Caching introduces another level in storage hierarchy. This
requires data that is simultaneously stored in more than one
level to be consistent.
– Suppose integer A located in file B is to be incremented by
1 and B resides on disk.
– OS issues an I/O operation to copy disk block
– Copy A to cache.
– So the copy of A appears at several places.
– In multi-programming environment, several programs may
access A
– In multi processor environment it is still more complex.

College of Computing, Department of Computer Science


20
Tekalign T.(MSc., Assit Prof)
Migration of A From Disk to
Register

College of Computing, Department of Computer Science


21
Tekalign T.(MSc., Assit Prof)
Operating System Structure
• Multiprogramming needed for efficiency
– Is the mechanism of partitioning memory into a number of pieces with
each job in each partition
– Single user cannot keep CPU and I/O devices busy at all times
– Multiprogramming organizes jobs (code and data) so CPU always has one
to execute
– A subset of total jobs in system is kept in memory
– One job selected and run via job scheduling
– When it has to wait (for I/O for example), OS switches to another job
• Timesharing (multitasking) is logical extension in which CPU switches jobs so
frequently that users can interact with each job while it is running, creating
interactive computing
– Response time should be < 1 second
– Each user has at least one program executing in memory process
– If several jobs ready to run at the same time  CPU scheduling
– If processes don’t fit in memory, swapping moves them in and out to run
– Virtual memory allows execution of processes not completely in memory
College of Computing, Department of Computer Science
22
Tekalign T.(MSc., Assit Prof)
Memory Layout for Multiprogrammed System

➢ Spooling: whenever a running job is finished, the Operating


system could load a new job into a newly empty partition.
College of Computing, Department of Computer Science
23
Tekalign T.(MSc., Assit Prof)
The Operating System Zoo
▪ Mainframe OS(used in data centers): their services are:
▪ Batch-Process routine jobs without any interactive user interface.
▪ Claims processing in insurance company
▪ Transaction processing: handle large number of small requests
▪ E.g.. Check processing at bank or air-line reservation
▪ Time Sharing: allow remote users to run multiple jobs on computer at
once, such as querying big database
▪ E.g.. OS/390, Unix like
▪ Server OS: They run on servers:
▪ Eg. Unix and Window 2000, 2016
▪ Multiprocessor OS: Variation of server OS with special for
communication and connectivity.
▪ PC OS: Mainly designed to provide a good interface to a single
user.

College of Computing, Department of Computer Science


24
Tekalign T.(MSc., Assit Prof)
The Operating System Zoo(con’t)
▪ Real Time OS: They are characterized by having time as a key
parameter
▪ Hard-real time
▪ Soft-real time
▪ Commonly used in commercial
▪ Embedded OS: run on system that are known for their small
memory, power restrictions
▪ E.g.. Windows CE, Mobile Phone, Android, Symbian, Blackberry
OS and TinyOS
▪ Smart Card OS: Smallest OS run on Smart Cards
▪ Eg. Sim card, CDMA card
▪ Java Based
College of Computing, Department of Computer Science
25
Tekalign T.(MSc., Assit Prof)
Operating-System Operations
▪ Interrupt driven by hardware
▪ Software error or request creates exception or trap
o Division by zero, request for operating system service
▪ Other process problems include infinite loop, processes modifying each other
or the operating system

Dual-mode operation allows OS to protect


itself and other system components
User mode: execution done on behalf of
a user.
Monitor mode (also kernel mode or
system mode) : execution done on
behalf of operating system.

▪ Mode bit added to computer hardware to indicate the current mode: monitor
(0) or user (1).
o Some instructions designated as privileged, only executable in kernel
mode
o System call changes mode to kernel, return from call resets it to user

College of Computing, Department of Computer Science


26
Tekalign T.(MSc., Assit Prof)
Transition from User to Kernel Mode
▪ Timer to prevent infinite loop / process keeping
resources
o Set interrupt after specific period
o Operating system decrements counter
o When counter zero generate an interrupt
o Set up before scheduling process to regain control or
terminate program that exceeds allotted time

College of Computing, Department of Computer Science


27
Tekalign T.(MSc., Assit Prof)
Operating system architectures
1. Monolithic structure
▪ No Structure exists.
▪ OS is written as a collection of procedures
▪ Each procedures provide a well- defined interface in terms of
parameters.
▪ Each procedure is free to communicate with one another.
▪ No information hiding.
▪ Monolithic structure provides/ suggests the following structures:
1. A Main Program that invokes requests service
procedures.
2. A set of service procedures that carry out system calls.
3. A set of utility procedures that help service procedures.

College of Computing, Department of Computer Science


28
Tekalign T.(MSc., Assit Prof)
Monolithic structure

College of Computing, Department of Computer Science


29
Tekalign T.(MSc., Assit Prof)
Operating system architectures(con’t)
[Link] System/Structure
• In this structure OS is
organized as hierarch of
layers each one is
constructed up on the one
below it.
• When a procedure in an
outer ring, it had to make
the equivalent of system
calls.
• Maintenance is easy.
College of Computing, Department of Computer Science
30
Tekalign T.(MSc., Assit Prof)
Operating system architectures(con’t)
3. Virtual Machine
▪ Virtual machine existed to provide time sharing and multiprogramming
functionalities.
▪ First widely used in VM/370 with CMS
▪ Available today in Vmware
o Allows users to run any x86-based OS on top of Linux or NT
▪ “Guest” OS can crash without harming underlying OS
o Only virtual machine fails—rest of underlying OS is fine
• “Guest” OS can even use raw hardware
o Virtual machine keeps things separated

College of Computing, Department of Computer Science


31
Tekalign T.(MSc., Assit Prof)
Operating system architectures(con’t)
4. Exokernels
▪ The main objective of this technology is to remove non-
essential components from the kernel and minimize the
kernel.
▪ Extending the OS is easy.
▪ It saves a layer of mapping.
▪ It is found at the bottom layer, running in the kernel mode
▪ Its job is to allocate resources to virtual machine and then
check attempts to use them to make sure no machine is
trying to use somebody else’s resources.
▪ The Exokernel needs only keep track of which resources is
assigned to which process.
College of Computing, Department of Computer Science
32
Tekalign T.(MSc., Assit Prof)
Operating system architectures(con’t)
5. Microkernels (Client-Server) Model
▪ In this model a user program is treated as client process
and OS service are treated as server process.
▪ The communication between the process is done through
exokernel.
▪ Processes (clients and OS servers) don’t share memory
• Communication via message-passing
• Separation reduces risk of “byzantine” failures

Client obtains service by


sending messages to the server processes
College of Computing, Department of Computer Science
33
Tekalign T.(MSc., Assit Prof)
College of Computing, Department of Computer Science
34
Tekalign T.(MSc., Assit Prof)
Home Work >>>>>
Reading….

College of Computing, Department of Computer Science


35
Tekalign T.(MSc., Assit Prof)
Computing Environments
▪ Traditional computer
– Office environment
• PCs connected to a network, terminals attached to
mainframe or minicomputers providing batch and
timesharing
• Now portals allowing networked and remote systems
access to same resources
– Home networks
• Used to be single system, then modems
• Now firewalled, networked

College of Computing, Department of Computer Science


36
Tekalign T.(MSc., Assit Prof)
Computing Environments (Cont.)
Client-Server Computing
Dumb terminals supplanted by smart PCs
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

College of Computing, Department of Computer Science


37
Tekalign T.(MSc., Assit Prof)
Peer-to-Peer Computing
• Another model of distributed system
• P2P does not distinguish clients and servers
– Instead all nodes are considered peers
– May each act as client, server or both
– Node must join P2P network
• Registers its service with central lookup service on network,
or
• Broadcast request for service and respond to requests for
service via discovery protocol

College of Computing, Department of Computer Science


38
Tekalign T.(MSc., Assit Prof)
Operating-System View
▪ An OS provides the environment within which programs are
executed.
▪ There are several points to view OSs.
➢ Functional view (what it does)
➢ Components view (Designers view)
✓ Components and interconnections
➢ Services view (Users/Programmers view)
➢ Structure view (How it is implemented)

College of Computing, Department of Computer Science


39
Tekalign T.(MSc., Assit Prof)
Functional view (What it does)
• Program execution and handling
– Starting programs, managing their execution and communicating their
results.
• I/O operations
– Mechanisms for initiating and managing I/O
• File-system Management
– Creating, maintaining and manipulating files
• Communications
– Between processes of the same user
• Such as sending result of input request to a user program
– Between different users
• Exception detection and handling
– Protection related issues
– Safety in the case of power failures via backups.
– Detecting undesirable state such as printers out of paper.
College of Computing, Department of Computer Science
40
Tekalign T.(MSc., Assit Prof)
Functional view (…)
▪ Resource allocation
– Includes processor and I/O scheduling, memory
management
▪ Accounting
– To track users usage of resources for billing and statistical
reasons
▪ Protection
– Maintaining integrity of user’s data
– Integrity checks to keep out unauthorized users
– Maintaining logs of incorrect attempts

College of Computing, Department of Computer Science


41
Tekalign T.(MSc., Assit Prof)
Component view: Processes
▪ A process is:
– a program in execution. It is a unit of work within the system.
– Program is a passive entity, process is an active entity.
– Dynamic entity created by the execution of the program.
– Typically program + run time control information.
• Control information includes memory maps, program counter value etc.
– OS attempts treat all processes uniformly.
– We will explore further in the next chapter
▪ Processes may play different roles
– User processes
– OS (system) processes
▪ A single process can swap other processes
– A computation requires typically many processes
• Shell, one or more user processes, one or more system processes

College of Computing, Department of Computer Science


42
Tekalign T.(MSc., Assit Prof)
Component view: Process management
▪ Operations:
– Creation and termination
– Suspension and resumption
• Due to interrupts, context switches
– Synchronizing processes
• Making sure that a process that is waiting on an I/O
waits till it is completed and does not wait forever, i.e.,
wakes-up soon after an I/O process terminates.
– Communication
• Between two processes enabling them to cooperate.
– Deadlock detection and avoidance.

College of Computing, Department of Computer Science


43
Tekalign T.(MSc., Assit Prof)
Component view: Storage management
▪ Managing main memory
– Allocating main memory to active processes
• Maintaining a map of allocated vs. free memory
– De-allocating currently used memory to make a room for
other processes.
▪ Managing secondary storage
– Managing the free sectors/tracks on the disk
– Allocating this storage to programs
– Scheduling access requests to the disk

College of Computing, Department of Computer Science


44
Tekalign T.(MSc., Assit Prof)
Component view: I/O management
▪ Devices
– Device drivers
– Accepting an I/O request and invoking appropriate device driver
– Buffering, caching, spooling
▪ Files
– Non-volatile representation of users/system programs and data.
– File systems
• A file is a collection of related information defined by its creator.
• Support logical organization of data that the user might want to see
• Map data onto the physical storage devices and write their access
and update.
– Operations
• Creation, manipulation and deletion of files and directories
• Moving files from primary to secondary storage while maintaining
structure.
• Interaction with the memory manager
• Backup and protection
College of Computing, Department of Computer Science
45
Tekalign T.(MSc., Assit Prof)
Component view: Networking
▪ Support to communication in a distributed
system
– FTP
– http
– Network file system

Component view: Protection


▪ Controlling the access of programs, processes, or users to the
resources defined by the computer system.

College of Computing, Department of Computer Science


46
Tekalign T.(MSc., Assit Prof)
Services view
▪ Command Interpreters
▪ Two levels of specification
– System calls
• The interfaces in which the processes invoke specific OS
functions
– System programs
• May use capabilities not available through system calls
– The interfaces at these levels can be standardized.
• e.g network protocols, etc.

College of Computing, Department of Computer Science


47
Tekalign T.(MSc., Assit Prof)
Services view: Command interpreters
▪ Interface between the user and the OS
▪ Can be a part of kernel or a separate process (shell)
▪ Striking differences between OSs
– Ranges from GUIs to cryptic control card interpreters.
▪ Typical commands
– Process creation and destruction
– I/O handling and file system manipulation
– Communication: interact with remote devices
– Protection management: changing file/directory access
control.

College of Computing, Department of Computer Science


48
Tekalign T.(MSc., Assit Prof)
Services view: System Calls
▪ A special machine instruction
– That causes an interrupt
– Various names: syscall, trap
▪ The system calls are the instruction set of the OS virtual processor.
▪ 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 Program
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 machine (JVM).
• Interface between a process and OS
– Arguments typically passed through registers, a memory block or
on stack.

College of Computing, Department of Computer Science


49
Tekalign T.(MSc., Assit Prof)
System Calls (Cont …)
▪ System calls are performed through a set of steps:
1. The calling program first pushes the parameter onto the stack.
2. Actual call to the library procedure.
3. The Library Procedure puts the system call number in place where OS
expected it.
4. It executes the TRAP instruction and the system call will be executed
at fixed address.
5. The kernel mode examines the system call number and then
dispatches the correct system call handler.
6. The system call handler runs when completed and return the control
7. The procedure then returns to the program.
▪ Note: TRAP instruction is used to change the mode from one
procedure to another.
College of Computing, Department of Computer Science
50
Tekalign T.(MSc., Assit Prof)
Example of System Calls
• System call sequence to copy the contents of
one file to another file

College of Computing, Department of Computer Science


51
Tekalign T.(MSc., Assit Prof)
Groups of System Calls
1. System calls for process Management
– Eg. Cp file1 file2
– Used to copy file 1 to file 2
2. System calls for file management
– System calls are related to file system
– To create new file, the creat call is used.
– E.g. fd=create (“abc”, 0751);
• Creates a file called abc with mode 0751 octal.
• The leading Zero(0) means that a constant is in octal.
• 0751 specify the rwx bits for the owner
– (7 means read-write-execute permission)
– (5 means read-execution permission)
– (1 means execute only permission)
College of Computing, Department of Computer Science
52
Tekalign T.(MSc., Assit Prof)
Groups of System Calls (cont …)
3. System Calls for directory management
o Related to file system
o mkdir-to create directories
o rmdir- to remove empty directories
o link - to allow the same file to appear under two or more
names, often in different directories
• Eg. link(“/usr/jim/memo”, ”/usr/ast/note”);
• The file memo in jim’s directory is now entered into ast’s
directory under the name note. There after
/usr/jim/memo and /usr/ast/note refer to the same file.
4. Miscellaneous system calls.

College of Computing, Department of Computer Science


53
Tekalign T.(MSc., Assit Prof)
API – System Call – OS Relationship

College of Computing, Department of Computer Science


54
Tekalign T.(MSc., Assit Prof)
Types of System Calls

Process control
File management
Device management
Information maintenance
Communications

College of Computing, Department of Computer Science


55
Tekalign T.(MSc., Assit Prof)
Communication Models
Communication may take place using either message
passing or shared memory.

Msg Passing Shared Memory

College of Computing, Department of Computer Science


56
Tekalign T.(MSc., Assit Prof)
Services view: System Programs
▪ System programs provide convenient environment for
program execution and development.
▪ Some are user interfaces to system calls; some are more
complex.
▪ Each system call is usually supported by a system program.
▪ They can be divided into:
– File/Device manipulation
– Status information
– File modification
– Programming language support
– Program loading and execution
– Communications
– Application programs
▪ Most users’ view of the operation system is defined by system
programs, not the actual system calls
College of Computing, Department of Computer Science
57
Tekalign T.(MSc., Assit Prof)
System Programs(cont …)
▪ File/Device management
– Create, delete, copy, rename, print, dump, list, and generally
manipulate files and directories.
– get/set file attributes (protection parameters, locations in directories,…)
– Same set of calls as above (devices are treated as files)
▪ Status information/Information Maintenance
– Get/set system data (time/date, memory/CPU usage), process, device
attributes, amount of available memory, disk space and number of
users
– Others provide detailed performance, logging, and debugging
information
– Typically, these programs format and print the output to the terminal or
other output devices
– Some systems implement a registry - used to store and retrieve
configuration information

College of Computing, Department of Computer Science


58
Tekalign T.(MSc., Assit Prof)
System Programs (cont’d)
▪ File modification
– Text editors to create and modify files
– Special commands to search contents of files or perform
transformations of the text
▪ Programming-language support
- Compilers, assemblers, debuggers and interpreters sometimes provided
▪ Program loading and execution
₋ Absolute loaders, relocatable loaders, linkage editors, and overlay-
loaders, debugging systems for higher-level and machine language
▪ Communications
– Create/delete links, send and receive messages
– Provide the mechanism for creating virtual connections among
processes, users, and computer systems.
– Allow users to send messages to one another’s screens, browse web
pages, send electronic-mail messages, log in remotely, transfer files
from one machine to another
– Transfer status information
– Modes can be message passing or shared memory

College of Computing, Department of Computer Science


59
Tekalign T.(MSc., Assit Prof)
Structure view
▪ OS is a complex program and should be engineered
carefully
▪ Divide into components with carefully defined
inputs, outputs and functions.
▪ How to structure OS functionality ?
– Layering
– Virtual machines
▪ Designing and implementation of OS.

College of Computing, Department of Computer Science


60
Tekalign T.(MSc., Assit Prof)
Structure view: Virtual machines
▪ System programs above kernel can use either system calls or
hardware instructions.
▪ System programs treat the hardware and the system calls as
though they both are at the same level.
▪ In general application programs may view everything under
them in the hierarchy as a part of machine itself, which leads
to the concept of virtual machines.
▪ The virtual machine approach provides an interface that is
identical to the underlying bare hardware.
▪ Each process is provided with a (virtual) copy of the
underlying computer.
▪ The resources of the physical computer are shared to create
the virtual machines.
– CPU scheduling and spooling are used.
College of Computing, Department of Computer Science
61
Tekalign T.(MSc., Assit Prof)
Cont….
▪ A virtual machine takes the layered approach to its logical
conclusion. It treats hardware and the operating system
kernel as though they were all hardware
▪ A virtual machine provides an interface identical to the
underlying bare hardware
▪ The operating system creates the illusion of multiple
processes, each executing on its own processor with its own
(virtual) memory
▪ The resources of the physical computer are shared to create
the virtual machines
– CPU scheduling can create the appearance that users have their own
processor
– Spooling and a file system can provide virtual card readers and virtual
line printers
– A normal user time-sharing terminal serves as the virtual machine
operator’s console.
College of Computing, Department of Computer Science
62
Tekalign T.(MSc., Assit Prof)
Structure view: Virtual machines
▪ Logical conclusion of layered approach.
– The OS offers an abstract machine to execute on
• Hides the specifics and details of hardware
– Users are given their own VM, they can run any of the OS or software
packages that are available on the underlying machine.
– Provides a complete copy of underlying machine to the user
• Founded under the name virtual machine (VM) by IBM
• Became a household name with JAVA
▪ Mechanism of creating this illusion
– CPU scheduling
• Sharing the CPU in a transparent way
– Memory management
• Having large virtual memory space to address
– Additional features such as file systems and so on are offered through file
management subsystems
• Problem is with partitioning the disk
– VM introduced minidisks such partitioning of tracks on the physical
disk.

College of Computing, Department of Computer Science


63
Tekalign T.(MSc., Assit Prof)
System Models

Non-virtual Machine Virtual Machine

College of Computing, Department of Computer Science


64
Tekalign T.(MSc., Assit Prof)
Structure view: Virtual machines (cont..)
▪ Operation
– User-level code executes as is
– Supervisor code executes at user level
• Privileged instructions are simulated.
– Generate trap to VM emulator
• Hidden registers and I/O instructions are simulated.
– Virtual machine software has two modes
• User mode and monitor mode
– The user program will execute in two modes
• Virtual user mode
• Virtual monitor mode

College of Computing, Department of Computer Science


65
Tekalign T.(MSc., Assit Prof)
Structure view: Virtual machines (cont..)
▪ Advantages
– A software created abstraction that is a replica of the underlying
machine
– Additional functionality can be provided
• Can run different OSs on different VMs.
– Each VM is completely isolated from others, so secure.
– Protection of various system resources.
– It can be used for OS research and development.
– System programs are given their own virtual machine.
– Thousands of programs are available for MSDOS on Intel CPU-based
systems.
– SUN micro-systems and DEC use faster machines
• To test MSDOS programs on the faster machines, the best way is to
provide a virtual Intel machine.
– System compatibility problems can be solved
▪ Disadvantages
– Performance degradation is inevitable
College of Computing, Department of Computer Science
66
Tekalign T.(MSc., Assit Prof)
Any Queries

College of Computing, Department of Computer Science


67
Tekalign T.(MSc., Assit Prof)

You might also like