0% found this document useful (0 votes)
14 views19 pages

UNIT 1 Notes-OS

The document discusses the limitations of complex processors and highlights the advantages of multicore systems, such as the Intel Core i7, which utilize multiple processors and cache memory. It outlines the eight major components of operating systems, including process management, memory management, file management, and I/O system management, as well as their respective responsibilities. Additionally, it describes various operating system structures, services, system calls, and system programs that facilitate program execution and resource management.

Uploaded by

padhu6121985
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)
14 views19 pages

UNIT 1 Notes-OS

The document discusses the limitations of complex processors and highlights the advantages of multicore systems, such as the Intel Core i7, which utilize multiple processors and cache memory. It outlines the eight major components of operating systems, including process management, memory management, file management, and I/O system management, as well as their respective responsibilities. Additionally, it describes various operating system structures, services, system calls, and system programs that facilitate program execution and resource management.

Uploaded by

padhu6121985
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/ 19

In brief, designers have come up against practical limits in the ability to achieve greater performance by

means of more complex processors. Designers have found that the best way to improve performance to take
advantage of advances in hardware is to put multiple processors and a substantial amount of cache memory
on a single chip

An example of a multicore system is the Intel Core i7, which includes four x86 processors, each with a
dedicated L2 cache, and with a shared L3 cache. One mechanism Intel uses to make its caches more
effective is prefetching, in which the hardware examines memory access patterns and attempts to fill the
caches speculatively with data that s likely to be requested soon.

COMPONENTS OF OPERATING SYSTEM.


There are eight major operating system components.
They are : Process management
Main-memory management
File management
I/O-system management
Secondary-storage management
Networking
Protection system
Command-interpreter system
(i) Process Management
A process can be thought of as a program in execution. A batch job is a process.
A time shared user program is a process.
A process needs certain resources-including CPU time, memory, files,
and I/O devices-to accomplish its task.
A program by itself is not a process; a program is a passive entity, such as the
contents of a file stored on disk, whereas a process is an active entity, with a
program counter specifying the next instruction to execute.
A process is the unit of work in a system.
The operating system is responsible for the following activities in connection with
process management:
Creating and deleting both user and system processes
Suspending and resuming processes
Providing mechanisms for process synchronization
Providing mechanisms for process communication
Providing mechanisms for deadlock handling
(ii) Main Memory Management
Main memory is a large array of words or bytes, ranging in size from
hundreds of thousands to billions. Each word or byte has its own address.
Main memory is a repository of quickly accessible data shared by the CPUand I/O
devices.
To improve both the utilization of the CPU and the speed of the computer's response to
its users, we must keep several programs in memory.
The operating system is responsible for the following activities in connection
with memory management:
Keeping track of which parts of memory are currently being used and by
whom.
Deciding which processes are to be loaded into memory when
memory space becomes available
Allocating and deallocating memory space as needed.
(iii) File Management
File management is one of the most visible components of an operating
system.
The operating system is responsible for the following activities
in connection with file management:
Creating and deleting files
Creating and deleting directories
Supporting primitives for manipulating files and directories
Mapping files onto secondary storage
Backing up files on stable (nonvolatile) storage media
(iv) I/O System management
One of the purposes of an operating system is to hide the
peculiarities of specific hardware devices from the user. This is done using the I/O
subsystem.
The I/O subsystem consists of
A memory-management component that includes buffering,
caching, and spooling
A general device-driver interface
Drivers for specific hardware devices
(v) Secondary storage management
Because main memory is too small to accommodate all data and
programs, and because the data that it holds are lost when power is lst
the computer system must provide secondary storage to back up main
memory.
The operating system is responsible for the following activities in
connection with disk management:
Free-space management
Storage allocation
Disk scheduling
(vi) Networking
A distributed system is a collection of processors that do not
share memory, peripheral devices, or a clock.
Instead, each processor has its own local memory and clock, and
the processors communicate with one another through various
communication lines, such as high-speed buses or networks.
The processors in the system are connected through a communication
network, which can be configured in a number of different ways.
(vii) Protection System
Various processes must be protected from one another's activities. For
that purpose, mechanisms ensure that the files, memory segments, CPU,
and other resources can be operated on by only those processes that
have gained proper authorization from the operating system.
Protection is any mechanism for controlling the access of
programs, processes, or users to the resources defined by a computer system.
Protection can improve reliability by detecting latent errors at the
interfaces between component subsystems.
(viii) Command-Interpreter System
One of the most important systems programs for an operating system is
the command interpreter.
It is the interface between the user and the operating system.
Some operating systems include the command interpreter in the
kernel. Other operating systems, such as MS-DOS and UNIX, treat the
command interpreter as a special program that is running when a job is
initiated, or when a user first logs on (on time-sharing systems).
Many commands are given to the operating system by control
statements.
When a new job is started in a batch system, or when a user logs on
to a time-shared system, a program that reads and interprets control
statements is executed automatically.
This program is sometimes called the control-card interpreter or the
Command-line interpreter, and is often known as the shell.

SERVICES OF OPERATING SYSTEM


An operating system provides services to programs and to the users of those programs.
It provided by one environment for the execution of programs.
The services provided by one operating system is difficult than other operating system.
Operating system makes the programming task easier. The common service provided by the
operating system is listed below.
1. Program execution
2.I/O operation
3.File system manipulation
4.Communications
5.Error detection

The OS provides certain services to programs and to the users of those programs.
1. Program execution: The system must be able to load a program into memory and to run
that program. The program must be able to end its execution, either normally or abnormally
(indicating error).
2. I/O operations: A running program may require I/O. This I/O may involve a file or an I/O device.
3. File-system manipulation: The program needs to read, write, create, delete files.
4. Communications: In many circumstances, one process needs to exchange
Information with another process. Such communication can occur in two major ways. Thefirst
takes place between processes that are executing
on the same computer; the second takes place between processes that are executing on different
computer systems that are tied together by a computer network.
5. Error detection: The operating system constantly needs to be aware of possible errors. Errors
may occur in the CPU and memory hardware (such as a memory error or a power failure),
in I/O devices (such as a parity error on tape, a connection failure on a network, or lack of paper
in the printer), and in the user program (such as an arithmetic overflow, an attempt to access an illegal
memory location, or a too-great use of CPU time). For each type of error, the operating system should
take the appropriate action to ensure correct and consistent computing.
6. Resource allocation: Different types of resources are managed by the Os.When there are multiple
users or multiple jobs running at the same time, resources must be allocated to each of them.
7. Accounting: We want to keep track of which users use how many and which kinds of computer
resources. This record keeping may be used for accounting or simply for accumulating usage
statistics.
8. Protection: The owners of information stored in a multiuser computer system may want
to control use of that information. Security of the system is also important.
OPERATING SYSTEM STRUCTURES
SIMPLE STRUCTURE:
In MS-DOS, application programs are able to access the basic I/O routines to write
directly to the display and disk drives. Such freedom leaves MS-DOS vulnerable to errant (or
malicious) programs, causing entire system to crash when user programs fail.

MS-DOS LAYER STRUCTURE:


UNIX operating system. It consists of two separable parts, the kernel and the system
programs. The kernel is further separated into a series of interfaces and device drivers. We can view
the traditional UNIX operating system as being layered. Everything below the system call interface
and above the physical hardware is the kernel.
The kernel provides the file system, CPU scheduling, memory management, and other
operating system functions through system calls. There is number of functionality to be combined
into one level. This monolithic structure was difficult to implement and maintain.
LAYERED APPROACH:
The operating system is broken into a number of layers (levels). The bottom layer
(layer 0) is the hardware; the highest (layer M) is the user interface.
The main advantage of the layered approach is simplicity of construction and
debugging. The layers are selected so that each uses functions (operations) and services of only
lower-level layers. This approach simplifies debugging and system verification. The first layer can be
debugged without any concern for the rest of the system, because, by definition, it uses only the
basic hardware to implement its functions.
Once the first layer is debugged, its correct functioning can be assumed while the
second layer is debugged, and so on. If an error is found during the debugging of a particular layer,
the error must be on that layer, because the layers below it are already debugged. Each layer hides the
existence of certain data structures, operations, and hardware from higher-level layers.
The major difficulty with the layered approach involves appropriately defining
the various layers as a layer can use only lower-level layers. Another problem with layered
implementations is they tend to be less efficient than other types. Each layer adds overhead to the
system call; the net result is a system call that takes longer than a non- layered system.
Example of Layered Approach

MICROKERNEL APPROACH:
In the mid-1980s, researchers at Carnegie Mellon University developed an operating system
called Mach that modularized the kernel using the microkernel approach. provide
minimal process and memory management, in addition to a communication facility.
The main function of the micro kernel is to provide a communication facility between the
client program and the various services running in user space. One benefit of the microkernel approach is
ease of extending the operating system. All new services are added to user space and consequently do
not require modification of the kernel. The microkernel also provides more security and reliability,
since most services are running as user, rather than kernel-processes.
can suffer from decreased performance due to increased system
function overhead.

MODULES:
The current methodology for operating-system design involves using object-oriented
programming techniques to create a modular kernel. Here, the kernel has a set of core components
and links in additional services either during boot time or during run time. Such a
strategy uses dynamically loadable modules.
Such a design allows the kernel to provide core services yet also allows certain features
to be implemented dynamically.
SYSTEM CALLS
A system call is a request that a program makes to the kernel through a software
interrupt. System calls provide the interface between a process and the operating system.
These calls are generally available as assembly-language instructions. Certain systems allow
system calls to be made directly from a high-level language program, in which case the calls
normally resemble predefined function or subroutine calls.
TYPES OF SYSTEM CALLS:
Traditionally, System Calls can be categorized in six groups, which are: Process Control,
File Management, Device Management, Information Maintenance, Communications and
Protection.
PROCESS CONTROL
A running program needs to be able to stop execution either normally or abnormally.
When execution is stopped abnormally, often a dump of memory is taken and can be examined
with a debugger.
Following are functions of process control:
End, abort
Load, execute
Create process, terminate process
Get process attributes, set process attributes
Wait for time
Wait event, signal event
Allocate and free memory

