Git Product home page Git Product logo

chardriver's Introduction

About this repo

This repository contains a simple example of a character driver module for linux and a sample of an user application to communicate with the driver.

Using the driver code

Compiling the driver

To compile the driver module run make in the build directory.

Loading the driver

Using the script

To load the driver module using the provided script use the following command:

sudo sh chardriverRun.sh 1 0

To enable tail output set the second parameter to '1'

sudo sh chardriverRun.sh 1 1

Without the script

To load the driver module without the use of the script use the following command:

sudo nsmod CharDriver.ko

Unloading the driver

Using the script

To unload the driver module using the provided script use the following command:

sudo sh chardriverRun.sh 2 0

To enable tail output set the second parameter to '1'

sudo sh chardriverRun.sh 2 1

Without the script

To load the driver module without the use of the script use the following command:

sudo rmmod CharDriver.ko

Script input options

The list of possible input/parameter combinations for the script are as follows:

sudo sh chardriverRun.sh x y
  • Parameter 1 (x):
    • 0 : dmesg
    • 1 : Load module
    • 2 : Unload module
    • 3 : Load and unload moule
  • Parameter 2 (y):
    • 0 : desable tail
    • 1 : enable tail

The above list can be obtained by running the following command:

sudo sh chardriverRun.sh

Using the user application code

Switch to the "UserApp" folder to work with the user application.

Compiling the user application

Run the following command to compile:

gcc -o UappCD.o UappCD.c

Running the user application

Run the below command to run the user application and interact with the driver:

./UappCD.o

chardriver's People

Contributors

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