University of Pune T.Y.B.Sc. (Computer Science) Practical Examination, March/October Lab Course I: System Programming & Operating System
University of Pune T.Y.B.Sc. (Computer Science) Practical Examination, March/October Lab Course I: System Programming & Operating System
Write a machine language program to find the greater of 2 numbers by using above instruction
Opcodes. [ 35 Marks ]
2. Write the simulation program for Round Robin Scheduling for given time quantum. The
arrival time and first CPU-burst of different jobs should be input to the system. Assume the
fixed I/O waiting time ( 2 units). The next CPU-burst should be generated using random
function. The output should give the Gantt Chart, turnaround time and waiting time for each
process. Also display the average turnaround time and average waiting time.
[ 35 Marks ]
3. Oral/Viva [ 10 Marks ]
Write a machine language program to find the addition of given n numbers by using above
instruction Opcodes. [ 35 Marks ]
2. Write a simulation program for the implementation Sequential (Contiguous) File Allocation
method. Assume disk having n number of blocks. Randomly mark some block as allocated
and accordingly maintain the free block list. Make the use of following menu to perform
operations.
3. Oral/Viva [ 10 Marks ]
Write a machine language program to find the GCD of given 2 numbers by using above
instruction Opcodes. [ 35 Marks ]
[ 35 Marks ]
3. Oral/Viva [ 10 Marks ]
-------------------- Slip 3 -------------------
UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System
Write a machine language program to print -1, 0 or 1 depending on given number is negative, zero
or positive respectively. Use above instruction Opcodes. [ 35 Marks ]
2. Write the simulation program using FCFS. The arrival time and First CPU bursts of different
jobs should be input to the system. Assume the fixed I/O waiting time (2 units). The next CPU
bursts should be generated using random function. The Output should give the gantt chart,
turnaround time and waiting time for each process and average times.
[ 35 Marks ]
3. Oral/Viva [ 10 Marks ]
1. Write a command line program for line editor. The file to be edited is taken as command line
argument. An empty file is opened for editing if no argument is supplied. It should display a $
Prompt to accept command for editing. Implement the following commands
a - Append
dn - Delete line number n.
dmn - Delete range of lines from m to n.
p - Print all lines. [ 35 Marks ]
2. Write the simulation program for demand paging and show the page scheduling and total
number of page faults according the MFU page replacement algorithm. Assume the memory
of n frames.
3. Oral/Viva [ 10 Marks ]
1. Write a command line program for line editor. The file to be edited is taken as command
line argument. An empty file is opened for editing if no argument is supplied. It should
display a $ Prompt to accept command for editing. Implement the following commands
a - Append
p - Print all lines.
pmn - Print range of lines from m to n
in - Insert lines at position n. [ 35 Marks ]
2. Write the simulation program for Preemptive SJF Scheduling. The arrival time and first
CPU-burst of different jobs should be input to the system. Assume the fixed I/O waiting
time ( 2 units). The next CPU-burst should be generated using random function. The
output should give the Gantt Chart, turnaround time and waiting time for each process.
Also display the average turnaround time and average waiting time.
[ 35 Marks ]
3. Oral/Viva [ 10 Marks ]
1. Write a command line program for line editor. The file to be edited is taken as command
line argument. An empty file is opened for editing if no argument is supplied. It should
display a $ Prompt to accept command for editing. Implement the following commands
a - Append
p - Print all lines
m n1 n2 - Move line n1 at n2 position.
m n1 n2 n3 - Move range of lines from n1 to n2 at n3 position.
[ 35 Marks ]
2. Write the simulation program for demand paging and show the page scheduling and total
number of page faults according the LRU page replacement algorithm. Assume the
memory of n frames.
3. Oral/Viva [ 10 Marks ]
1. Write a command line program for line editor. The file to be edited is taken as command
line argument. An empty file is opened for editing if no argument is supplied. It should
display a $ Prompt to accept command for editing. Implement the following commands
a - Append
p - Print all lines
in - Insert lines at position n
dmn - Delete lines from number m to n. [ 35 Marks ]
2. Write the simulation program for demand paging and show the page scheduling and total
number of page faults according the FIFO page replacement algorithm. Assume the
memory of n frames.
3. Oral/Viva [ 10 Marks ]
1. Write a Assembler for SMAC0 that will list the error in a programs. Error to be handled
are
a. Symbols used but not defined.
b. Symbols declared but not used.
c. Redeclaration of symbols.
Input Program :-
START 100
READ X
Y MOVER BREG,X
ADD BREG,X
X MOVEM AREG,Z
STOP
X DS 1
Y DS 1
END [ 35 Marks ]
2. Write the simulation program for demand paging and show the page scheduling and total
number of page faults according the FIFO Page Replacement algorithm. Assume the
memory of n frames.
3. Oral/Viva [ 10 Marks ]
1. Write a Assembler for SMAC0 that will list the errors in a program. Errors to be handled
are
a. Invalid Statement
b. Invalid Mnemonic
Input Program :-
START 100,2
READ A
MOVER A,AREG
ADD AREG,A
A MOVEM AREG,=’2’
STOP
X DS 1
Y DS 1
END [ 35 Marks ]
2. Write a program that behaves like shell (Command Interpreter). It should display the
command prompt as “MyShell$”. Any shell command shall be executed from your shell by
starting child process to execute the program corresponding to the given command.
Additionally it should interpret the following commands
count -c filename :- To print number of characters in the file.
count -w filename :- To print the number of words in file.
count -l filename :- To print number of lines in file.
[ 35 Marks ]
3. Oral/Viva [ 10 Marks ]
1. Write a Assemble for SMAC0 that will display the contents of Symbol Table, Literal Table
and Pool Table.
START 100
MOVER BREG,=’ 7’
MOVER AREG,=’1’
MOVER AREG,A
LTORG
MOVER DREG,=’4’
MOVER CREG,=’1’
MOVER BREG,B
PRINT A
STOP
A DS 1
B DC ‘2’
END [ 35 Marks ]
2. Write a program that behaves like shell (Command Interpreter). It should display the
command prompt as “MyShell$”. Any shell command shall be executed from your shell by
starting child process to execute the program corresponding to the given command.
Additionally it should interpret the following commands
typeline +n filename :- To print first n lines in the file.
typeline -n filename :- To print last n lines in the file.
Typeline -a filename :- To print all line in the file. [ 35 Marks ]
3. Oral/Viva [ 10 Marks ]
1. Write a Assemble for SMAC0 that will display the contents of Symbol Table, Literal Table and
Pool Table.
START 100
MOVER BREG,=’ 7’
MOVER AREG,=’1’
MOVER AREG,A
LTORG
MOVER DREG,=’4’
MOVER CREG,=’1’
MOVER BREG,B
PRINT A
STOP
A DS 1
B DC ‘2’
END [ 35 Marks ]
2. Consider the following snapshot of a system.
3. Oral/Viva [ 10 Marks ]
1. Write a macro per-processor that will display the contents of MNT, MDT, PNTAB, KPDTAB
for the following macro
MACRO
CALC &A,&B,®=CREG,&OP=MULT
MOVER ®,&A
&OP ®,&B
MOVEM ®,&A
MEND
START 100
READ X
READ Y
CALCAL X,Y,&OP=ADD
PRINT X
STOP
X DS 1
Y DS 1
END [ 35 Marks ]
2. Write a program that behaves like shell (Command Interpreter). It should display the
command prompt as “MyShell$”. Any shell command shall be executed from your shell by
starting child process to execute the program corresponding to the given command.
Additionally it should interpret the following commands
list -f dirname :- To print names of all the files in current directory.
list -n dirname :- To print the number of all entries in the current directory.
list -i dirname :- To print names and inodes of the files in the current directory.
[ 35 Marks ]
3. Oral/Viva [ 10 Marks ]
1. Write a macro per-processor that will display the contents of MNT, PNTAB, KPDTAB, APT
for the following macro
MACRO
OPERT &A, &B ,&LAB=,®=CREG,&OP=MULT
&LAB MOVER ®,&A
&OP ®,&B
MOVEM ®,&A
MEND
START 100
READ X
READ Y
OPERT X,Y,&LAB=LOOP,&OP=ADD
PRINT X
STOP
X DS 1
Y DS 1
END [ 35 Marks ]
3. Oral/Viva [ 10 Marks ]
1. Write a macro per-processor that will display the contents of MDT and perform macro
expansion.
MACRO
INCR &X,&Y,&Z
MOVER ®,&X
SUB ®,&Y
MOVEM ®,&Z
MOVEM ®,&X
MEND
START 100
READ A
READ B
INCR A,B,K
PRINT K
STOP
X DS 1
Y DS 1
K DS 1
END [ 35 Marks ]
2. Write a program that behaves like shell (Command Interpreter). It should display the
command prompt as “MyShell$”. Any shell command shall be executed from your shell by
starting child process to execute the program corresponding to the given command.
Additionally it should interpret the following commands
list -f dirname :- To print names of all the files in current directory.
list -n dirname :- To print the number of all entries in the current directory.
list -i dirname :- To print names and inodes of the files in the current directory.
[ 35 Marks ]
3. Oral/Viva [ 10 Marks ]
MACRO
INCR &X,&Y,&Z
MOVER ®,&X
SUB ®,&Y
MOVEM ®,&Z
MOVEM ®,&X
MEND
START 100
READ A
READ B
INCR A,B,K
PRINT K
STOP
X DS 1
Y DS 1
K DS 1
END [ 35 Marks ]
3. Oral/Viva [ 10 Marks ]
1. Implement DFA Driver for following language L= ‘Set of all strings that starts and end with
same letter over {a,b}’ [ 35 Marks ]
2. Write the simulation program using FCFS scheduling algorithm. The arrival time and first
CPU-burst of different jobs should be input to the system. Assume the fixed I/O waiting time
( 2 units). The next CPU-burst should be generated using random function. The output should
give the Gantt Chart, turnaround time and waiting time for each process. Also display the
average turnaround time and average waiting time. [ 35 Marks ]
3. Oral/Viva [ 10 Marks ]
1. Implement DFA Driver for following language L= ‘Set of all strings that containing 101 over
{0,1}’ [ 35 Marks ]
2. Write the simulation program for Preemptive SJF scheduling algorithm. The arrival time and
first CPU-burst of different jobs should be input to the system. Assume the fixed I/O waiting
time (2 units). The next CPU-burst should be generated using random function. The output
should give the Gantt Chart, turnaround time and waiting time for each process. Also display
the average turnaround time and average waiting time. [ 35 Marks ]
3. Oral/Viva [ 10 Marks ]
1. Implement DFA Driver for following language L= ‘Set of all strings that starts with a, ends
with b and having substring bbc over {a,b,c}’ [ 35 Marks ]
2. Write the simulation program for Non-Preemptive SJF scheduling algorithm. The arrival time
and first CPU-burst of different jobs should be input to the system. Assume the fixed I/O waiting
time (2 units). The next CPU-burst should be generated using random function. The output should
give the Gantt Chart, turnaround time and waiting time for each process. Also display the average
turnaround time and average waiting time. [ 35 Marks ]
3.Oral/Viva [ 10 Marks ]
1. Implement DFA Driver for following language L= ‘Set of all strings that starts with a, ends
with b and having substring abb over {a,b,c}’ [ 35 Marks ]
2. Write the simulation program for Non-Preemptive Priority scheduling algorithm. The arrival
time and first CPU-burst of different jobs should be input to the system. Assume the fixed I/O
waiting time (2 units). The next CPU-burst should be generated using random function. The
output should give the Gantt Chart, turnaround time and waiting time for each process. Also
display the average turnaround time and average waiting time. [ 35 Marks ]
3. Oral/Viva [ 10 Marks ]
Write a machine language program to print -1, 0 or 1 depending on given number is negative, zero
or positive respectively. Use above instruction Opcodes. [ 35 Marks ]
2. Write a simulation program for the implementation Linked Allocation method of File
Allocation. Assume disk having n number of blocks. Randomly mark some block as
allocated and accordingly maintain the free block list. Make the use of following menu to
perform operations.
3 Oral/Viva [ 10 Marks ]
Write a machine language program to find the factorial of given number by using above
instruction Opcodes. [ 35 Marks ]
2. Write a simulation program for the implementation Index Allocation Method for File
Allocation. Assume disk having n number of blocks. Randomly mark some block as allocated
and accordingly maintain the free block list. Make the use of following menu to perform
operations.
3. Oral/Viva [ 10 Marks ]
1. Implement DFA Driver for following language L= ‘Set of all strings that starts with 00, ending
with 11 over {0,1,2}’ [ 35 Marks ]
2. Write a simulation program for the implementation Linked Allocation method of File
Allocation. Assume disk having n number of blocks. Randomly mark some block as allocated and
accordingly maintain the free block list. Make the use of following menu to perform operations.
3.Oral/Viva [ 10 Marks ]
1. Write a macro per-processor that will display the contents of MNT, MDT, PNTAB, KPDTAB
for the following macro
MACRO
CALC &A,&B,®=CREG,&OP=MULT
MOVER ®,&A
&OP ®,&B
MOVEM ®,&A
MEND
START 100
READ X
READ Y
CALCAL X,Y,&OP=ADD
PRINT X
STOP
X DS 1
Y DS 1
END [ 35 Marks ]
2. Write the simulation program for demand paging and show the page scheduling and total
number of page faults according the MRU page replacement algorithm. Assume the memory
of n frames.
Reference String : 3, 5, 7, 2, 5, 1, 2, 3, 1, 3, 5, 3, 1, 6, 2
[ 35 Marks ]
3. Oral/Viva [ 10 Marks ]
1. Write a command line program for line editor. The file to be edited is taken as command line
argument. An empty file is opened for editing if no argument is supplied. It should display a $
Prompt to accept command for editing. Implement the following commands
a - Append
pn - Print line number n.
p n,m - Print range of lines from n to m.
dn - Delete nth line. [ 35 Marks ]
2. Write a program that behaves like shell (Command Interpreter). It should display the
command prompt as “MyShell$”. Any shell command shall be executed from your shell by
starting child process to execute the program corresponding to the given command.
Additionally it should interpret the following commands
list -f dirname :- To print names of all the files in current directory.
list -n dirname :- To print the number of all entries in the current directory.
list -i dirname :- To print names and inodes of the files in the current directory.
[ 35 Marks]
3. Oral/Viva [ 10 Marks ]