Tuesday, December 06, 2016

PROCESS CONTROL BLOCK

PROCESS CONTROL BLOCK

 Process Control Block (PCB, also called Task Controlling Block, process table, Task Struct, or Switchframe) is a data structure in the operating system kernel containing the information needed to manage a particular process. There is a Process Control Block for each process, enclosing all the information about the process. It is a data structure, which contains the following :

 

  • Process State - It can be running, waiting etc.
  • Process ID and parent process ID.
  • CPU registers and Program Counter. Program Counter holds the address of the next instruction to be executed for that process.
  • CPU Scheduling information - Such as priority information and pointers to scheduling queues.
  • Memory Management information - Eg. page tables or segment tables.
  • Accounting information - user and kernel CPU time consumed, account numbers, limits, etc.
  • I/O Status information - Devices allocated, open file tables, etc.

Process and Process State

What is a Process?

A program in the execution is called a Process. Process is not the same as program. A process is more than a program code. A process is an 'active' entity as opposed to program which is considered to be a 'passive' entity. Attributes held by process include hardware state, memory, CPU etc.

PROCESS STATE

Processes can be any of the following states :

  • New - The process is in the stage of being created.
  • Ready - The process has all the resources available that it needs to run, but the CPU is not currently working on this process's instructions.
  • Running - The CPU is working on this process's instructions.
  • Waiting - The process cannot run at the moment, because it is waiting for some resource to become available or for some event to occur.
  • Terminated - The process has completed.

Monday, December 05, 2016

Difference Between Primary and Secondary Memory

         Difference between Primary and Secondary Memory


Primary Memory
Secondary Memory
These are semiconductor memories. These are magnetic and optical memories.
They are characterized as volatile random access memories (RAM) or on-volatile memories (ROM). They are non-volatile.
They contain program and data that is currently being used by micro processor. These are used to for bulk storage.
These memories are fast enough to interact with the microprocessor. Slower than primary memories.
Also known as Main Memory Also known as Backup Memory or Auxiliary Memory. E.g. Tapes, Floppies, Hard Discs, CD ROMs, DVDs

Secondary Memory

Secondary Memory/Non Volatile Menory

Secondary memory (or secondary storage) is the slowest and cheapest form of memory. It cannot be processed directly by the CPU. It must first be copied into primary storage (also known as RAM).
Secondary memory is computer memory that is non-volatile and persistent in nature and is not directly accessed by a computer/processor. It allows a user to store data that may be instantly and easily retrieved, transported and used by applications and services.
Secondary memory is also known as secondary storage.
Secondary memory devices include magnetic disks like hard drives and floppy disks ; optical disks such as CDs and CDROMs ; and magnetic tapes, which were the first forms of secondary memory.
Secondary memory is slower than primary memory but can store and retain data, even if the computer is not connected to electrical power. It also has substantial storage capacities, ranging from some MBs to several TBs of storage space within single memory.

Primary Memory


Primary Memory / Volatile Memory:

Primary Memory also called as volatile memory because the memory can’t store the data permanently. Primary memory select any part of memory when user want to save the data in memory but that may not be store permanently on that location. It also has another name i.e. RAM.

Random Access Memory (RAM):

The primary storage is referred to as random access memory (RAM) due to the random selection of memory locations. It performs both read and write operations on memory. If power failures happened in systems during memory access then you will lose your data permanently. So, RAM is volatile memory. RAM categorized into following types.
  • DRAM
  • SRAM
  • DDRRAM (Dual Data Rate RAM)

Read Only Memory (ROM) :

ROM is permanent memory location that offer huge types of standards to save data. But it work with read only operation. No data lose happen whenever power failure occur during the ROM memory work in computers.
ROM memory has several models such names are following.
1. PROM: Programmable Read Only Memory (PROM) maintains large storage media but can’t offer the erase features in ROM. This type of RO maintains PROM chips to write data once and read many. The programs or instructions designed in PROM can’t be erased by other programs.
2. EPROM : Erasable Programmable Read Only Memory designed for recover the problems of PROM and ROM. Users can delete the data of EPROM thorough pass on ultraviolet light and it erases chip is reprogrammed.
3. EEPROM: Electrically Erasable Programmable Read Only Memory similar to the EPROM but it uses electrical beam for erase the data of ROM.

Memory (Computer)

Memory (Computer)

Computer memory is any physical device capable of storing information temporarily or permanently. For example, Random Access Memory (RAM), a memory that stores information on an integrated circuit. Moreover, the term memory is usually used as a shorthand for physical memory, which refers to the actual chips capable of holding data. Some computers also use virtual memory, which expands physical memory onto a hard disk. Every computer comes with a certain amount of physical memory, usually referred to as main memory or RAM. You can think of main memory as an array of boxes, each of which can hold a single byte of information. 

Types of Computer Memory:

Memory is the best essential element of a computer because computer can’t perform simple tasks. The performance of computer mainly based on memory and CPU. Memory is internal storage media of computer that has several names such as majorly categorized into two types, Main memory and Secondary memory.
1. Primary Memory / Volatile Memory.
2. Secondary Memory / Non Volatile Memory.


Thursday, December 01, 2016

Advantage & disadvantage of DBMS





