This project involves implementing a kernel module that addresses the producer-consumer problem. The module launches multiple kernel threads, synchronizes them using semaphores, and provides parameters for customization.
-
Understanding the Problem Statement:
- Analyzed the provided problem statement to identify the requirements and constraints.
- Determined the key components required for the implementation, such as kernel threads, semaphores, and module parameters.
-
Writing the Code:
- Developed the kernel module
producer_consumer.c
based on the problem statement. - Implemented functions to create producer and consumer threads, synchronize them using semaphores, and handle module loading and unloading.
- Developed the kernel module
-
Modifying the Code:
- Made adjustments to resolve errors and improve code structure based on errors during testing.
- Updated the module exit function to properly stop the kernel threads using
kthread_stop
.
-
Testing:
- Compiled the kernel module using the provided Makefile.
- Tested the module by loading and unloading it with different parameter configurations.
- Used the provided
thread_count.sh
script to automate testing and verify the behavior of the module.
producer_consumer.c
: Contains the implementation of the kernel module.
-
Compilation:
- Run
make
command in the terminal to compile the kernel module. - This generates the module file
producer_consumer.ko
.
- Run
-
Testing:
- Execute the
thread_count.sh
script to perform automated testing. - The script loads and unloads the module with different parameter configurations and checks the output to verify correctness.
- Execute the
Reviews
There are no reviews yet.