Question

In: Computer Science

Kernal Modul Programing Quenstion : Implement the following 4 conditions in kernel module programming. 1. Implement...

Kernal Modul Programing

Quenstion : Implement the following 4 conditions in kernel module programming.

1. Implement a timer module using the timer function provided by the file LINUX/timer.h
2. In module_init, the timer is initialized using setup_timer and called mod_timer to start the timer.
3. Call back function my_timer_callback when timer expires.
4. When you remove a module, delete the timer.

Solutions

Expert Solution

/**

* @file    hello.c

* @author Akshat Sinha

* @date 16 oct 2020

* @version 0.1

* @brief An introductory "Hello World!" loadable kernel

* module (LKM) that can display a message in the /var/log/kern.log

* file when the module is loaded and removed. The module can accept

* an argument when it is loaded -- the name, which appears in the

* kernel log files.

*/

#include <linux/module.h>     /* Needed by all modules */

#include <linux/kernel.h>     /* Needed for KERN_INFO */

#include <linux/init.h>       /* Needed for the macros */

  

///< The license type -- this affects runtime behavior

MODULE_LICENSE("GPL");

  

///< The author -- visible when you use modinfo

MODULE_AUTHOR("Akshat Sinha");

  

///< The description -- see modinfo

MODULE_DESCRIPTION("A simple Hello world LKM!");

  

///< The version of the module

MODULE_VERSION("0.1");

  

static int __init hello_start(void)

{

    printk(KERN_INFO "Loading hello module...\n");

    printk(KERN_INFO "Hello world\n");

    return 0;

}

  

static void __exit hello_end(void)

{

    printk(KERN_INFO "Goodbye Mr.\n");

}

  

module_init(hello_start);

module_exit(hello_end);


Related Solutions

This program focuses on programming with Java Collections classes. You will implement a module that finds...
This program focuses on programming with Java Collections classes. You will implement a module that finds a simplified Levenshtein distance between two words represented by strings. Your program will need support files LevenDistanceFinder.Java, dictionary.txt, while you will be implementing your code in the LevenDistanceFinder.java file. INSTRUCTIONS The Levenshtein distance, named for it's creator Vladimir Levenshtein, is a measure of the distance between two words. The edit distance between two strings is the minimum number of operations that are needed to...
Implement the following function in the PyDev module functions.py and test it from a PyDev module...
Implement the following function in the PyDev module functions.py and test it from a PyDev module named : def statistics(n): """ ------------------------------------------------------- Asks a user to enter n values, then calculates and returns the minimum, maximum, total, and average of those values. Use: minimum, maximum, total, average = statistics(n) ------------------------------------------------------- Parameters: n - number of values to process (int > 0) Returns: minimum - smallest of n values (float) maximum - largest of n values (float) total - total of...
Implement the following function in the PyDev module functions.py and test it from a PyDev module...
Implement the following function in the PyDev module functions.py and test it from a PyDev module named : def gym_cost(cost, friends): """ ------------------------------------------------------- Calculates total cost of a gym membership. A member gets a discount according to the number of friends they sign up. 0 friends: 0% discount 1 friend: 5% discount 2 friends: 10% discount 3 or more friends: 15% discount Use: final_cost = gym_cost(cost, friends) ------------------------------------------------------- Parameters: cost - a gym membership base cost (float > 0) friends...
Interger Programming and Nonlinear Programing are two important extensions of the basic Simplex Linear Programing model....
Interger Programming and Nonlinear Programing are two important extensions of the basic Simplex Linear Programing model. How does each differ from Simplex in theory and practice? How does Solver adjust for these two extensions? What about Rosenbrock’s method, cutting plane procedure, and interior point methods?
Use Java programming to implement the following: Implement the following methods in the UnorderedList class for...
Use Java programming to implement the following: Implement the following methods in the UnorderedList class for managing a singly linked list that cannot contain duplicates. Default constructor Create an empty list i.e., head is null. boolean insert(int data) Insert the given data into the end of the list. If the insertion is successful, the function returns true; otherwise, returns false. boolean delete(int data) Delete the node that contains the given data from the list. If the deletion is successful, the...
Module 2 Programming Assignment – Battleship Refactor Refactor your Battleship drawing code from Module 1. Download...
Module 2 Programming Assignment – Battleship Refactor Refactor your Battleship drawing code from Module 1. Download the OO template for the basic battleship game, BattleshipRefactor.zip (refer below) The template has the outline of a battleship game using OO constructs. You need to add the Grid class and complete the code so that it runs correctly. At a minimum, you need to complete the Draw and DropBomb methods with code similar to the previous assignment. There will be changes due to...
programing language JAVA: Design and implement an application that reads a sentence from the user, then...
programing language JAVA: Design and implement an application that reads a sentence from the user, then counts all the vowels(a, e, i, o, u) in the entire sentence, and prints the number of vowels in the sentence. vowels may be upercase
java programing project Implement a program that computes the Fibonacci of a specified number, the factorial...
java programing project Implement a program that computes the Fibonacci of a specified number, the factorial of a specified number, or estimates the value of 'e' using the specified number of iterations (of a Taylor series). Please feel free to use the Internet to find resources that explain how to estimate the value of 'e' using a Taylor series. In the case of no or invalid number of parameters, the program should show help instructions that looks like: --- Assign...
implement a JavaFX program to demonstrate skills and knowledge using the following: 1.General Java programming skills...
implement a JavaFX program to demonstrate skills and knowledge using the following: 1.General Java programming skills (e.g. conditionals, branching and loops) as well as object-oriented concepts) 2. Writing JavaFX applications incl. using fxml 3. • GUI Layouts (organizing UI controls) I just need some samples and explanations.
8a) In Windows system programming, many system resources are represented as kernel objects, each of which...
8a) In Windows system programming, many system resources are represented as kernel objects, each of which is represented as a handle. Discuss with 3 examples how the system programmer can manipulate these handle objects. AP, 8 b) Write a C/C++ system program to move a file from one folder to another in the Windows file system. Compile and run the program and copy the source code into your answer booklet. CR,10 c) Compare and contrast processes and threads and discuss...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT