You are on page 1of 25

UNIVERSITY OF PUNE

T.Y.B.Sc. (Computer Science) Practical Examination, March/October


Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

1. Write a program for SMAC0 that supports following instruction set.

Mnemonic Opcode Meaning


ADD 01 Add memory operand to register.
SUB 02 Subtract memory operand from register.
MULT 03 Multiply memory operand to register.
MOVER 04 Move memory operand to register.
MOVEM 05 Move register to memory.
COMP 06 Compare register with memory operand.
BC 07 Branch to given address based on condition code in first
operand.
DIV 08 Divide register by memory operand.
READ 09 Read input value.
PRINT 10 Print given value.
STOP 11 Stop the execution of machine language program

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 ]

-------------------- Slip 1 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

1. Write a program for SMAC0 that supports following instruction set.

Mnemonic Opcode Meaning


ADD 09 Add memory operand to register.
SUB 10 Subtract memory operand from register.
MULT 07 Multiply memory operand to register.
MOVER 01 Move memory operand to register.
MOVEM 02 Move register to memory.
COMP 05 Compare register with memory operand.
BC 06 Branch to given address based on condition code in first
operand.
DIV 08 Divide register by memory operand.
READ 03 Read input value.
PRINT 04 Print given value.
STOP 11 Stop the execution of machine language program

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.

a. Allocate space for new file.


b. Deallocate space of a deleted file.
c. Show used space/free space on disk.
d. Exit.
[ 35 Marks ]

3. Oral/Viva [ 10 Marks ]

-------------------- Slip 2 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

1. Write a program for SMAC0 that supports following instruction set.

Mnemonic Opcode Meaning


ADD 04 Add memory operand to register.
SUB 05 Subtract memory operand from register.
MULT 08 Multiply memory operand to register.
MOVER 06 Move memory operand to register.
MOVEM 07 Move register to memory.
COMP 11 Compare register with memory operand.
BC 10 Branch to given address based on condition code in first
operand.
DIV 09 Divide register by memory operand.
READ 01 Read input value.
PRINT 02 Print given value.
STOP 03 Stop the execution of machine language program

Write a machine language program to find the GCD of given 2 numbers by using above
instruction Opcodes. [ 35 Marks ]

2. Consider the following snapshot of a system.

Job Allocation MAX Available


A B C A B C A B C
P0 0 1 0 7 5 3 3 3 2
P1 2 0 0 3 2 2
P2 3 0 2 9 0 2
P3 2 1 1 2 2 2
P4 0 0 2 4 3 3

A) Display the contents of Need Matrix.


B) Check whether the system is in safe state or not. If yes give the safe sequence.
C) If request from process p1 arrives as (1,0,2) can it be granted immediately.

[ 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

Duration : 3 Hrs Max Marks : 80

1. Write a program for SMAC0 that supports following instruction set.

Mnemonic Opcode Meaning


ADD 03 Add memory operand to register.
SUB 02 Subtract memory operand from register.
MULT 05 Multiply memory operand to register.
MOVER 09 Move memory operand to register.
MOVEM 08 Move register to memory.
COMP 11 Compare register with memory operand.
BC 10 Branch to given address based on condition code in first
operand.
DIV 04 Divide register by memory operand.
READ 07 Read input value.
PRINT 06 Print given value.
STOP 01 Stop the execution of machine language program

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 ]

-------------------- Slip 4 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

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.

Reference String : 3, 5, 7, 2, 5, 1, 2, 3, 1, 3, 5, 3, 1, 6, 2 [ 35 Marks ]

3. Oral/Viva [ 10 Marks ]

-------------------- Slip 5 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

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 ]

-------------------- Slip 6 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

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.

Reference String : 3, 4, 5, 4, 3, 4, 7, 2, 4, 5, 6, 7, 2, 4, 6 [ 35 Marks ]

3. Oral/Viva [ 10 Marks ]

-------------------- Slip 7 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

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.

Reference String : 3, 4, 5, 4, 3, 4, 7, 2, 4, 5, 6, 7, 2, 4, 6 [ 35 Marks ]

3. Oral/Viva [ 10 Marks ]

-------------------- Slip 8 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

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.

Reference String : 3, 4, 5, 6, 3, 4, 7, 3, 4, 5, 6, 7, 2, 4, 6 [ 35 Marks ]

3. Oral/Viva [ 10 Marks ]

-------------------- Slip 9 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

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 ]

-------------------- Slip 10 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

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 ]

-------------------- Slip 11 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

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.

Job Allocation MAX Available


A B C A B C A B C
P0 0 1 0 7 5 3 3 3 2
P1 2 0 0 3 2 2
P2 3 0 2 9 0 2
P3 2 1 1 2 2 2
P4 0 0 2 4 3 3

