I tried to create a linux virtual block device. My requirement when running cat / dev / mydevice is to return some line that I created in the kernel program (I do not need to write data to disk, basically create a block device that helps to understand how the block device works).
I tried with the example presented in this blog . But as soon as I run cat / dev / sbd0, it will be an infinite loop. And I do not get any log from any method in the block driver to understand how the flow occurs in the block driver.
Can someone explain how a thread occurs in a block device in the Linux kernel ?.
I also tried the Link + editor, but I could not find the example block block in the Link + examples. I could see many sbd.c programs on the network, but due to the compatibility of the library with the latest kernel, most of them did not compile (I am a naive linux user).
I am using kernel 4.4 in Ubuntu 16.04
source
share