Showing posts with label linux lab. Show all posts
Showing posts with label linux lab. Show all posts

Wednesday, June 17, 2015

OPEN SHORTEST PATH FIRST PROTOCOL

PROGRAM:

#iinclude<stdio.h>
#include<string.h>
int main()
{
int count,src_router,i,j,k,w,v,min;
int cost_matrix[100][100],dist[100],last[100];
int flag[100];
printf("\n Enter the no of routers");
scanf("%d",&count);
printf("\n Enter the cost matrix values:");
for(i=0;i<count;i++)
{
for(j=0;j<count;j++)
{
printf("\n%d->%d:",i,j);
scanf("%d",&cost_matrix[i][j]);
if(cost_matrix[i][j]<0)
cost_matrix[i][j]=1000;
}
}
printf("\n Enter the source router:");
scanf("%d",&src_router);
for(v=0;v<count;v++)
{
flag[v]=0;
last[v]=src_router;
dist[v]=cost_matrix[src_router][v];
}
flag[src_router]=1;
for(i=0;i<count;i++)
{
min=1000;
for(w=0;w<count;w++)
{
if(!flag[w])
if(dist[w]<min){
v=w;
min=dist[w];
}
}
flag[v]=1;
for(w=0;w<count;w++)
{
if(!flag[w])
if(min+cost_matrix[v][w]<dist[w])
{
dist[w]=min+cost_matrix[v][w];
last[w]=v;
}
}
}

Thursday, February 26, 2015

STUDY OF UNIX OPERATING SYSTEM


OPERATING SYSTEM
An Operating System is a set of programs that
􀁸 Functions as an virtual machine by presenting an interface that is easier to program than the underlying hardware
􀁸 Acts as resource management through orderly and controlled allocation of the processors, memories, and I/O devices among the programs competing for it.
OS TYPES
1. Single User—The system will have its own hard disk, memory, CPU and other resources all dedicated to a single user. Eg. MS-DOS
2. Multi User—The users having access to a multi-user system will have just a terminal and a keyboard. The other resources such as hard disk, printers are centrally located.
The user is expected to simply hook onto his account, perform the work, disconnect and leave quietly. Eg. UNIX

UNIX FEATURES
1. Multi-user system—Multi-user capability of UNIX allows several users to use the same computer to perform their tasks. Several terminals [Keyboards and Monitors] are connected to a single powerful computer [UNIX server] and each user can work with their terminals.
2. Multi-tasking system—Multitasking is the capability of the operating system to perform various task simultaneously, i.e. a user can run multiple tasks concurrently.