這是本文件的舊版!


Show Physical Memory Address of the kernel module

由於業務需求,我需要取得kernel space使用的實體記憶體位置;因此我希望透過寫一個kernel module,做以下事情:

  1. 宣告一個global variable。
  2. init時,初始此variable。
  3. exit時,釋放此variable。
  4. 執行file_operations時,會打印出此變數的實體位置。