SPOS LAB

 System Programming and Operating Systems Laboratory

By Mr. VK

Complete SPOSL (Windows)

SPOS LAB ZIP (Windows & Linux)


Assignment 1 (Pass 1 of 2 Pass Assembler)

Problem Statement: Design suitable data structures and implement pass-I of a two-pass assembler for a pseudo-machine using object-oriented feature. Implementation should consist of a few instructions from each category and few assembler directives. 

Input: 

  1. data.txt (Pneumonic Opcode Table)
  2. input.txt (Assembly Language Program)

Output:

  1. literaltab.txt (Literal Table)
  2. phase1.txt (Intermediate Code)
  3. pool.txt (Pool Table)
  4. symtab.txt (Symbol Table)

Steps:

  1. g++ ass1.cpp
  2. a.exe //for Windows
  3. ./a.out //for Linux



Assignment 2 (Pass 2 of 2 Pass Assembler)

Problem Statement: Implement Pass-II of two pass assembler for a pseudo-machine using object-oriented features. The output of assignment-1 (intermediate file and symbol table) should be input for this assignment.

Input: 

  1. symtab.txt (Symbol Table)
  2. literaltab.txt (Literal Table)
  3. intermediate.txt (Intermediate Code)

Output:

  1. Pass2.txt (Machine Code)

Steps:

  1. python3 ass2s.py



Assignment 3 (Pass 1 of 2 Pass Macro Processor)

Problem Statement: Design suitable data structures and implement pass-I of a two-pass macro-processor using OOP features. 

Input: 

  1. input.txt (Assembly Code without Macros)

Output:

  1. aal.txt (Argument Array List)
  2. intermediate.txt (Intermediate Code)
  3. mdt.txt (Macro Definition Table)
  4. mnt.txt (Macro Name Table)

Steps:

  1. python3 ass3.py


Assignment 4 (Pass 2 of 2 Pass Macro Processor)

Problem Statement: Write a program for pass-II of a two-pass macro-processor. The output of assignment-3 (MNT, MDT and file without any macro definitions) should be input for this assignment.

Input: 

  1. ala.txt (Argument List Array)
  2. input.txt (Intermediate Code)
  3. mdt.txt (Macro Definition Table)
  4. mnt.txt (Macro Name Table)

Output:

  1. output.txt (Assembly Code without Macros)

Steps:

  1. python3 pass2.py


Assignment 5 (Lexical Analysis Using Lex tool)

Problem Statement: Write a program using Lex specifications to implement lexical analysis phase of compiler to generate tokens of subset of ‘C’ program.

Input: 

  1. A1.l (Lex Program)
  2. sample.txt (Sample Code)

Output:

  1. lex.yy.c (Lex Output C Program)
  2. a.exe (Executable File)

Steps:

  1. lex A1.l
  2. gcc lex.yy.c
  3. a.exe //for Windows
  4. ./a.out //for Linux


Assignment 6 (Syntax Analysis Using Lex and YACC tool Code Analysis)

Problem Statement: Write a program using YACC specifications to implement syntax analysis phase of compiler to validate type and syntax of variable declaration in C program.

Input: 

  1. ass6.l (Lex Program)
  2. ass6.y (Y Program)
  3. ass6.tab.c
  4. ass6.tab.h

Output:

  1. lex.yy.c (Lex Output C Program)
  2. a.exe (Executable File)

Steps:

  1. lex ass6.l
  2. bison -dy ass6.y
  3. gcc lex.yy.c ass6.tab.c
  4. a.exe //for Windows
  5. ./a.out //for Linux


Assignment 7 (Syntactic Analysis Using Lex & YACC tool Simple & Compound Statement)

Problem Statement: Write a program using YACC specifications to implement syntax analysis phase of compiler to recognize simple and compound sentences given in input file.

Input: 

  1. ass6.l (Lex Program)
  2. ass6.y (Y Program)
  3. ass6.tab.c
  4. ass6.tab.h

Output:

  1. lex.yy.c (Lex Output C Program)
  2. a.exe (Executable File)

Steps:

  1. lex ass6.l
  2. bison -dy ass6.y
  3. gcc lex.yy.c ass6.tab.c
  4. a.exe //for Windows
  5. ./a.out //for Linux


Assignment 8 (CPU Scheduling Algorithms)

Problem Statement: Write a program to implement following CPU scheduling algorithms: FCFS, SJF (Non Preemptive), Priority (Non-Preemptive) and Round Robin (Preemptive)

Steps:

  1. python FCFS.py
  2. python sjf.py
  3. python priority.py
  4. python rr.py
OR
  1. gcc spos8.c
  2. a.exe //for Windows
  3. ./a.out //for Linux


Assignment 9 (Unix System Calls ps, fork, join, exec Process Management)

Problem Statement: Implement UNIX system calls like ps, fork, join, exec family, and wait for process management (use shell script/ Java/ C programming).

Steps:

  1. g++ as9.cpp
  2. a.exe //for Windows
  3. ./a.out //for Linux


Assignment 10 (Page Replacement Algorithms)


Problem Statement: Write a Program to implement page replacement simulation using following algorithms 1. FIFO 2. LRU and 3. Optimal

Steps:

  1. gcc ass10.c
  2. a.exe //for Windows
  3. ./a.out //for Linux


Comments