Subscribe to our RSS Feeds

Traps And interrupts

1 Comments »

Traps And interrupts

Traps and interrupts are events that break down the normal execution of the program.
Trap: A trap is and abnormal condition detected by the CPU, which indicates an unknown I/O device is accessed, etc.
Interrupt: An interrupt in an interruption in the normal execution of the program. When the CPU is interrupt, then it stops its current activities like execution of the program. And transfer the control to interrupting device to check the interrupt. The CPU responds interrupt. By saving the current value of the program counter and resetting the program to a new address. The new address is the starting address where procedure for handling interrupt is located. Similarly, other state information is also saved when an interrupt occurs. In many computer systems this information is stored in a special program status word register. After saving the necessary information, the interrupt service routine is executed on completion; the CPU resumes the interrupted program. Thus the application program does not have to contain any special code to accommodate the interrupts. The CPU and the operating system are responsible for suspending the program and then resuming it at the end of interrupt processing.
Difference:
1. A trap will occur at exactly the same point f the program execution, each time a program runs.
2. An interrupt is dependent on the relative timing between the interrupting device and the CPU.
An interrupt is signal sent to the CPU by an external hardware device such as I/O device. The software can also send interrupt signal to the CPU. Hardware may trigger an interrupt at any time sending a signal to the CPU through system bus. It also called a monitor call or supervisor call.
Interrupt are the important part of computer architecture. Each machine has its own interrupt mechanism, bur most of the function are common. The interrupt must transfer control to the appropriate interrupt service routine. Similarly, interrupts must be handled quickly. In a computer system only a predefined interrupts can be occurred, so the array of pointer is used to store the address of interrupt routines. This array of pointer is called the interrupt vector. Each trap and interrupt is associated with an index into that vector. The index values are the unique device number that provides the address of the interrupt service routine for interrupting device. The early computer systems stored the interrupt address in a fixed location or in a location indexed by the device number but the modern computer use the stack for this purpose.
Classes of interrupts:
There are many classes of interrupts, but the most common classes of interrupts are
·                    Program check interrupts
·                    Supervisor call interrupts
·                    Timer interrupts
·                    I/O interrupts
·                    External interrupts
·                    Machine check interrupts
Program check interrupts:
These are caused by some problems that may occur during program execution such as division by zero, arithmetic overflow or underflow, data read in correct format, attempt to reference a memory location beyond the limits of real memory, attempt to reference a protected resource etc. many systems allow users to specify their own routines to be executed when a program check interrupt occurs.
Supervisor call interrupts:
These are initiated by a running process that executes the supervisor call instruction. This type of interrupt is a user generated request for a particular system service such as for I/O operation etc.
Timer interrupts:
These are generated by timer within the CPU. Timer interrupt allows the operating system to perform certain function on regular intervals of time.
I/O interrupts:
These are generated by I/O controller. The i/o interrupts signal to the cpu that the status of device has changed. I/O interrupts are caused due to three resigns.
1. Input/output operation completes.
2. Input/output error occurs.
3. Input/output device is made ready.
External interrupts:
These are caused by pressing of the console’s interrupt key by the operation or the receipt of a signal from another processor on a multiprocessor system.
Machine check interrupts:
These are caused by hardware failure such as memory parity error.
11:38 AM

Basic concept of computer

0 Comments »

Basic concept of computer

A computer system consists of various hardware components that play certain roles in computer systems. These components are interconnected to each other in such a way so that the computer can perform its desired functions. The main components of the computer systems are:

   1. C.P.U
   2. Main memory
   3. I/O module
   4. System bus
   5. C.P.U registers

Processor

Processor is the main component of the computer system. It controls the operations of the computer and co-ordinate the other components of the computer. It performs all the function according to program instruction. It consider as the brain of the computer. Many new systems have more than one processor.

Main memory

The program and data must be loaded into main memory of the computer before execution. So it is known as the working area of the computer. The main part (Kernal) of the operating systems also loaded into the memory during the booting process of the computer and performs different type of function residing in the main memory. It’s also known as temporary memory. If the computer system shut down or power cut-off all the data is cleared from the memory.

I/O Module

I/O module is an electronic component. It is also known as I/O (input/output) controller or controller deceives. The data and programs instruction moved between the computer and its external device through I/O modules. Each I/O device have its own I/O module to communicate with processor.

System Buses

A system bus is the electronic path through which data and command signals are communicated between the computer components, such as between main memory, processor, and I/O modules. Systems buses further divided into

   1. Data Bus
   2. Address Bus
   3. Control Bus

C.P.U Registers

It is the most important part of C.P.U. Each register performs a specific function.

   1. M.A.R (Memory Address Register)
   2. M.B.R (Memory Buffer Register)
   3. I/O AR (I/O Address Register)
   4. I/O BR (I/O Buffer Register)
   5. P.C (Program Counter)
   6. I.R (Instruction Register)
   7. Flag register
   8. Stack control register 
11:26 AM

Computer system architecture

1 Comments »

Computer system architecture

Computer architecture means design or construction of a computer. A computer sustem may be organized in different ways. Some computer systems have single processor and other have multiprocessors. So computer systems categorized in these ways.

1.      Single Processor Systems

2.      Multiprocessor Systems

3.      Clustered Systems

Single processor

