accessing physical memory from linux kernel

后端 未结 3 1101
别跟我提以往
别跟我提以往 2021-01-04 20:15

Can we access any physical memory via some kernel code.? Because, i wrote a device driver which only had init_module and exit_module.. the code is following.



        
3条回答
  •  旧巷少年郎
    2021-01-04 20:53

    To access real physical memory you should use phys_to_virt function. In case it is io memory (e.g. PCI memory) you should have a closer look at ioremap.

    This whole topic is very complex, if you are a beginner I would suggest some kernel/driver development books/doc.

提交回复
热议问题