An Introduction to Block Device Drivers

An Introduction to Block Device Drivers

Introduction I have been researching IO for a long time and have been unable to connect bio and block device drivers. I only knew that bio is passed to the block device driver through the IO scheduling algorithm, but I never fully understood how this happens or where the IO scheduling algorithm plays its role. … Read more

How to Write a Block Device Driver

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