Skip to content

This repository contains all the C programs that I have executed for my OS Course in my 3rd Year of Computer Science Undergrad program at Dayananda Sagar University, Bengaluru, India in Q4 2022.

Notifications You must be signed in to change notification settings

rexgraystone/os

Repository files navigation

Operating Systems

This repository contains all the C programs that I have executed for my Operating Systems Course in my 3rd Year of Computer Science Undergrad program at Dayananda Sagar University, Bengaluru, India in Q4 2022.

List of Programs

Serial No. C File Name Description
1 1_forkProcess.c A C program to create a new process that executes a new program using the following system calls: fork(), execlp() & wait().
2 2_processID.c A C program to display PID and PPID using system calls getpid() & getppid().
3 3_fileOperations.c A C program using I/O system calls open(), read() & write() to copy contents of one file to another file.
4 4_multiThreading.c A C program to implement multithreaded program using pthreads.
5 5_roundRobin.c A C program to simulate the Round Robin CPU scheduling algorithms.
6 6_producerConsumer.c A C program to simulate producer-consumer problem using semaphores.
7 7_bankersAlgorithm.c A C program to implement Banker's Algorithm.
8 8_fifoPage.c A C program to implement FIFO page replacement algorithm.
9 9_singleLevelFile.c A C program to implement single level directory structure.
10 10_indexedFile.c A C program to implement indexed file directory structure.

Miscellaneous Programs

Serial No. C File Name Description
1 M1_linearSearch.c A C program to search for a key element in an array using linear search algorithm.
2 M2_binarySearch.c A C program to implement Binary Search using Recursion.
3 M3_palindromeCheck.c A C program to find whether a given string is a palindrome or not.

How to Run

  1. Ensure that you have a C compiler installed on your system.

    gcc --version

    It should look something like this GCC Version

    If you don't have a C compiler installed, you can download one from here or using your package manager.

    Examples:

    • Ubuntu -
    sudo apt install gcc
    • Arch Linux -
    sudo pacman -S gcc
    • macOS -
    brew install gcc

    Additionaly, if you are using Windows, follow the steps specified here.

  2. Clone the repository running the following command in your preferred terminal:

    gh repo clone rexgraystone/os

    or

    git clone https://github.com/rexgraystone/os.git
  3. Change the directory to the cloned repository:

    cd os
  4. Compile the C program using the following command:

    gcc <C File Name> -o <Output File Name>
  5. Run the program using the following command:

    ./<Output File Name>

Note

The programs are written in C and compiled using GCC compiler on macOS Ventura 13.0. These programs will work on any Linux distribution and macOS. However, the programs may not work on Windows. To avoid facing issues on Windows, it is recommended to use a virtual machine with a Linux distribution instead.

About

This repository contains all the C programs that I have executed for my OS Course in my 3rd Year of Computer Science Undergrad program at Dayananda Sagar University, Bengaluru, India in Q4 2022.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages