1
我想編譯這個代碼,它使ARM Cortex A8上的循環計數器在目標上通過Debian OS。我在/home
中編寫了這段代碼,並且想編譯它。如何爲Cortex A8構建內核模塊?
我該如何編譯它,我應該在哪裏放置輸出文件?
- 我只是在嵌入式系統初學者,
- 我試圖遵循一些聯繫,但都以失敗告終
- 我真的不知道做的步驟,因爲我不熟悉Linux
代碼:
#include <linux/module.h>
#include <linux/kernel.h>
static int OldState;
int __init init_module(void)
{
/* enable user-mode access */
asm ("MCR p15, 0, %0, C9, C14, 0\n\t" :: "r"(1));
/* disable counter overflow interrupts (just in case)*/
asm ("MCR p15, 0, %0, C9, C14, 2\n\t" :: "r"(0x8000000f));
printk(KERN_INFO "user-mode access to performance registers enabled\n");
return 0;
}
void cleanup_module(void)
{
}
問題對於SO來說過於寬泛。尋找關於Linux模塊開發,覆盆子pi等的教程。一定有很多。 – auselen 2015-03-02 14:44:00