Giter Club home page Giter Club logo

top_daje's Introduction

Pseudo 'top' implementation for Linux

Nicolò Della Porta & Mattia Zingaretti

Link to our repository

In this repository you will find an implementation of the pseudo "top" Linux command, which allows the user to monitor all processes' info and, possibly, to interact sending signals to them.

How it is structured

In the main folder there are two directories: src and docs. In src there are all the files containing the C implementation and their header files. In docs there are some info we have needed to get in order to implement things righteously and there is a .txt file (credits.txt) that contains the most significant links we used to understand how some things worked: in particular for the ncurses.h lib, which really simplifies things to create a TUI using C language. In addition to this, in this folder there are also some data structures we used to store processes data into (doubly linked list implementation taken from the SO repository :) ).

How it works

A ncurses window is initialised and then starts the process of crawling information from the /proc/ directory: all pid folders are read, then the /proc/[pid]/stat file is opened to read and store all process' info into an item that will be inserted into the main structure used to keep an item for each 'living' process. Once all info of all processes have been stored, it proceeds to print all these informations divided in scrollable pages. By scrolling, you can choose a process and decide whether to:

  • kill it;
  • terminate it (which basically means the same of killing it);
  • suspend it;
  • resume it (if it had been previously suspended).

How to run

To properly run our project it is needed to run the install.shscript that installs a library and creates a .bin folder used to collect binaries. We implemented a simple Makefile that makes thing easier for everyone who desires to make it run.

In particular there are three rules:

  • to compile the program:
    $ make    
In the first two cases you will also need to launch the executable created inside `.bin` directory;
  • to print all infos in stdout (useful for debug):
    $ make test   
  • to remove binaries:
    $ make clean  

top_daje's People

Contributors

mattiazingaretti avatar nyc0x avatar

Stargazers

 avatar

Watchers

 avatar  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.