Advantage & Disadvantage of DBMS



 DBMS Advantages
  • Reduced data redundancy
  • Reduced updating errors and increased consistency
  • Greater data integrity and independence from applications programs
  • Improved data access to users through use of host and query languages
  • Improved data security
  • Reduced data entry, storage, and retrieval costs
  • Facilitated development of new applications program
  DBMS  Disadvantages
  • Database systems are complex, difficult, and time-consuming to design
  • Substantial hardware and software start-up costs
  • Damage to database affects virtually all applications programs
  • Extensive conversion costs in moving form a file-based system to a database system
Initial training required for all programmers and users 



CPU

Alternately referred to as a processor, central processor, or microprocessor, the CPU (pronounced sea-pea-you) is the Central Processing Unit of the computer. A computer's CPU handles all instructions it receives from hardware and software running on the computer.

The CPU is often referred to as the brain of the computer. However, it is more appropriate to refer to software as the brain and the CPU as a very efficient calculator. A CPU is really good with numbers, but if it wasn't for the software it wouldn't know how to do anything else.

The CPU is a chip within the computer.

Components of a CPU

The three typical components of a CPU include the following:
  • The arithmetic logic unit (ALU), which performs arithmetic and logical operations.
  • The control unit (CU), which extracts instructions from memory and decodes and executes them, calling on the ALU when necessary.
  • Registers or memory unit, for temporary storage.
CPU

Real-time operating system

Real-time operating system

Abbreviated as RTOS, a real-time operating system or embedded operating system is a computer operating system designed to handle events as they occur. Real-time operating systems are commonly found and used in robotics, cameras, complex multimedia animation systems, communications, and have various military and government uses. 

A real-time operating system (RTOS) is an operating system (OS) intended to serve real-time applications which process data as it comes in, typically without buffering delays. Processing time requirements (including any OS delay) are measured in tenths of seconds or shorter increments of time.

Time Sharing Operating System

A time sharing system allows many users to share the computer resources simultaneously. In other words, time sharing refers to the allocation of computer  resources in time slots to several programs simultaneously. For example a mainframe computer that has many users logged on to it. Each user uses the resources of the mainframe -i.e. memory, CPU etc. The users feel that they are exclusive user of the CPU, even though this is not possible with one CPU i.e. shared among different users.The time sharing systems were developed to provide an interactive use of the computer system. A time shared system uses CPU scheduling and multiprogramming to provide each user with a small portion of a time-shared computer. It allows many users to share the computer resources simultaneously. As the system switches rapidly from one user to the other, a short time slot is given to each user for their executions.

The time sharing system provides the direct access to a large number of users where CPU time is divided among all the users on scheduled basis. The OS allocates a set of time to each user. When this time is expired, it passes control to the next user on the system. The time allowed is extremely small and the users are given the impression that they each have their own CPU and they are the sole owner of the CPU. This short period of time during that a user gets attention of the CPU; is known as a time slice or a quantum. The concept of time sharing system is shown in figure.
                
 
In above figure the user 5 is active but user 1, user 2, user 3, and user 4 are in waiting state whereas user 6 is in ready status.

Multiuser Operating System

Multiuser Operating System

A multi-user operating system allows multiple users to access the data and processes of a single machine from different computers or terminals. These were previously often connected to the larger system through a wired network, though now wireless networking for this type of system is more common. The users will typically be at terminals or computers that give them access to the system through a network, as well as other machines on the system such as printers. A multi-user operating system differs from a single-user system on a network in that each user is accessing the same OS at different machines.


 

A multi-user operating system is often used in businesses and offices where different users need to access the same resources, but these resources cannot be installed on every system. In a multi-user operating system, the OS must be able to handle the various needs and requests of all of the users effectively.

Multiprogramming Operating System

Multiprogramming Operating System

In a multiprogramming system there are one or more programs loaded in main memory which are ready to execute. Only one program at a time is able to get the CPU for executing its instructions (i.e., there is at most one process running on the system) while all the others are waiting their turn.
The main idea of multiprogramming is to maximize the use of CPU time. Indeed, suppose the currently running process is performing an I/O task (which, by definition, does not need the CPU to be accomplished). Then, the OS may interrupt that process and give the control to one of the other in-main-memory programs that are ready to execute (i.e. process context switching). In this way, no CPU time is wasted by the system waiting for the I/O task to be completed, and a running process keeps executing until either it voluntarily releases the CPU or when it blocks for an I/O operation. Therefore, the ultimate goal of multiprogramming is to keep the CPU busy as long as there are processes ready to execute.
Note that in order for such a system to function properly, the OS must be able to load multiple programs into separate areas of the main memory and provide the required protection to avoid the chance of one process being modified by another one.


Multitasking OS

Multitasking has the same meaning of multiprogramming but in a more general sense, as it refers to having multiple (programs, processes, tasks, threads) running at the same time. This term is used in modern operating systems when multiple tasks share a common processing resource (e.g., CPU and Memory). At any time the CPU is executing one task only while other tasks waiting their turn. The illusion of parallelism is achieved when the CPU is reassigned to another task (i.e. process or thread context switching).
There are subtle differences between multitasking and multiprogramming. Multitasking OS implies Multiprogramming but vice-versa not possible.

Batch operating system

Batch operating system

The users of a batch operating system do not interact with the computer directly. Each user prepares his job 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. The programmers leave their programs with the operator and the operator then sorts the programs with similar requirements into batches.
The problems with Batch Systems are as follows −
  • Lack of interaction between the user and the job.
  • CPU is often idle, because the speed of the mechanical I/O devices is slower than the CPU.
  • Difficult to provide the desired priority.