Access the physical address of the memory in Linux-general Linux technology-Linux programming and kernel information. The following is a detailed description. By tmsonhsut 2008.4.28
The/dev/mem driver provided in the Linux Kernel provides a channel for us to read and write the physical address of the memory. The following describes two methods to read and write physical addresses Using mem Device Files: one is a device driver and the other is a system call.
First, let's take a look at the mem device file./dev/mem is a character device in linux. The source file is ~ /Drivers/char/mem. c. This device file is used to read and write physical addresses. The content is the address and content information of all physical memory. Generally, only root users have read and write permissions.
1. Device Driver Method
The file_operations structure defined in the mem. c file provides llseek, read, write, mmap, and open methods.