Some computers use only one processor such as microcomputers. On a single processor system, there is only one CPU that perform all the activities in the computer system, However, most of these systems have  other special purpose processors, such as I/O Processor that move data rapidly among different components of the computer system. These processors execute only a limited system programs and do not run the user program. So we define single processor systems as “ A system that has only one general purpose CPU, is considered as single processor system.

Multiprocessor systems

Some systems have two or more processors. These systems are also known as parallel systems or tightly coupled systems. Mostly the processors of these systems share the common system bus (electronic path) memory and peripheral (input/output) devices. These systems are fast in data processing and have capability to execute more than one program simultaneously on different processors. This type of processing is known as multiprogramming or multiprocessing. Multiple processors further divided in two types.

                                     i.            Asymmetric Multiprocessing Systems (AMS)

                                   ii.            Symmetric Multiprocessing Systems (SYS)

Asymmetric multiprocessing systems

The multiprocessing system, in which each processor is assigned a specific task, is known as Asymmetric Multiprocessing Systems. In this system there exists master slave relationship like one processor defined as master and others are slave. The master processor controls the system and other processor executes predefined tasks. The master processor also defined the task of slave processors.      

Symmetric multiprocessing system

The multiprocessing system in each processor performs all types of task within the operating system. All processors are peers and no master slave relationship exits. In SMP systems many programs can run simultaneously. But I/O must control to ensure that data reach the appropriate processor because all the processor shares the same memory.

Clustered systems

Clustered systems are another form of multiprocessor system. This system also contains multiple processors but it differs from multiprocessor system. The clustered system is composed of multiple individual systems that connected together. In clustered system, also individual systems or computers share the same storage and liked to gather via local area network. A special type of software is known as cluster to control the node the systems.

Other form of clustered system includes parallel clusters and clustering over a wide area network. In parallel cluster multiple hosts can access the same data on the shared storage. So many operating systems provide this facility but some special software are also designed to run on a parallel cluster to share data.    
11:25 AM

Intro to Operating System

0 Comments »

Operating System Introduction

A computer is an electronic machine, which can store, process and retrieve information trough software, which are divided into two kinds

           I.      System software

           II.      Application software

The system software is used to control and manage the operation of the computer. While the application software’s are used to control or solve the particular problems of the users.

The systems software is further divided into different categories. The most important is operating system. It controls all the computer resources, application programs and provides the services to the systems users; it also provides the platform through which the computer programs are developed.

A usual computer system consists of five major elements.

Hardware: it includes the CPU, memory and input/output deceives and provides the basic computing resources for the system.

Operating System: it manages hardware and provides the services to the application programs and system users.

System Program: these programs are set of programs that use to provide the basic services for hardware and software such as disk scanner program, backup utility program and Antivirus.

Application Programs: the programs are used to solve the problems of user. Like word processor, and web browser.

Users: the user interact with the operating system indirectly though the application programs.

Components of operating systems

The operating system is divided into various components or parts and each component performs its own role in computer operation. The components of a typical operation system are:

    * Process management
    * Memory management
    * Secondary storage management
    * I/O system
    * File system
    * Protection system
    * Command interpreter system

Process management

The most important task of operating system is to manage and monitor different processes executing in the computer (The program in execution is called a process). A system consists of a collection of processes, some of which are operating systems processes and the rest of which are user processes. The process management component of the operating system schedules the processes for execution.

The operating system also performs following major activities for process management.

v     Creates and deletes both user and system processes.

v     Suspends and resumes process

v     Provides mechanisms for process synchronization

v     Provides mechanism for processes communication between them.

Memory management

The memory unit has very important role for data processing. The processor takes data and program instruction from memory, executes them, and store results in the main memory. In some advanced computer systems, memory can share by multiple processes. The operating systems must manage the allocation memory to these processes.

The operating system performs the following major memory management tasks.

v     Manages the memory space used by different processes or user programs

v     Loads new process into memory and allocates memory space for them

v     De-allocate memory space allocated to a process when it is terminated.

v     Swaps out and swaps in process if required.

Secondary storage management

The information and programs are permanently stored on the secondary devices such as hard disk, floppy disk, tape drive etc. the programs are loaded by operating system from secondary storage in main memory before to execute.

The operating system performs the following major secondary management tasks.

v     Manages free space

v     Allocates storage area for storing information and programs

v     Manages the disk scheduling

File system management

The processed data must be stored in the form of files on storage medium and can be retrieved when required for use (a file is a storage unit and it is a collection of information or it may be a set of programs instruction). The files are stored permanently on the storage device and are organized in folders or directories so that a particular file can be easily accessed.

File management is the most visible components of an operating system. It performs the following major file management tasks.

v     File operations such as creating, deleting, closing a file.

v     Directory operation such as creating new directory or removing directory

v     File organization such as arrangement of records into files and the ways for accessing these records

v     File protection to control access the files etc

I/O system

A computer communicates information through its input and output devices. The application programs access these devices through operating system supervisor calls provided for this purpose.

The OS perform these I/O related task

v     Issues commands to various I/O devices

v     Handles I/O interrupts

v     Handles I/O errors that occur to reading and writing operation.

Protection system

The operating system provides protection to various resources of the computer against unauthorized users so that only authorized users can access the system. The operating systems use various mechanisms for the protection of the computer system.

Command interpreter system

It is the basic interface between the computer and user the user interacts with the computer by giving command to the operating system. The command interpreter is also known as command line interpreter or the shell. It gets the commend from user and executes them
11:24 AM