从pte值获取物理地址并访问其值

时间:2015-02-18 14:36:08

标签: memory-management linux-kernel linux-device-driver

我获得了Pte值,但我无法访问该地点的物理地址和价值,所以请解决我的问题

代码

pgd_t *pgd;
pud_t *pud;
pmd_t *pmd;
pte_t *pte;
unsigned long int *add;

pgd = pgd_offset(mm,address);
pud = pud_offset(pgd,address);
pmd = pmd_offset(pud,address);
pte = pte_offset_kernel(pmd,address);
add = (unsigned long int *)pte_val(*pte);
printk(KERN_INFO "\nValue at Physical Address : %lx",*add);

在最后一行中它给了我错误

 BUG: unable to handle kernel paging request at 7581f448

提前感谢我提供一些解决方案

0 个答案:

没有答案