May 2019
Intermediate to advanced
356 pages
9h 6m
English
This time, we have to use a modified version of our chrdev driver. In the chapter_07/chrdev/ directory of the GitHub repository, we can find the chrdev_irq.c and chrdev_irq.h files, which implement our modified driver.
We can still use chrdev-req.ko to generate the chrdev devices within the system, but now the kernel module will be used chrdev_irq.ko instead of chrdev.ko.
Also, since we have a real peripheral, we can simulate the IRQ using a kernel timer (see Chapter 5, Managing Interrupts and Concurrency), which also triggers data generation using the following get_new_char() function:
/* * Dummy function to generate data */static char get_new_char(void){ static char d = 'A' - 1; if (++d == ('Z' + 1)) d = 'A'; return d;}
Read now
Unlock full access