FILE MANAGEMENT
We first need to be able to create and delete files. Either system call requires the name of the file
and perhaps some of the file's attributes.
Once the file is created, we need to open it and to use it. We may also read, write, or reposition.
Finally, we need to close the file, indicating that we are no longer using it.
We may need these same sets of operations for directories if we have a directory structure for
organizing files in the file system.
In addition, for either files or directories, we need to be able to determine the values of various
attributes and perhaps to reset them if necessary. File attributes include the file name, a file type,
protection codes, accounting information, and so on
Functions:
Create, delete file
Open, close
Read, write, reposition
Get file attributes, set file attributes
DEVICE MANAGEMENT
A process may need several resources to execute - main memory, disk drives, access to files, and
so on. If the resources are available, they can be granted, and control can be returned to the user
process. Otherwise, the process will have to wait until sufficient resources are available.
The various resources controlled by the OS can be thought of as devices. Some of these devices are
physical devices (for example, tapes), while others can be thought of as abstract or virtual devices
(for example, files).
Once the device has been requested (and allocated to us), we can read, write, and (possibly)
reposition the device, just as we can with files.
In fact, the similarity between I/O devices and files is so great that many OSs, including UNIX,
merge the two into a combined file-device structure.
A set of system calls is used on files and devices. Sometimes, 1/0 devices are identified by special
file names, directory placement, or file attributes.
Functions:
Request device, release device
Read, write, reposition
Get device attributes, set device attributes
Logically attach or detach devices
INFORMATION MAINTENANCE
Many system calls exist simply for the purpose of transferring information between the user
program and the OS. For example, most systems have a system call to return the current time and
date.
Other system calls may return information about the system, such as the number of current users,
the version number of the OS, the amount of free memory or disk space, and so on.
In addition, the OS keeps information about all its processes, and system calls are used to access
this information. Generally, calls are also used to reset the process information.
Functions:
Get time or date, set time or date
Get system data, set system data
Get process, file, or device attributes
Set process, file, or device attributes
COMMUNICATIONS
There are two common models of interprocess communication: the message-passing model and the
shared-memory model. In the message-passing model, the communicating processes exchange
messages with one another to transfer information.
In the shared-memory model, processes use shared memory creates and shared memory attaches
system calls to create and gain access to regions of memory owned by other processes.
Recall that, normally, the OS tries to prevent one process from accessing another process's memory.
Shared memory requires that two or more processes agree to remove this restriction. They can then
exchange information by reading and writing data in the shared areas.
Message passing is useful for exchanging smaller amounts of data, because no conflicts need be
avoided. It is also easier to implement than is shared memory for intercomputer communication.
Shared memory allows maximum speed and convenience of communication, since it can be done
at memory speeds when it takes place within a computer. Problems exist, however, in the areas of
protection and synchronization between the processes sharing memory.
Functions:
Create, delete communication connection
Send, receive messages
Transfer status information
Attach or detach remote devices
PROTECTION
Get File Security, Set File Security
Get Security Group, Set Security Group

SYSTEM PROGRAMS
System programs provide a convenient environment for program development and execution.
They can be divided into several categories:
1. File management: These programs create, delete, copy, rename, print, dump, list, and
generally manipulate files and directories.
2. Status information: The status such as date, time, amount of available memory or
diskspace, number of users or similar status information.
3. File modification: Several text editors may be available to create and
modify the content of files stored on disk or tape.
4. Programming-language support: Compilers, assemblers, and interpreters for common
programming languages are often provided to the user with the operating system.
5. Program loading and execution: The system may provide absolute loaders, relocatable loaders,
linkage editors, and overlay loaders.
6. Communications: These programs provide the mechanism for creating virtual connections
among processes, users, and different computer systems. (email, FTP, Remote log in)
7. Application programs: Programs that are useful to solve common
problems, or to perform common operations.
Eg. Web browsers, database systems.

GENERATION AND SYSTEM BOOT.

Operating-System Generation

It is possible to design, code, and implement an operating system specifically for one machine
at one site. More commonly, however, operating systems are designed to run on any of a class of machines
at a variety of sites with a variety of peripheral configurations. The system must then be configured or
generated for each specific computer site, a process sometimes known as system generation (SYSGEN).

The operating system is normally distributed on disk or CD-ROM. To generate a system, we use
a special program. The SYSGEN program reads from a given file, or asks the operator of thesystem for
information concerning the specific configuration of the hardware system, or probes the hardware directly
to determine what components are there. The following kinds of information must be determined.

What CPU is to be used?

What options (extended instruction sets, floating-point arithmetic, and so on) are installed?
For multiple CPU systems, each CPU must be described.

How much memory is available?

Some systems will determine this value themselves by referencing memory location after
memory location until an "illegal address" fault is generated. This procedure defines the final
legal address and hence the amount of available memory.

What devices are available?

The system will need to know how to address each device (the device number), the device
interrupt number, the device's type and model, and any special device characteristics.

What operating-system options are desired, or what parameter values are to be used? These
options or values might include how many buffers of which sizes should be used, what type
of CPU-scheduling algorithm is desired, what the maximum number of processes to be
supported is, and so on. Once this information is determined, it can be used in several ways.
System Boot

