2011年9月1日
摘要: http://www.linuxforums.org/forum/kernel/158548-avoid-memory-copying-between-user-space-kernel-space.html1. you allocate memory in the kernel device driver2. You write a "mmap" function in the device driver3. This mmap file_ops function will do a remap_pfn when invoked by the user-space app 阅读全文
posted @ 2011-09-01 23:45 chingliuyu 阅读(391) 评论(0) 推荐(0)
摘要: http://people.ee.ethz.ch/~arkeller/linux/kernel_user_space_howto.html#s8#include <linux/module.h>#include <linux/kernel.h>#include <linux/init.h>#include <linux/fs.h>#include <linux/debugfs.h>#include <linux/mm.h> /* mmap related stuff */struct dentry *file1;struc 阅读全文
posted @ 2011-09-01 23:22 chingliuyu 阅读(458) 评论(0) 推荐(0)
摘要: 利用mmap /dev/mem 读写Linux内存分类: linux linux kernel2011-08-02 14:00 114人阅读 评论(1)收藏 举报使用 hexedit /dev/mem 可以显示所有物理内存中的信息。 运用mmap将/dev/mem map出来,然后直接对其读写可以实现用户空间的内核操作。以下是我写的一个sampleview plain#include<stdio.h>#include<unistd.h>#include<sys/mman.h>#include<sys/types.h>#include<sys 阅读全文
posted @ 2011-09-01 22:28 chingliuyu 阅读(1871) 评论(0) 推荐(0)