mardi 31 juillet 2018

How does the function add_disk_randomness work?

I am trying to understand the add_disk_randomness function from the linux kernel. I read a few papers, but they don't describe it very well. This code is from /drivers/char/random.c:

add_timer_randomness(disk->random, 0x100 + disk_devt(disk));

disk_devt(disk) holds the variable disk->devt. I understand it as a unique block device number. But what are the major and minor device number?

Then the block device number and the hex 0x100 are added together.

Then we collect also the time value disk->random. Is this the seek time for each block?

These two values will be passed to the function add_timer_randomness. It would be nice to get an example with values.




Aucun commentaire:

Enregistrer un commentaire