Computer Science & IT – B.Tech, BCA, BBA, MCA, M.Tech Best Online Coaching Institute

Memory Management and its Technique

Definition of Memory Management The term Memory management means managing computer memory. In other words it provides a way to keep track of allocate portions of memory to programs at their request, and freeing it for reuse when no longer needed. It is the functionality of an operating system which handles or manages primary memory and check how much memory is required to be allocated to processes. It also keep track of some memory gets freed or unallocated and correspondingly it updates the status. It provides protection by using two registers, a base register and a limit register. The base register is used to hold the smallest legal physical memory address. The limit register is used to specifies the size of the range. For example, if the base register holds 30000 and the limit register is 120900, then the program can legally access all addresses from 30000 through...

Process Management in Operating System

PROCESS MANAGEMENT A Process is defined in many ways it is a program in execution, running state of a program is known as process or active part of program is known as process. The execution of a process must progress in a sequential fashion.  According to operating system a process can execute it code in positive direction, it can hold resources of system, it can communicate with other process, it can be terminated by operating system if process perform abnormal operation example divide by zero. In Process Management it manages the allocation of processes. Difference between Program and Process   PROGRAM PROCESS It is defined as a series of instructions It is a program in execution It is a passive entity It is an active entity It does not include program counter It include program counter that specify the next instruction to execute It does not store...

Filters and commands in UNIX

Introduction to filters A filter is a small and specialized program in UNIX that does some manipulation of the text of a file. It accepts input from the standard input processes the input and then send the output to standard output. Standard input is data source for a program, and by default it is text typed in at the keyboard. Therefore it can be directed to another file or another output in program. Standard output is the destination of output from a program, and by default it the display screen. It is used to extract the lines which contain a specific pattern and to arrange the content of a file in a sorted order or to replace the existing characters with other character and so on. It is used to store the intermediate result of a long pipe by using vertical bar (|) and merge two or more files together using filters. Various...

Computer Memory and its types

Introduction The term memory denotes physical device used to store program and data. It stores data in temporary or permanent basis for use in computer and storage data in the form of chip. A memory is just like a human brain. It is the storage space in computer where data is to be processed and instruction required for processing is stored. Memory is divided into large number of small parts called cells. Each location or cell has a unique address which varies from zero to memory size minus one. For example if computer has 64k words, then this memory unit has 64 * 1024=65536 memory locations. The address of these locations varies from 0 to 65535. Memory is divided into two types: Primary Memory Secondary Memory   Primary Memory It is also called as main memory. It is used to store temporary data in computer. These memories help system to store...

Swapping

Swapping concept occur in process scheduling and usually used by medium term scheduler. The term medium term scheduler removes process from CPU for duration and reduces the degree of multiprogramming. When execution of process occurs it is first loaded from secondary storage devices such as hard disk to main memory such as RAM and this is called process loading. Besides the process has to be loaded back into the secondary memory after complete its execution because memory is limited and processes needs it for their use an operating system swaps the two processes and this is called swapping. In a single word “swapping is removing of process from memory to secondary memory and again back to main memory”. In the above figure swapping used as a medium term scheduler which swap out partially executed process and swap in whose I/O event is completed. In the above...

Deadlock in Operating System

When a process enters in waiting state and process cannot change waiting state then that situation is known as deadlock. In other words we can say that it is undesirable condition of process. In multiprogramming environment there are multiple processes and multiple resources some processes acquire some resources and this processes needs more resources which are allocated by another processes. If there is cycle between acquired edge and request edge then this condition is known as deadlock.   Necessary and Sufficient Condition To Deadlock There are four necessary and sufficient conditions for deadlock to occur. Mutual Exclusion Hold and wait No preemption Circular wait   Mutual Exclusion – In mutual exclusion only one process can use at a time. Hold and wait – In hold and wait a process holds all resources in starting or waits all resources but not both. No preemption – In this technique operating system can preempt a process and another process can use free...

Process Management in Operating System

A Process is defined in many ways. It is a program in execution, running state of a program is known as process and active part of program is known as process. According to operating system a process can execute it code in positive direction, it can hold resources of system, it can communicate with other process, it can be terminated by operating system if process perform abnormal operation example divide by zero. In Process Management it manages the allocation of processes. Difference between Program and Process PROGRAM PROCESS It is defined as a series of instructions. It is a program in execution. It is a passive entity. It is an active entity. It does not include program counter. It include program counter that specify the next instruction to execute. It does not store temporary data. It store temporary data.   Process State A Process has five states each...

CPU Scheduling Algorithm

There are various algorithms to schedule the CPU. First Come, First Served Scheduling Shortest Job Scheduling Priority Scheduling Round-Robin Scheduling First Come First Served Scheduling – It simply assign the processor to the process which is first in ready queue. It is also called fair scheduling when processor has short jobs but when long jobs is used it become unfair because important jobs has to wait for execution. It is similar to FIFO (First in first out). Example – Consider the following set of processes that arrive at time 0, length of CPU Burst time given in milliseconds and the burst time indicates that how much time the process needs the CPU. Shortest Job Scheduling Algorithm – It is one of the best CPU Scheduling algorithm in term of minimum average waiting time, average turnaround time. In this algorithm CPU brings a job having minimum CPU burst time. There are two type...

Introduction to Operating System

What is an Operating System Operating System is an application program that act as an interface between user and Computer hardware. It is an important component of an operating system that provide large set of large and complex program. It serves dual objectives first it interpreting the user program instructions to the hardware and another is that it provide coordination between group of users to share resources efficiently. It is also called as “manager” of Resources because its manage all resources of computer resources such as hardware resources and Software resources. These two types of resources are managed by operating system. The Hardware and software resources such as Input-output Devices, CPU, Memory and so on. To behind the management of resources the goal of an operating system is to make the computer system convenient to use in an efficient manner. It allows sharing of hardware and software...

CPU Scheduling in Operating System

What is CPU Scheduling CPU Scheduling is used in multi-programming operating System to schedule several processes to competing for the CPU time. In CPU scheduling only one process in running state and others will be in ready or waiting state. CPU Scheduling is used in operating system to define the order in which computer system works. It selects the next job to be admitted into the system for processing. Types of Scheduling Two types of Scheduling algorithms Non-preemptive scheduling Preemptive scheduling Non-preemptive scheduling In non-preemptive Scheduling, a scheduling decision can be made when job finishes its execution. In other words we can say that once a process has given the CPU, the CPU cannot be taken away from that process. But the CPU away from that process when a process needs an I/O event or terminate the process you cannot remove the cpu forcefully that’s why it is called...