[SOLVED] CSE330 Project 4: Bounded Buffer Producer-Consumer Problem

$25

File Name: CSE330_Project_4:_Bounded_Buffer_Producer-Consumer_Problem.zip
File Size: 546.36 KB

SKU: [Solved] CSE 330 – Operating Systems Project #3 -1 Category: Tag:
5/5 - (1 vote)

Project 4: Bounded Buffer Producer-Consumer Problem

Description:

This Linux kernel module implements a producer-consumer design pattern using kernel threads. The module reads information about processes started by a user in a producer thread and calculates the time elapsed for each process in a consumer thread

Steps Taken:

  1. Cloning the Repository:git clonehttps://github.com/CSE330-FALL-2023/Project-1-Template.git

  2. Writing the Code:

    • Developed the kernel moduleproducer_consumer.cbased on the problem statement.
    • Used module_param() for passing arguments.
    • Used Semaphore and Mutex (for critical sections).
    • Properly acquire and release Mutex.
    • Properly signal Semaphores uning up, down on full and empty.
    • Copy task info into buffer.
    • Read from buffer in consumer.
    • Define start_time_ns and process_pid using the read data from buffer.
    • Initialize Semaphores and Mutex.
    • Create producer threads.
    • Create consumer threads.
    • Store the id in ctx_producer_thread and ctx_consumer_thread respectively.
    • Changed incompatible up(&mutex) to up(empty) in the provided code.
  3. Modifying the Code:

    • Made adjustments to resolve errors and improve code structure based on errors during testing.
    • Changed Initial Licence from GPLv3 to GPL as ktime_get_ns() is GPL only.
    • Defined start_time_ns currectly to get correct times
  4. Testing:

    • Compiled the kernel module using the provided Makefile.
    • Used the providedtest.shscript to automate testing and verify the behavior of the module.

Files Included:

  • producer_consumer.c: Contains the implementation of the producer consumer kernel module.

How to Use:

  1. Compilation:

    • Runmakecommand in the terminal to compile the kernel module.
    • This generates the module fileproducer_consumer.ko.
  2. Testing:

    • Execute thetest.shscript with 5 parameters to perform automated testing. These are
      • number of processes for the test user
      • Buffer size
      • Number of Producers
      • Number of Consumers
      • Number of lines from dmesg to display
    • Do this 6 times for six test cases

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CSE330 Project 4: Bounded Buffer Producer-Consumer Problem
$25