반응형 module_param 매크로 용도 linux 에서 드라이버를 개발할 때 드라이버가 로딩 시점에 특정 변수를 전달 인자로 사용할 수 있도록 하는 기능이 필요하여 개발 되었다. 물론 다른 용도로 외부에서 사용할 수 있을 것이다. 1. 드라이버 예제 #include #include #include MODULE_LICENSE("Dual BSD/GPL"); static char *who = "world"; static int times = 1; module_param(times,int,S_IRUSR); module_param(who,charp,S_IRUSR); static int hello_init() { int i; for(i = 0;i < times;i++) printk(KERN_ALERT"(%d)hello,%s! /n",i,who); ret.. 2022. 10. 20. 이전 1 다음 반응형