Coder Social home page Coder Social logo

mbrav / gigachad_kernel_module Goto Github PK

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

A simple Linux Kernel module for Gigachads

License: GNU General Public License v3.0

Makefile 15.75% C 84.25%
linux linux-kernel linux-kernel-hacking linux-kernel-module

gigachad_kernel_module's Introduction

Gigachad Kernel module

This is a simple Linux Kernel module. Try it inside a VM. Don't use on your install (unless you are a Gigachad).

Gigachad loading his own Kernel module

All code is free to use. Modifications in editors besides Vim / Neovim are not allowed.

Prerequisites

On Debian-based distros Install:

apt install linux-headers-$(uname -r) gcc make build-essential libncurses-dev exuberant-ctags

Whereas, if you are on Arch, you probably don't even need to install anything because Arch is a Gigachad-teir distro by default.

I use Arch btw.

Building

make

Loading the module into your Kernel

To load the the module, you must install the .ko file. You can do so with the following make command:

sudo make install

Unloading module from your Kernel

To unload the module from your kernel run:

sudo make uninstall

Testing if the module was loaded

To test whether the module run dmesg command to check if the following message are present:

[ 3433.692029] Gigachad Kernel Module loaded!
[ 3442.597728] Gigachad Kernel Module unloaded!

BTF generation error

In case you get a similar error when running make:

Skipping BTF generation for /home/user/linux_mod/gigachad_kernel_module.ko due to unavailability of vmlinux

This is due to unavailability of vmlinux on your system. To remedy this, try installing the following package:

apt install dwarves

Then, check if the vmlinux file is located in /sys/kernel/btf by running:

ls /sys/kernel/btf

If the vmlinux file is present, copy it to the appropriate directory using the following command:

cp /sys/kernel/btf/vmlinux /usr/lib/modules/$(uname -r)/build/

If after running make once again you continue getting the error:

/bin/sh: 1: ./tools/bpf/resolve_btfids/resolve_btfids: not found

See the following solution.

Cleaning

make clean

Other info

gigachad_kernel_module's People

Contributors

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