OS Unit1 Intoduction
OS Unit1 Intoduction
INTRODUCTION
Reference Books
➢ Memory Management(RAM)
➢ https://www.youtube.com/watch?v=LuDKfYv9VeI
Software
➢ It also provide a basis for application programs and acts as an intermediate between computer user and
computer hardware
Basic structure of Computer
Functions Of OS
It is an interface between User & Hardware
Allocation of resources
Management of memory,security,etc……
Basic structure of Computer…..cont..
➢ Multi Programming OS
➢ Distributed system
➢ Real time OS
Lets check ….?
o Windows NT
o Page maker
o Photoshop
Another one
Scenario:
A user opens MS-Word and start to type a letter, mean while power goes off.
Whether the file is available to user when he/she on the PC next time
oYES
oNO
Lets check ….?
o Windows NT
o Page maker
o Photoshop
Another one
o RAM
o ROM
➢ The users of batch operating system do not interact with the computer directly. Each user prepares his job
(consisted of program, data, and some control information) on an off-line device like punch cards and
submits it to the computer operator.
➢ To speed up processing, jobs with similar needs are batched together and run as a group. Thus, the
programmers left their programs with the operator. The operator then sorts programs into batches with
similar requirements.
Batch OS….cotn
➢ Advantages:
➢ Increased performances as a new get started as soon as the previous job finished without any
manual intervention.
➢ Disadvantage
➢ 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.
Multi Programming
➢ When two or more programs are in memory at the same time, sharing the processor is referred
to the multiprogramming operating system.
➢ Several programs in memory at the same time require some form of memory management and
resource scheduling.
CPU
Multi Programming system
Advantages:
Disadvantages:
• Due to high load of tasks, long time jobs have to wait for a long time.
Time sharing system
➢ Time-sharing is a technique which enables many
people, located at various terminals, to use a
particular computer system at the same time.
➢ Time-sharing or MULTITASKING is a logical
extension of multiprogramming.
➢ Processor's time which is shared among multiple
users simultaneously is termed as time-sharing.
➢ Multiple jobs are executed by the CPU switching
between them, but the switches occur so
frequently that the users may interact with each
program while it is running.
Time sharing system……
Time slice is defined by the OS, for sharing CPU time between
processes. CPU is taken away from a running process when the
allotted time slice expires.
➢Problem of reliability.
Increased throughput : By increasing the number of processors we get more work done in
less time.
Economy of scale: Multi processor system can save more money than single processor
system, because they can share peripherals(I/O), mass storage & power supply.
Increased reliability: If functions distributed properly among several processors, then the
failure of one processor will not halt the system only slow it down. This ability to continue
providing services or surviving hardware is called graceful degradation.
Types of multiprocessor system
Systems that treat all CPUs equally are called symmetric multiprocessing (SMP) systems.
Each processor runs an identical copy of the OS, and these copies communicate with each other
as needed.
2) Asymmetric multiprocessing system
A master processor(CPU) controls the system, the other processor either look to the
master for instruction or have predefined tasks. This theme defines a master slave relationship.
Disadvantages of Multiprocessor Systems
➢ These systems are referred as loosely coupled systems where each processor has its own
local memory and processors communicate with one another through various communication
lines.
➢ By loosely coupled systems, means that such computers possess no hardware connections at
the CPU - memory bus level(no memory sharing).
➢ With resource sharing facility, a user at one site may be able to use the resources available at
another.
➢ Reliable - Failure of one site in a distributed system doesn’t affect the others, the remaining
sites can potentially continue operating.
• Electronic banking
• Sensor networks
Distributed operation system (DOS): An operating system that runs over
multiple devices usually connected by a network medium.
Real-time operating system (RTOS): An operating system that can respond to
and schedule events in a precious time; i.e. time response is highly predictable.
Real Time System
➢ The real-time operating system used for a real-time application
➢ Those applications where data processing should be done in the fixed and small quantum of time.
➢ Real time system means that the system is subjected to real time, i.e., response should be
guaranteed within a specified timing constraint or system should meet the specified deadline.
➢ Ex: Controlling traffic signal, home appliance are application of Real Time operating system
➢ In real time operating system there is a little swapping of programs between primary and
secondary memory.
➢ Most of the time, processes remain in primary memory in order to provide quick response,
therefore, memory management in real time system is less demanding compared to other
systems.
Types of Real Time operating systems.
➢ A hard real-time system has time-critical deadlines that must be met, otherwise system
failure can occur.
➢ In hard real-time systems secondary storage is limited or missing with data stored in ROM.
➢ Examples: – air traffic control – vehicle subsystems control – Nuclear power plant control
➢ Soft real-time systems
➢ Soft real time by default as “Not Hard Real Time” ,Missing some deadlines by some amount
under some circumstances may be acceptable rather than failure.
➢ Soft real time means systems which have reduced constraints on “lateness” but still must
operate very quickly and repeatable.
➢ Examples: – multimedia s, telecom (cellular) networks, – web sites and services – computer
games.
Operating System Components
• An operating system is a large and complex system that can only be
created by partitioning into small pieces.
• Although Mac, Unix, Linux, Windows, and other OS do not have the
same structure, most of the operating systems share similar OS
system components like File, Process, Memory, I/O device
management.
Process Management
• The process management component is a procedure for managing the many
processes that are running simultaneously on the operating system.
• Every software application program has one or more processes associated with them
when they are running.
• For example, when you use a browser like Google Chrome, there is a process running
for that browser program. The OS also has many processes running, which
performing various functions.
o Synchronization process
o Communication process
Process Synchronization means sharing system resources by processes in such a way
that, Concurrent access to shared data is handled thereby minimizing the chance of
inconsistent data.
Main Memory management
• Main Memory is a large array of storage or bytes, which has an address.
• However, it is mainly based on the hardware design of the system. It is costly and
hence has a lower storage capacity.
Functions of Memory management in OS
• Determine what part of it are in use by whom, what part is not in use.
• In a multiprogramming system, the OS takes a decision about which process will get
Memory and how much.
• It also de-allocates the Memory when a process no longer requires or has been
terminated.
Secondary-Storage Management
• This Memory of the computer is very small to store all data and programs
permanently. The computer system offers secondary storage to back up the main
Memory. Today modern computers use hard drives/SSD as the primary storage of
both programs and data.
• However, the secondary storage management also works with storage devices, like
a USB flash drive, and CD/DVD drives.
Functions of Secondary storage management in OS:
• Storage allocation
• Disk scheduling
File Management
The operating system has the following important given activities in connections with file
management:
• In this type of system, all the processors have their local Memory, and the
processors communicate with each other using different communication
lines, like fiber optics or telephone lines.
Functions of Network management:
• Distributed systems help you to various computing resources in size and function.
They may involve microprocessors, minicomputers, and many general-purpose
computer systems.
• A distributed system also offers the user access to the various resources the network
shares.
• It helps to access shared resources that help computation to speed-up or offers data
availability and reliability.
Protection
• Considering a computer system having multiple users and concurrent execution of
multiple processes, the various processes must be protected from each other's
activities.
Following are the major activities of an operating system with respect to protection:
• The user gives commands which are executed by operating system (usually by
turning them into system calls).
• The main function of a command interpreter is to get and execute the next user
specified command.
OS services
OS services
• Program execution
• I/O operations
• Communication
• Error Detection
• Resource Allocation
• Protection
Program execution
Following are the major activities of an operating system with respect to program
management.
• Loads a program into memory.
• Executes the program.
• Handles program's execution.
• Provides a mechanism for process synchronization.
• Provides a mechanism for process communication.
• Provides a mechanism for deadlock handling.
I/O Operation
• I/O means any file or any specific I/O device.
• Program may require any I/O device while running. So operating
system must provide the required I/O devices.
• Keep track status of CPU, Memory, I/O devices, Storage devices, File system etc.
• Report and/or deliver error message in case of arithmetic over flow, divide by
zero errors etc.
Resource Management
• If there is more than one user or jobs running at the same time, then resources
must be allocated to each of them.
• Operating system manages different types of resources (i.e. main memory, CPU
cycles and file storage) require special allocation code.
• There are some resources which require only general request and release code.
• For allocating CPU, CPU scheduling algorithms are used for better utilization of
CPU.
Protection
• VMs are isolated from the rest of the system, and multiple VMs can exist on
a single piece of hardware, like a server. That means, it as a simulated image
of application software and operating system which is executed on a host
computer or a server.
• It has its own operating system and software that will facilitate the
resources to virtual computers.
Characteristics of virtual machines
• Virtual machine offers an instruction set architecture which differs from real
computer.
Kernel Mode
When CPU is in kernel mode, the code being
executed can access any memory address and any
hardware resource.
User Mode
• When CPU is in user mode, the programs don’t have direct access to memory and
hardware resources.
• In user mode, if any program crashes, only that particular program is halted.
• That means the system will be in a safe state even if a program in user mode
crashes.
Definition: System Calls provide the Interface between a process and the
Operating System.
• Process control
• File management
• Device management
• Information Maintenance
• Communication.
Process control
Some system calls under process control are:
• end, abort : A running program halt its execution either normally(end) or abnormally(abort)
• load, execute: A process or job executing may want to load and execute another program.
• create process, terminate process
• if calling process and called process both continue execution concurrently, then new Create process
system call is made.
• A running process is terminated if any error occur or is no longer needed.
• create file, delete file – require file name and attribute of a file
• Many system calls exist for transferring the information between the user
program and the OS.
• The get hostid and processid system call help to open the connection between the
processes, which are either on same system or on different system.
• open connection and close connection
•
• The recipient process must give the permission for communication with an accept
connection call
• Exchange of messages are done by read message and write message system calls
• In shared memory model, processes use map memory system call to gain access to
region of memory owned by other process.