After an operating system is generated, it must be made available for use by the
hardware. But how does the hardware know where the kernel is or how to load that kernel?
The procedure of starting a computer by loading the kernel is known as booting the system.

On most computer systems, a small piece of code known as the bootstrap program or
bootstrap loader locates the kernel, loads it into main memory, and starts its execution. Some
computer systems, such as PCs, use a two-step process in which a simple bootstrap loader fetches a
more complex boot program from disk, which in turn loads the kernel.

When a CPU receives a reset event for instance, when it is powered up or rebooted the
instruction register is loaded with a predefined memory location, and execution starts there. At that
location is the initial bootstrap program.

This program is in the form of read-only memory (ROM), because the RAM is in an
unknown state at system startup. ROM is convenient because it needs no initialization and
cannot be infected by a computer virus.

The bootstrap program can perform a variety of tasks. Usually, one task is to run diagnostics
to determine the state of the machine. If the diagnostics pass, the program can continue with the
booting steps. It can also initialize all aspects of the system, from CPU registers to device
controllers and the contents of main memory.

Sooner or later, it starts the operating system. Some systems such as cellular phones, PDAs,
and game consoles store the entire operating system in ROM. Storing the operating system in
ROM is suitable for small operating systems, simple supporting hardware, and rugged operation.

A problem with this approach is that changing the bootstrap code requires changing the
ROM hardware chips. Some systems resolve this problem by using erasable programmable read-
only memory (EPROM), which is read-only except when explicitly given a command to become
writable.

All forms of ROM are also known as firmware, since their characteristics fall somewhere
between those of hardware and those of software. A problem with firmware in general is
that executing code there is slower than executing code in RAM. Some systems store the
operating system in firmware and copy it to RAM for fast execution. A final issue with
firmware is that it is relatively expensive, so usually only small amounts are available.
EVALUATION OF OPERATING SYSTEMS.

Stages of Evaluation

Serial Processing
Users access the computer in series. From the late 1940's to mid 1950's, the programmer
interacted directly with computer hardware i.e., no operating system.
These machines were run with a console consisting of display lights, toggle
switches, some form of input device and a printer. Programs in machine code are loaded
with the input device like card reader.
If an error occur the program was halted and the error condition was indicated by
lights. Programmers examine the registers and main memory to determine error. If the program is
success, then output will appear on the printer.

Main problem here is the setup time. That is single program needs to load source
program into memory, saving the compiled (object) program and then loading and
linking together.

Simple Batch Systems


To speed up processing, jobs with similar needs are batched together and run as
a group. Thus, the programmers will leave their programs with the operator. The
operator will sort programs into batches with similar requirements.
The problems with Batch Systems are:
Lack of interaction between the user and job.CPU is often idle, because the speeds
of the mechanical I/O devices are slower than CPU. For overcoming this problem use the Spooling
Technique. Spool is a buffer that holds output for a device, such as printer, that
can not accept interleaved data streams. That is when the job requests the printer
to output a line. That line is copied into a system buffer and is written to the disk.
When the job is completed, the output is printed. Spooling technique can keep
both the CPU and the I/O devices working at much higher rates.
Multiprogrammed Batch Systems
Jobs must be run sequentially, on a first-come, first-served basis.
However when several jobs are on a direct-access device like disk, job
scheduling is possible. The main aspect of job scheduling is multiprogramming.
Single user cannot keep the CPU or I/O devices busy at all times.
Thus multiprogramming increases CPU utilization.
In when one job needs to wait, the CPU is switched to another job, and so on.
Eventually, the first job finishes waiting and gets the CPU back.
Time-Sharing Systems
Time-sharing systems are not available in 1960s. Time-sharing or multitasking is a logical
extension of multiprogramming. That is processors time is shared among multiple users
simultaneously is called time-sharing. The main difference between Multiprogrammed Batch
Systems and Time-Sharing Systems is in multiprogrammed batch
systems its objective is maximize processor use, whereas in Time-Sharing Systems its objective is
minimize response time.

