0

我有一个指向带有符号的数组的指针。

char *myArr = kmalloc(100, GFP_KERNEL); //put message in kernel
for(int i = 0; i < 100; ++i) {
    myArr[i] = x30; //put symbols here
    }
printk(KERN_INFO "The string is located at virtual address %p, physical address %lx\n", myArr, __pa(myArr));

我用 make 编译了这个模块并使用命令上传了这个模块:

sudo insmod ./my_module.ko

当这个模块在内核中时,我如何读取这个字符串?我必须使用一些特定的程序吗?

4

0 回答 0