How to Write a Block Device Driver
First, refer to the kernel code in z2ram.c Simulate a block device driver using memory The specific process of a block device driver: 1. Register the block device with the kernel int register_blkdev(unsigned int major, const char *name) Parameter 1: major write 0 to automatically get the major device number Parameter 2: The registered name … Read more