0% found this document useful (0 votes)
85 views7 pages

Cs 63

This document contains instructions for an assignment in the course "Introduction to System Software". It provides details such as the course code, title, assignment number, maximum marks, and due date. It lists 6 questions to answer for the assignment. Question 1 asks students to find reasons for UNIX's success and compare features of Linux, Fedora, Ubuntu, and Windows Vista. Question 2 provides a shell program to generate the first 100 Fibonacci numbers. Question 3 asks students to design an algorithm to convert a decimal number to binary coded decimal representation and draw a flowchart. Question 4 asks students to calculate turnaround time and waiting time for different scheduling algorithms. Question 5 provides a shell program to find the greatest common divisor of two positive integers.

Uploaded by

Bhargav Hathi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views7 pages

Cs 63

This document contains instructions for an assignment in the course "Introduction to System Software". It provides details such as the course code, title, assignment number, maximum marks, and due date. It lists 6 questions to answer for the assignment. Question 1 asks students to find reasons for UNIX's success and compare features of Linux, Fedora, Ubuntu, and Windows Vista. Question 2 provides a shell program to generate the first 100 Fibonacci numbers. Question 3 asks students to design an algorithm to convert a decimal number to binary coded decimal representation and draw a flowchart. Question 4 asks students to calculate turnaround time and waiting time for different scheduling algorithms. Question 5 provides a shell program to find the greatest common divisor of two positive integers.

Uploaded by

Bhargav Hathi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 7

Course Code : CS-63

Course Title : Introduction to System Software


Assignment Number : BCA (3)-63/Assignment/2010
Maximum Marks : 25
Last Date of Submission : 30th April, 2010 (For January Session)
30th October, 2010 (For July Session)

There are six questions in this Assignment. Answer all the questions. You may use
illustrations and diagrams to enhance explanation.

Question 1: Find out the reasons those have made the UNIX an amazingly successful operating system. What are
the Features on existing UNIX based operating systems like Linux Red Hat, Fedora and Ubantu
Operating system. Also, compare them with Windows Vista.

The UNIX operating system has clearly emerged as one of the primary software
platforms for the '90s, providing distributed computing capabilities for even the most diverse
networks. Its remarkable success has been due both to its portability and to its long history of
innovation. In the more than 25 years that UNIX has been around, it has had plenty of time to
"soak up" good ideas from some of the sharpest computer people in the business. From AT&T, the
University of California at Berkeley, Sun Microsystems, and many other companies, UNIX has
acquired a tremendous collection of powerful tools and maintained an open architecture that
continues to invite development.

UNIX today runs on three or four million computers, maybe more. These computers
range from very small personal computers to Crays. The concept of creating ad hoc "programs" by
interconnecting commands is extremely powerful whether you're working on a laptop or a
supercomputer.

Because of its portability and because of an elegant design that appeals to developers,
UNIX has proliferated into many different "flavors" over the past couple decades. As much as this
divergence has profited UNIX by providing many venues for innovation, it has also frustrated the
growing need for portable applications. Without an adequate market share, any particular UNIX
flavor has suffered from a dearth of software or, at least, a dearth of affordable software, especially
compared with personal computer systems such as those built by IBM and Apple. The flavors of
UNIX are different enough that it became difficult and, therefore, costly to port applications from
one to the other. In addition, UNIX is not the same simple creature that it was back in Bell Labs.
Windowing systems, graphical user interfaces, and years of innovation have complicated UNIX
and dramatically affected the complexity of porting applications.

The need for simplified application portability was not, however, the only factor pushing for
a more unified UNIX. Improvements in networking put interoperability among different UNIX
systems, as well as between UNIX and non-UNIX systems, high on everyone's agenda. Today's
businesses are demanding enterprise-wide computing solutions. These solutions entail a high
degree of data sharing—both distributed applications and an ease of moving information and
people expertise around the organization. Today's procurements are specifying standard
interfaces and protocols to help meet this demand and leverage organizations' investments in
computing technology.

Portability:
From a technical point of view, portability was probably the most important factor in the
overall success of UNIX. Users could move UNIX to many different platforms with very little
change. Coded in the high-level language C, UNIX was easily ported to a variety of very different
hardware platforms.

Extensibility:
Another reason for the early success of UNIX was its extensibility and simplicity. UNIX was
able to grow without losing its fundamental elegance and without excessive risk of introducing
serious new bugs. Previously, as systems grew, they became increasingly complex and
increasingly difficult to maintain.

Additional Features
The multi-user and multiprocessing nature of UNIX greatly amplified the productivity of its users;
they could work on several things at a time.

UNIX also became ready for networking at an early age

