Coder Social home page Coder Social logo

27-jayagupta / floating_processes_ugp-ii Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 236.93 MB

Makefile 0.20% C 98.35% Roff 0.02% Assembly 0.80% Shell 0.33% Perl 0.10% C++ 0.03% Awk 0.01% Python 0.11% sed 0.01% Yacc 0.01% Lex 0.01% UnrealScript 0.01% Rust 0.03% SmPL 0.01% Gherkin 0.01% XS 0.01% Raku 0.01% MATLAB 0.01% Clojure 0.01%

floating_processes_ugp-ii's Introduction

Floating Processes Across Namespaces

This report contains the report, presentations, library and kernel source code done in our undergraduate project at IITK. There is also a working demo for the implementation in the directory ugp-demo.

The work was a joint work with Harshit Bansal.

Documentation

  • Detailed Weekwise documentation can be found here.

  • UGP Presentation and Report are present in Report_Presentation folder.

Setup Instruction

- Warning: The setup needs to be done on a Linux VM. Use a KVM etc to setup your virtual machine.

Building Kernel

Perform these steps inside VM after booting into default kernel.

======================= To build kernel =======================

  • Open terminal.

  • Clone the repository.

$ git clone https://git.cse.iitk.ac.in/jayagupta/ugp-ii
  • Install programs needed for kernel compilation (for ubuntu)
$ sudo apt-get update
$ sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc flex libelf-dev bison
  • Enter into linux source code directory
$ cd UGPII/linux-6.1.4/
  • Generate configuration file
$ make defconfig
  • Initiate compilation (Takes around 30 min to 1 hour to finish)
$ make -j4
  • Install modules
$ sudo make modules_install
  • Install kernel
$ sudo make install

==================== To show boot menu while booting=======================

  • If during booting, you want to pick a particular kernel to run, do the following operations. (Needs to be done only once)

  • Open grub file. You can use any editor to edit it. Needs sudo permission to edit.

$ sudo vi /etc/default/grub 
  • Make the following changes in the file
#GRUB_TIMEOUT_STYLE=hidden //Comment this line by adding ’#’ infront of it.

GRUB_TIMEOUT=30 //Change timeout value from 0 to 30 secs. Let boot menu be shown for 30 secs
  • Run following command to apply the above changes
$ sudo update-grub

● Reboot

====================== verify the new kernel install====================

Note: You can use the following command to know the kernel version that got booted.

$ uname -a

Building Kernel Module

cd UGP-II/modules
make clean
make

Building library code

cd UGP-II
make clean
make

Usage

  • Include the library migrate.h in the manager code.
#include "manager.h"
  • Inorder to build the program, insert the following in Makefile in UGP-II folder.
manager: $(SOURCE_DIR_NAME)/manager.c
	$(CC) $(CFLAGS) -I$(INC) -o $(SOURCE_DIR_NAME)/manager $(SOURCE_DIR_NAME)/manager.c $(LIB_OBJ)/migrate.a
  • Inorder to migrate a process P1 with PID p1 in the global namespace to process P2 with PID p2, use __migrate(source_pid, target_pid). This function will return the new global pid of the migrated process in the new namespace.

Instructions to run the demo

  • Build the kernel module.

  • Build the library code and ugp-demo.

cd UGP-II
make
  • Launch the pstree to setup the process tree and then launch the manager.
cd UGP-II/ugp-demo

# Terminal 1
sudo ./pstree

# Terminal 2
sudo ./manager <source_pid_of_migrating_process>

floating_processes_ugp-ii's People

Contributors

27-jayagupta avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.