add_disk() make my driver's initialisation, thus kernel stall.
张云
zyunone at 163.com
Mon Mar 21 04:18:26 EDT 2016
Maybe I had misunderstood your meaning.
You are meaning I have assign 0 to my device major number?
The major variable is reassigned by the kernel in blkplay_init function.
http://stackoverflow.com/questions/13518404/add-disk-hangs-on-insmod <http://stackoverflow.com/questions/13518404/add-disk-hangs-on-insmod>
This post solve the problem.
Now, I can compile it, insmod it. But it’s give me a permission error when I open the device.
> On Mar 21, 2016, at 10:55 AM, Valdis.Kletnieks at vt.edu wrote:
>
> On Mon, 21 Mar 2016 09:53:47 +0800, 张云 said:
>> The code is just for learning block driver
>
> THe kernel doesn't know that. You call a routine with the wrong
> parameters, it will not work properly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160321/1a9d6c6f/attachment.html
More information about the Kernelnewbies
mailing list