Appeal
Finally, the success of UNIX is based on its appeal to its users. Enthusiasm for UNIX is
generally correlated with the time people spend with it. Users must get to a certain level of
expertise before they can string together commands and "compose" their own functionality or
embed their tricks into scripts that they use as if they were UNIX commands themselves

3
Question 2: Write a shell program to generate the first hundred numbers in the Fibonacci series.

Ans :
#!/bin/bash

echo "enter how many number"


read num

num1=0
num2=1

echo "Fibonacci series"

echo $num1
echo $num2

count=2

while [ $count -le $num ]


do
num3=`expr $num1 + $num2`
echo $num3
num1=$num2
num2=$num3
count=`expr $count + 1`
done

Output
Enter how many number
5
Fibonacci series
0
1
1
2
3
5
8
13
21
34

Question 3: Design an algorithm that accepts an input a decimal number and converts it into BCD
(Binary Coded Decimal) representation. Also, draw its Flow Chart.
Ans :

It's basically the algorithm to break a number down to digits. Then each digit would be represented
as a natural binary number on its own.
To break it down to digits, get a remainder after division with 10 (that's the last digit), then divide
the number by 10 to remove that digit. Repeat until there are digits, and store each one into an array
(or print them to screen without storing).

4
Question 4: Consider the following set of processes that arrive in the ready queue at the same time:
Process CPU time
P1 2
P2 1
P3 4
P4 3
P5 1
P6 2

Consider the following scheduling algorithms: FCFS, SJF and Round Robin (quantum = 1)
(i) What is turnaround time of each process for each of the above
Scheduling algorithms?
(ii) What is the waiting time of each process for each of the above
Algorithms?

Ans
The FCFS (First come First serve) scheduling

P1 p2 p3 p4 p5 p6

Time Process Turn around time = t1 (process Waiting time = turn around
complete complete ) – t2 ( process time – processing time
submitted )
0 - - -
2 P1 2-0 = 2 2-2=0
3 P2 3-0=3 3-1=2
7 P3 7-0=7 7-4 =3
10 P4 10-0=10 10-3=7
11 P5 11-0=11 11-1=10
13 P6 13-0=13 13-2=11

Average turn around time =(2+3+7+10+11+13)/6=7.67


Average waiting time =(0+2+3+7+10+11)/6=5.5
Process utilization =(13/13)*100=100%

5
The SJF (Short Job First) scheduling

p2 p5 p1 p6 p4 p3

Time Process Turn around time = t1 (process Waiting time = turn around
complete complete ) – t2 ( process time – processing time
submitted )
0 - - -
1 P2 1- 0=1 1-1=0
2 P5 2-0=2 2–1=1
4 P1 4- 0=4 4-2=2
6 P6 6-0=6 6–2=4
9 P4 9- 0=9 9–3=6
13 P3 13-0=13 13 - 4 = 9

Average turn around time = (1+2+4+6+9+13)/6=5.83


Average waiting time = (0+1+2+4+6+9)/6=3.66
Process utilization = (13/13)*100=100%

Round robin (Quantum =1)

P1 p2 p3 p4 p5 p6 p1 p3 p4 p6 p3 p4 p3

Time Process Turn around time = t1 (process Waiting time = turn around
complete complete ) – t2 ( process time – processing time
submitted )
0 - - -
2 P2 2-0 = 2 2-1 = 1
5 P5 5-0=5 5-1=4
7 P1 7-0=7 7-2=5
9 P6 9-0=9 9-2=7
12 P4 12-0=12 12-3=9
13 P6 13-0=13 13-4=9

Average turn around time = (2+5+7+9+12+13)/6=8


Average waiting time = (1+4+5+7+9+9)/6=5.83
Process utilization = (13/13)*100=100%

6
Question 5: Write a shell program to find the Greatest Common Divisor among the two positive
non-zero integers given.

Ans: the shell program


a=1
b=1
echo "enter Number 1 "
read a

echo "enter Number 2 "


read b

mx=0

if [ $a -gt $b ]
then
mx=$a
mn=$b
else
mx=$b
mn=$a
fi

r=`expr $mx % $mn`

while [ $r -gt 0 ]
do
mx=$mn
mn=$r
r=`expr $mx % $mn`
done
echo "The GCD is " $mn

The output
Enter Number 1
36
Enter number 2
24
The GCD is 12

7
Question 6: List the UNIX commands for the following:
(a) To search files for lines that match a particular string pattern given.

The syntax: %grep pattern file-name1 file-name2


An example: % grep 'mountain bike' sports hobbies > results

The result of command store in result file

(b) To print the list of the currently logged-in users.

The command: %who

(c) To sort alphabetically, a list of numbers stored in a file.

The command: %sort –n FileNumberList

(d) To count, number of words in a given text file.

The command: %who –w File1 file2

You might also like