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?
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
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.
C++ PROGRAMING Implement a program to evaluate simple mathematical expressions. Assume that the original expression is...
C++ PROGRAMING Implement a program to evaluate simple mathematical expressions. Assume that the original expression is provided to the program as a text string. Allowed expression tokens: brackets “(” and “)”, integers like “4”, “15”, addition “+”, subtraction “-”, multiplication “*”, division “/”. Output can be float. Trim spaces from an expression. Brackets should contain at least one operation. Make sure that an expression is validated before it is calculated; reject the invalid expressions with appropriate message. The program must...
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...
Programming Project #1 – Day Planner In this project we will develop classes to implement a...
Programming Project #1 – Day Planner In this project we will develop classes to implement a Day Planner program. Be sure to develop the code in a step by step manner, finish phase 1 before moving on to phase 2. Phase 1 The class Appointment is essentially a record; an object built from this class will represent an Appointment in a Day Planner . It will contain 5 fields: month (3 character String), day (int), hour (int), minute (int), and...
A programming team is in the process of testing a new software module. As part of...
A programming team is in the process of testing a new software module. As part of the effort, they need to estimate the success rate of the module when used with a particular operating system. To do this, they plan to run the module on a randomly selected set of computers, record how many individual runs execute properly, and use that result to calculate the sample success rate (p-hat, the number of successes divided by the total number of tests)....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT