URL: https://linuxfr.org/forums/linux-noyau/posts/warning-a-la-compilation-d-un-module-temps-reel-rtai Title: Warning à la compilation d'un module Temps Réel (RTAI) Authors: SpeedInfo Date: 2014年04月11日T02:21:39+02:00 License: CC By-SA Tags: Score: 1 Bonsoir, A la compilation d'un module qui utilise les fonctions Temps Réel de RTAI. J'ai une suite de Warnings qui ressemblent à ça: ```sh Warning: "stop_rt_timer" [/....................time.ko] undefined! Warning: "rt_task_delete" [/....................time.ko] undefined! Warning: "rt_task_make_periodic" [/....................time.ko] undefined!*** Warning: Warning: "rt_get_time" [/....................time.ko] undefined! Warning: "start_rt_timer" [/....................time.ko] undefined! Warning: "rt_set_periodic_mode" [/....................time.ko] undefined! Warning: "rt_task_init" [/....................time.ko] undefined! Warning: "nano2count" [/....................time.ko] undefined! Warning: "rt_get_time" [/....................time.ko] undefined! Warning: "rt_task_init" [/....................time.ko] undefined! ``` Pourtant, j'ai fait include la bibliothèque "rtai_sched.h" et dans le Makefile j'ai spécifié le chemin de la bibliothèque. Ci-dessous le code et le Makefile ```C #include #include #include #include #include #include #include #include #include static RT_TASK sound_task; static RTIME sound_period_ns = 1000000; #define SOUND_PORT 0x061 #define SOUND_MASK 0x02 void sound_fct(){ unsigned char sound_byte; unsigned char toggle = 0; while (1){ sound_byte = inb(SOUND_PORT); if (toggle){ sound_byte = sound_byte | SOUND_MASK; } else { sound_byte = sound_byte & ~SOUND_MASK; } outb (sound_byte,SOUND_PORT); toggle = !toggle; rt_task_wait_period(); } return; } int init_module(void) { RTIME sound_period_count; RTIME timer_period_count; int retval; printk("inserting sound module\n"); rt_set_periodic_mode(); sound_period_count = nano2count(sound_period_ns); //conversion de la pأ©riode (ns) en tics d'horloge timer_period_count = start_rt_timer(sound_period_count); //requete d'une pأ©riode formulأ©e en tics d'horloge printk("peiodic_task: rquested %d counts, got %d counts \n", (int) sound_period_count, (int) timer_period_count); //periode obtenue auprأ ̈s du timer /* ================ test ici de requete de la periode ===================================*/ retval = rt_task_init(&sound_task, sound_fct, 0, 1024, RT_SCHED_LOWEST_PRIORITY, 0,0); if (retval !=0) { if (-EINVAL == retval) printk("task already in use\n"); else if (-ENOMEM == retval) printk("could not allocate stack\n"); else printk("error initializing task\n"); return 0; } rt_task_make_periodic(&sound_task, rt_get_time()+ sound_period_count, sound_period_count); } void cleanup_module(void){ rt_task_delete(&sound_task); outb (inb(SOUND_PORT) & ~SOUND_MASK, SOUND_PORT); //On أ©teint le son stop_rt_timer(); } ``` ```sh =============================================================================== Makefile =============================================================================== obj-m := time.o KDIR:= /lib/modules/3.8.13/build EXTRA_CFLAGS := -I/usr/realtime/include -I/usr/include PWD := /root/exercices/ex02 default: make -C $(KDIR) SUBDIRS=$(PWD) modules clean: make -C $(KDIR) SUBDIRS=$(PWD) clean ``` J'espère que vous pourriez m'aider. Merci d'avance.

AltStyle によって変換されたページ (->オリジナル) /