Starting from:

$30

Operating Systems-Assignment 4 Solved

Kernel Producer-Consumer Problem 

 

 There should be two processes P and C. P reads random 8-bytes of the device /dev/urandom and passes them to the kernel via a system call, lets name it writer(). The kernel should maintain a queue of fixed length (allocated using kmalloc() function). The kernel implementation of the writer() should accept the 8-byte blocks from the user and write them the queue (and NOT a shared memory).

The process C should call a reader() system call, whose kernel implementation must involve calling the function to dequeue the enqueued bytes, from the read-write queue. You would therefore need functions to enqueue and dequeue bytes from the queue. These functions must use kernel synchronization primitives like kernel readerwriter semaphores or mutexes to ensure that there are no race conditions. As a suggestion, avoid using spin locks, until and unless you are really sure about what you are doing.

More products