Question: This exercise must be done in the C programming language under Linux kernel 4.4 (Ubuntu 16.04 has it). Build a module that creates a special

 This exercise must be done in the C programming language under

This exercise must be done in the C programming language under Linux kernel 4.4 (Ubuntu 16.04 has it).

Build a module that creates a special character device named /dev/-prime, for example /dev/michel time).1 The entry must use a dynamically allocated major device number. It must behave as if it were an infinitely long file filled with successive prime numbers. As much data as you would ty to read from /dev/prime, the system generates enough successive prime numbers starting from number 2. Using the test program test.c, you should observe the following behavior: $ sudo insmod michel_prime.ko 1s-1 /dev/michel-prime crw--- 1 root root 244, 0 Jan 29 14:45 /dev/michel_prime sudo ./test 5 test started Reading 5 prime number (s) 2 3 $ sudo ./test 100 test started Reading 100 prime number(s) 2 523 541 $ sudo rmmod michel_prime.ko 1s-1 /dev/prime ls: cannot access '/dev/prime': No such file or directory

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!