A) Display the contents of Need Matrix.


B) Check whether the system is in safe state or not. If yes give the safe sequence.

3. Oral/Viva [ 10 Marks ]

-------------------- Slip 12 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

1. Write a macro per-processor that will display the contents of MNT, MDT, PNTAB, KPDTAB
for the following macro

MACRO
CALC &A,&B,&REG=CREG,&OP=MULT
MOVER &REG,&A
&OP &REG,&B
MOVEM &REG,&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 ]

-------------------- Slip 13 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

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=,&REG=CREG,&OP=MULT
&LAB MOVER &REG,&A
&OP &REG,&B
MOVEM &REG,&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 ]

2. Consider the following snapshot of a system.

Job Allocation MAX Available


A B C D A B C D A B C D
P0 0 5 3 2 5 5 3 2 1 5 2 0
P1 0 1 1 2 0 1 1 2
P2 1 0 0 0 1 7 5 0
P3 1 4 6 4 2 4 6 6
P4 0 0 1 4 0 6 5 6
A) Display the contents of Need Martix
B) Check whether the system is in safe state or not. If yes give the safe sequence.
C) If request from process p4 arrives as (0,0,4,1) can it be granted immediately
[ 35 Marks ]

3. Oral/Viva [ 10 Marks ]

-------------------- Slip 14 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

1. Write a macro per-processor that will display the contents of MDT and perform macro
expansion.

MACRO
INCR &X,&Y,&Z
MOVER &REG,&X
SUB &REG,&Y
MOVEM &REG,&Z
MOVEM &REG,&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 ]

-------------------- Slip 15 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

1. Write a macro per-processor that will display the contents of MDT.

MACRO
INCR &X,&Y,&Z
MOVER &REG,&X
SUB &REG,&Y
MOVEM &REG,&Z
MOVEM &REG,&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 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.

a. Allocate space for new file.


b. Deallocate space of a deleted file.
c. Show used space/free space on disk.
d. Exit.
[ 35 Marks ]

3. Oral/Viva [ 10 Marks ]

-------------------- Slip 16 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

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 ]

-------------------- Slip 17 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

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 ]

-------------------- Slip 18 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

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 ]

-------------------- Slip 19 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

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 ]

-------------------- Slip 20 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

1. Write a program for SMAC0 that supports following instruction set.

Mnemonic Opcode Meaning


ADD 03 Add memory operand to register.
SUB 02 Subtract memory operand from register.
MULT 05 Multiply memory operand to register.
MOVER 09 Move memory operand to register.
MOVEM 08 Move register to memory.
COMP 11 Compare register with memory operand.
BC 10 Branch to given address based on condition code in first
operand.
DIV 04 Divide register by memory operand.
READ 07 Read input value.
PRINT 06 Print given value.
STOP 01 Stop the execution of machine language program

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.

d. Allocate space for new file.


e. Deallocate space of a deleted file.
f. Show used space/free space on disk.
g. Exit.
[ 35 Marks ]

3 Oral/Viva [ 10 Marks ]

-------------------- Slip 21 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

1. Write a program for SMAC0 that supports following instruction set.

Mnemonic Opcode Meaning


ADD 11 Add memory operand to register.
SUB 10 Subtract memory operand from register.
MULT 09 Multiply memory operand to register.
MOVER 08 Move memory operand to register.
MOVEM 07 Move register to memory.
COMP 06 Compare register with memory operand.
BC 05 Branch to given address based on condition code in first
operand.
DIV 04 Divide register by memory operand.
READ 03 Read input value.
PRINT 02 Print given value.
STOP 01 Stop the execution of machine language program

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.

h. Allocate space for new file.


i. Deallocate space of a deleted file.
j. Show used space/free space on disk.
k. Exit.
[ 35 Marks ]

3. Oral/Viva [ 10 Marks ]

-------------------- Slip 22 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

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.

a. Allocate space for new file.


b. Deallocate space of a deleted file.
c. Show used space/free space on disk.
d. Exit.
[ 35 Marks ]

3.Oral/Viva [ 10 Marks ]

-------------------- Slip 23 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

1. Write a macro per-processor that will display the contents of MNT, MDT, PNTAB, KPDTAB
for the following macro

MACRO
CALC &A,&B,&REG=CREG,&OP=MULT
MOVER &REG,&A
&OP &REG,&B
MOVEM &REG,&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 ]

-------------------- Slip 24 -------------------


UNIVERSITY OF PUNE
T.Y.B.Sc. (Computer Science) Practical Examination, March/October
Lab Course I : System Programming & Operating System

Duration : 3 Hrs Max Marks : 80

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 ]

-------------------- Slip 25 -------------------

You might also like