我有一個名爲drv1的字符驅動程序,用戶應用程序使用ioctl
與它通信,它將傳輸參數struct file *filp
。現在我想知道drv1的代碼段的地址,但是我遇到了一些問題。如何在tmpfs中找到Linux驅動程序的代碼段? (實時)
起初,我想struct file *filp
可能是有用的,所以我看着源代碼中的定義,並找到一個指針struct inode *f_inode; /* cached value */
。然後,我大致搜索struct inode
的定義(我不確定是否正確,因爲我不熟悉tmpfs);一個名爲的指針struct address_space * i_mapping似乎是我需要的。但我不知道如何深入挖掘並卡住;有在struct address_space
一些複雜的數據結構,如:
struct radix_tree_root page_tree; /* radix tree of all pages */
和
struct rb_root i_mmap; /* tree of private and shared mappings */
這是否意味着司機DRV1的數據被組織爲radix_tree_root
形式?或者這是否意味着我錯過了其他的東西?