Giter VIP home page Giter VIP logo

kernel-numbers-generator's Introduction

Kernel-Module-Numbers-Generator GPL Licence

Language: Español | English

👨‍🔧 This kernel module merges many interesting concepts regarding Linux and Android kernel modules development in only two /proc entries.Needless to say, it does not include any standard C library.

It`s a SMP-Safe implementation of a Linux kernel module - random digits generator (even or odd).

Particularly interesting in terms of coding since:

  • It manages a kernel doubly-linked list with ghost node (read more about them at my repo)
  • It employs kernel interruptions to fill a kernel circular buffer (configurable intervals)
  • It uses semaphores and special kernel mutexes called spin-locks which are required for a code with CPU interruptions.
  • It uses private work-queues to schedule CPU work (in this case, empty the linked list)

You can also configure and check the module parameters with the auxiliar entry /proc/modconfig

Usage

Compile, load the module, access via cat and echo to /proc/modtimer2. The first process to open and write from the file will receive even numbers randomly generated, while the second one will be feed with odd digits.

    $ make # make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

    $ sudo insmod modtimer.ko

    $ echo max_random 4 > /proc/modconfig  or  $ cat modconfig

    ...

    $ cat /proc/modtimer
    
    ...

You can check it worked with $sudo lsmod | head and reading $sudo dmesg

Loading module into Android's Kernel

The module was developed for Debian, but the can be easily used in Android. You just need to use the Makefile for re-compiling. Please notice that the Makefile employs a compiled Android-x86 kernel oreo version

License

This project is licensed under the GNU-GPL License - see the LICENSE.md file for details

kernel-numbers-generator's People

Contributors

zildj1an avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

respublic

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.