Posts

CSL 204 OPERATING SYSTEM LAB KTU IV SEM CSE

About Me Syllabus Scheme Program List Linux Basics 1. Linux History and GNU 2. Linux Basic Features and Architecture 3. How to Install Linux 4. Install Linux Inside Windows using WSL 5. Free software 6. Linux Chronology 7 .Package Management 8 .Compile and install from source 9 .Important Directories 10. File Permissions 11. Special Permissions 12 .Shell 13. Bash shell in windows 10 14 .Basic Linux command for beginners 15. Input Output Redirection  16. Directory Commands 17. File Commands 18 .Communication Commands 19. Information Commands  20 .IO Commands   21 .Process Management Commands 22. Account Administration Commands 23. Pipes and Filters  24. Top 100 commands to learn. Shell Programming 1. Shell Script 2. Arithmetic Expressions 3. Special Shell Variables 4. Shell Script for getting important info 5. if and case statement 6. looping statements while,until,for 7. Menu driven Programs 8. GUI Menus 9. Functions in scripts 10. String Handling 11. Command line arguments in scripts

Questions

OPERATING SYSTEMS LAB - PRACTICE QUESTIONS 1. Write a program to create a process in linux. 2. Write programs using the following system calls of Linux operating system: fork, exec, getpid, exit, wait, close, stat, opendir, readdir 3. Write programs using the I/O system calls of Linux operating system (open, read, write) 4. Given the list of processes, their CPU burst times and arrival times, display/print the Gantt chart for FCFS and SJF. For each of the scheduling policies, compute and print the average waiting time and average turnaround time 5. Write a C program to simulate following non-preemptive CPU scheduling algorithms to find turnaround time and waiting time. a)FCFS b) SJF c) Round Robin (pre-emptive) d) Priority 6. Write a C program to simulate following contiguous memory allocation techniques a) Worst-fit b) Best-fit c) First-fit 7. Write a C program to simulate paging technique of memory management. 8. Write a C program to simulate Bankers algorithm for the purpose of dead

Syllabus - CST 204 OPERATING SYSTEM LAB

SYLLABUS OPERATING SYSTEMS LAB 1. Basic Linux commands 2. Shell programming -Command syntax -Write simple functions with basic tests, loops, patterns 3. System calls of Linux operating system:* fork, exec, getpid, exit, wait, close, stat, opendir, readdir 4. Write programs using the I/O system calls of Linux operating system (open, read, write) 5. Implement programs for Inter Process Communication using Shared Memory * 6. Implement Semaphores* 7. Implementation of CPU scheduling algorithms. a) Round Robin b) SJF c) FCFS d) Priority * 8. Implementation of the Memory Allocation Methods for fixed partition* a) First Fit b) Worst Fit c) Best Fit 9. Implement l page replacement algorithms a) FIFO b) LRU c) LFU* 10. Implement the banker’s algorithm for deadlock avoidance. * 11. Implementation of Deadlock detection algorithm 12. Simulate file allocation strategies. b) Sequential b) Indexed c) Linked 13. Simulate disk scheduling algorithms. * c) FCFS b)SCAN c) C-SCAN * mandatory

Scheme - CST 204 Operating System Lab

 

Shell script for important info

 Show Currently logged  users  ( w or who -H)      Show only the user name of logged users in the host  ( users)      Details of last login  ( last mec  ;where mec is the user id )  About your OS and version, release number, kernel version                                                  ( uname -a or  cat  /proc/version)  Show all available shells  ( cat /etc/shells )  Show mouse settings  (cat  /sys/class/input/mouse*/device/name )  Show computer CPU information       CPU details       ( cat /proc/cpuinfo | more )       Show information on  CPU architecture  ( lscpu)       Number of Processor core  ( nproc)  Show memory information       Memory details  ( cat /proc/meminfo | more )       Display file system disk usage  ( df -h )       Display the amount of free and used memory  ( free)        Virtual memory statistics  ( vmstat)  File system Mounted  ( findmnt or cat /proc/mounts) Note: There are some advanced command like  lshw  which will list complete hardware details.  The

Shell Variables

  Write shell scripts to show the following  ( you can write menu driven programs)  Currently logged user and his logname    ( logname, id -un, echo $USER)  Your current shell (  echo $SHELL)  Your home directory  ( echo $HOME)  Your operating system type  (echo $OSTYPE)  Your current path setting  ( echo $PATH)  Your current working directory  ( echo $PWD )

Top 100 commands to learn

clear- Clear the screen cd — Change directory ls — List directory contents pwd — Print working directory cat — Concatenate and display files touch — Create an empty file cp — Copy files and directories mv — Move or rename files and directories rm — Remove files and directories mkdir — Create a new directory rmdir — Remove an empty directory cut — Cut out sections of a file gzip — Compress or decompress files using gzip gunzip — Decompress files compressed with gzip find — Find files and directories matching a pattern grep — Search for a pattern in a file awk — Pattern scanning and processing language sed — Stream editor for filtering and transforming text head — Display the first few lines of a file tail — Display the last few lines of a file sort — Sort lines of a file uniq — Remove duplicate lines from a file wc — Count lines, words, and characters in a file diff — Compare two files line by line chmod — Change permissions of files and directories chown — Change the owner of a file or