Multiple jobs are executed by the CPU by switching between them, but the switches
occur so frequently. Thus, the user can receives an immediate response. For example, in a
transaction processing, processor execute each user program in a short burst or quantum of
computation. That is if n users are present, each user can get time quantum. When the user
submits the command, the response time is seconds at most.

Operating system uses CPU scheduling and multiprogramming to provide each user with a
small portion of a time. Computer systems that were designed primarily as batch systems have
been modified to time-sharing systems.
For example IBM's OS/360.
Time-sharing operating systems are even more complex than multi-programmed operating
systems. As in multiprogramming, several jobs must be kept simultaneously in memory.
OBJECTIVES AND FUNCTIONS OF AN OPERATING SYSTEMS

An OS is a program that controls the execution of application programs and acts as


an interface between applications and the computer hardware. It can be thought of
as having three objectives:
Convenience: An OS makes a computer more convenient to use.
Efficiency: An OS allows the computer system resources to be used in an efficient
manner.
Ability to evolve: An OS should be constructed in such a way as to permit the
effective development, testing, and introduction of new system functions without
interfering with service.
The Operating System as a User/Computer Interface
The hardware and software used in providing applications to a user can be viewed in a layered or
hierarchical fashion. The user of those applications, the end user, generally is not concerned with the details
of computer hardware. Thus, the end user views a computer system in terms of a set of applications.

An application can be expressed in a programming language and is developed by an application


programmer. If one were to develop an application program as a set of machine instructions that is
completely responsible for controlling the computer hardware, one would be faced with an overwhelmingly
complex undertaking.

To ease this chore, a set of system programs is provided. Some of these programs are referred to as
utilities, or library programs. These implement frequently used functions that assist in program creation,
the management of files, and the control of I/O devices. A programmer will make use of these facilities in
developing an application, and the application, while it is running, will invoke the utilities to perform certain
functions.
Three key
interfaces in a typical computer system:
Instruction set architecture (ISA) : The ISA defines the repertoire of machine language instructions
that a computer can follow. This interface is the boundary between hardware and software. Note that both
application programs and utilities may access the ISA directly. For these programs, a subset of the
instruction repertoire is available (user ISA). The OS has access to additional machine language instructions
that deal with managing system resources (system ISA).
Application binary interface (ABI) : The ABI defines a standard for binary portability across programs.
The ABI defines the system call interface to the operating system and the hardware resources and services
available in a system through the user ISA.
Application programming interface (API) : The API gives a program access to the hardware resources
and services available in a system through the user ISA supplemented with high-level language (HLL)
library calls. Any system calls are usually performed through libraries. Using an API enables application
software to be ported easily, through recompilation, to other systems that support the same API.

The Operating System as Resource Manager


A computer is a set of resources for the movement, storage, and processing of data and for the control of
these functions. The OS is responsible for managing these resources.
By managing the computer resources, the OS is in control of the computer s basic functions
The main resources that are managed by the OS. A portion of the OS is in main memory. This includes the
kernel , or nucleus , which contains the most frequently used functions in the OS and, at a given time,other
portions of the OS currently in use. The remainder of main memory contains user programs anddata.

The memory management hardware in the processor and the OS jointly control the allocation of main
memory, as we shall see. The OS decides when an I/O device can be used by a program in execution and
controls access to and use of files. The processor itself is a resource, and the OS must determine how much
processor time is to be devoted to the execution of a particular user program. In the case of a multiple-
processor system, this decision must span all of the processors.

Ease of Evolution of an Operating System


A major OS will evolve over time for a number of reasons:
Hardware upgrades plus new types of hardware
New services
Fixes
OPERATING SYSTEM OPERATIONS

