Types, Differences, and Implementation of Linux Device Drivers

Types, Differences, and Implementation of Linux Device Drivers

Types, Differences, and Implementation Considerations of Linux Device Drivers In the Linux operating system, device drivers serve as the bridge between hardware devices and the operating system, providing an interface for interaction with hardware devices. Linux device drivers can be categorized into several types based on their functions and application scenarios. This article will detail … Read more

Linux102: Analysis of ramdisk.c in Linux Kernel 0.11

Linux102: Analysis of ramdisk.c in Linux Kernel 0.11

Public Account “Focus on Linux”, dedicated to Linux kernel development The Linux102 series will detail 102 files in version 0.11 of Linux. This article discusses the source code of the 45th file, <span>【Linux102】45-kernel/blk_drv/ramdisk.c</span>. 1. Main Function of ramdisk.c This is a memory virtual disk driver, written by Theodore Ts’o. It means that: If RAMDISK is … Read more

Why IO Priority Cannot Enhance Your App’s Performance?

Why IO Priority Cannot Enhance Your App's Performance?

When hearing about priority, those involved in performance optimization often consider whether it can be applied to our business. For example: <strong><span><span>ionice -c1 -n0</span></span></strong>, hoping it can improve application performance. But this may just be wishful thinking. Business Process: The process reads and writes data through read write, to the kernel, then to the VFS … Read more

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