Giter Club home page Giter Club logo

ansanjay / kernelthreads Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 149 KB

Explore diverse Linux Kernel Thread examples demonstrating race conditions, parallel executions, processor ID retrievals, and more, with structured subdirectories containing explanatory READMEs, source code, and Makefiles.

License: GNU General Public License v3.0

Makefile 11.82% C 88.18%
kernel-module kernel-thread linux-kernel multithreading race-condition thread-management processor-id

kernelthreads's Introduction

Kernel Thread Examples ๐Ÿš€

This repository contains multiple practical examples demonstrating the creation and management of Kernel Threads in Linux. It consists of various scenarios, depicting race conditions, parallel execution of threads, processor IDs associated with threads, and more.

Structure ๐Ÿ“‚

The repository is structured with individual directories, each hosting the files related to specific kernel thread examples. Here's a brief overview:

  • 10_unique_kernel_thread: Illustrates a unique kernel thread scenario.

    • test.c: Contains the source code for the kernel thread.
    • Makefile: The makefile to compile the module.
  • 11_kernel_thread: Demonstrates the creation of kernel threads.

    • kthread_test.c: Source code demonstrating kernel thread creation.
    • Makefile: Makefile for building the module.
  • 12_no_stop: Represents a kernel thread scenario where the threads are not stopped.

    • kthread_tst.c: Contains the example code.
    • Makefile: The makefile to compile the module.
    • readme.md: Additional information regarding this example.
  • 13_kernel_thread: Shows how to identify the processor id on which the thread is running.

    • processor_id.c: The source code illustrating processor ID identification.
    • Makefile: The makefile for building the module.
    • readme.md: Provides detailed explanations and instructions.
  • 14_race_condition: Demonstrates a scenario of race condition in kernel threads.

    • hello.c: The source code showcasing race conditions.
    • Makefile: The makefile for the module.
    • readme.md: Detailed documentation and instructions related to the scenario.
  • 7_kernel_thread, 8_kernel_thread, 9_parallel_kernel_thread: Other various scenarios depicting different aspects and features of kernel threads in Linux.

  • LICENSE: The license file for this repository.

  • README.md: The file you are currently viewing.

Compilation & Execution ๐Ÿ› ๏ธ

To compile any example:

  1. Navigate to the respective directory:
    cd <directory_name>
  2. Run make to compile the module:
    make
  3. Insert the module into the kernel:
    insmod <module_name>.ko
  4. Check the dmesg logs or /var/log/kern.log to see the output and any possible messages from the module:
    dmesg
  5. To remove the module from the kernel, use:
    rmmod <module_name>

Contribution ๐ŸŒ

Feel free to contribute to this repository by creating a pull request. For major changes, please open an issue first to discuss what you would like to change.

License ๐Ÿ“

This project is licensed under the terms of the included LICENSE file.

kernelthreads's People

Contributors

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