Modern operating systems are interrupt driven. If there are no processes to execute, OS will sit idle and
wait for some event to happen. Interrupts could be hardware interrupts or software interrupts. The OS is
designed to handle both. A trap (or an exception) is a software generated interrupt caused either by an error
(e.g. divide by zero) or by a specific request from a user program. A separate code segment iswritten
in the OS to handle different types of interrupts. These codes are known as interrupt handlers/ interrupt
service routine. A properly designed OS ensures that an illegal program should not harm the execution of
other programs. To ensure this, the OS operates in dual mode.

Dual mode of operation

The OS is design in such a way that it is capable of differentiating between the execution of OS code and
user defined code. To achieve this OS need two different modes of operations this is thereby controlled by
mode bit added to hardware of computer system as shown in Table 4.

Mode Type Definition Mode Bit Examples

User Mode User Defined codes are executed Mode Bit=1 Creation of word document or in
general user using any application
program

Kernel Mode OS system codes are executed Mode Bit=0 Handling interrupts-Transferring
(also known as supervisor, control of a process from CPU to I/O
system, or privileged mode) on request
User and Kernel Mode of Operating System

Transition from User to Kernel mode

When a user application is executing on the computer system OS is working in user mode. On signal of
system call via user application, the OS transits from user mode to kernel mode to service that request as
shown in Fig. 11.

Transition from user to kernel mode

When the user starts the system the hardware starts in monitor/ kernel mode and loads the operating system.
OS has the initial control over the entire system, when instructions are executed in kernel mode. OS then
starts the user processes in user mode and on occurrence of trap, interrupt or system call again switch to
kernel mode and gains control of the system. System calls are designed for the user programs through which
user can ask OS to perform tasks reserved for operating system. System calls usually take the form of the
trap. Once the OS service the interrupt it transfers control back to user program hence user mode by setting
mode bit=1.

Benefits of Dual Mode

The dual mode of operation protects the operating system from errant users, and errant users from one
another by designating some of the machine instructions that may cause harm as privilegedinstructions.
These instructions can execute only in kernel mode. If an attempt is made to execute a privileged instruction
in user mode, the hardware does not execute the instruction, but rather treats the instruction as illegal and
traps to the operating system. Examples of privileged instructions:

1. Switching to kernel mode


2. Managing I/O control
3. Timer Management
4. Interrupt Management

Timer
Since OS operates in dual mode it should maintain control over CPU. The system should not allow a user
application:
1. To be stuck in an infinite loop
2. To fail to call system services
3. Never return control to the OS
To achieve this goal, we can use timer. This timer control mechanism will interrupt the system at a specified
period; thereby preventing user program from running too long. This can be implemented either as fixed
timer or variable timer
Additional Topics

Virtual Machines (VM)

Virtualization technology enables a single PC or server to simultaneously run multiple operating systems
or multiple sessions of a single OS

A machine with virtualization software can host numerous applications, including those that run on
different operating systems, on a single platform
The host operating system can support a number of virtual machines, each of which has the
characteristics of a particular OS
The solution that enables virtualization is a virtual machine monitor (VMM), or hypervisor

A virtual machine takes the layered approach to its logical conclusion. It treats hardware and the opera

with its own (virtual) memory.

The resources of the physical computer are shared to create the virtual machines.

1. CPU scheduling can create the appearance that users have their own processor.

2. Spooling and a file system can provide virtual card readers and virtual line printers.

3. A normal user time-sharing terminal serves as the virtual machine console.

Advantages/Disadvantages of Virtual Machines

The virtual-machine concept provides complete protection of system resources since each virtual
machine is isolated from all other virtual machines.

This isolation, however, permits no direct sharing of resources.

A virtual-machine system is a perfect vehicle for operating-systems research and development. System
development is done on the virtual machine, instead of on a physical machine and so does not disrupt
normal system operation.

The virtual machine concept is difficult to implement due to the effort required to provide an exact
duplicate to the underlying machine.

You might also like