Coder Social home page Coder Social logo

tereius / lehmerchardev Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 7 KB

A kernel module that provides a character device generating pseudorandom numbers using Lehmer generator

CMake 34.51% C++ 45.20% C 20.28%
kernel-module pseudorandom-number-generator

lehmerchardev's Introduction

LehmerCharDev

Provides a very fast pseudorandom number generator (named after D. H. Lehmer) as a kernel character device. This devices writes pseudorandom numbers at comparable speeds to /dev/zero and can be used for I/O filesystem benchmarks. Please make sure that you never use this device for cryptographic purposes!

To give you an idea of the transfer rates I ran some tests with dd tool:

dd bs= /dev/lehmer /dev/zero
1 3.0 MB/s 3.8 MB/s
512 1.5 GB/s 1.8 GB/s
4k 4.9 GB/s 10.4 GB/s

How to install

Besides the essential build infrastructure (gcc, make, binutils) you need CMake and the kernel headers of your current kernel.

To build the kernel module just run:

cmake ./ -G "Unix Makefiles" -B ./build_dir
cmake --build ./build_dir

To install the kernel module and add the character device /dev/lehmer:

cmake --build ./build_dir --target install

If the install command fails with "Required key not available" you probably have to disable Secure Boot in UEFI settings.

How to use

You should be abel to use the device like so:

cat /dev/lehmer

To measure the transfer rates run:

dd if=/dev/lehmer of=/dev/null bs=512 count=10000

How to uninstall

To uninstall the kernel module and character device:

cmake --build ./build_dir --target uninstall

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.