problem once again
Malte Witt
malte.witt at sieb-meyer.de
Thu Sep 29 13:42:23 CEST 2005
Hi again :-)
Try following build script and Makefile:
---------- build.sh ----------
#!/bin/bash
# Set Variables
KERNEL_CC=`rtai-config --cc`
LINUX_DIR=`rtai-config --linux-dir`
MODULE_DIR=`rtai-config --module-dir`
TARGETS=""
if [ "x$1" != "x" ]
then
TARGETS="$1"
fi
make -C "$LINUX_DIR" M="$PWD" CC="$KERNEL_CC" V="$V" $TARGETS
---------- Makefile ----------
EXTRA_CFLAGS += $(shell rtai-config --module-cflags)
obj-m += rtai_pulsmod.o
---------- End of Files ----------
Greetings,
Malte
rtai-admin at rtai.org schrieb am 29.09.2005 13:12:31:
> Hi!
>
> I really appriciate such a quick help bY Malte Witt
> And Alberto Sechi. Thanks a lot
>
> This time i am trying to compile a module and it is
> giving problem during compile time.i have pasted the
> program , the Make file as well as the o/p.
>
> Please help me out .
> **********************rtai_pulsmod.c******************************
>
> #include <linux/kernel.h>
> #include <linux/module.h>
> #include <rtai.h>
> #include <rtai_sched.h>
>
> #define STACK_SIZE 4096
>
> #define MIN_ON_PERIOD 0
> #define TOTAL_PERIOD 1000000 /* 1ms */
> #define NSTEPS 1000
> #define STEP_PERIOD 1000
>
> #define LPT1 0x378
>
>
> static RTIME on_time, off_time, total_period;
> static RT_TASK my_task;
>
> enum direction {DOWN, UP};
>
> static void pwm_task(int n)
> {
> int step = 0;
> static int dir = UP;
>
> while(1) {
> outb(0xff, LPT1);
> rt_sleep(on_time);
> outb(0x0, LPT1);
> rt_sleep(off_time);
> if(step == NSTEPS) {
> dir = !dir;
> step = 0;
> }
> step++;
> if(dir == UP) on_time =
> nano2count(step*STEP_PERIOD);
> else if(dir == DOWN) on_time = total_period -
> nano2count(step*STEP_PERIOD);
> off_time = total_period - on_time;
> }
> }
>
> int init_module(void)
> {
> RTIME now;
>
> rt_set_oneshot_mode();
> rt_task_init(&my_task, pwm_task, 0, STACK_SIZE, 0, 0,
> 0);
> start_rt_timer(0);
>
> on_time = nano2count(MIN_ON_PERIOD);
> off_time = nano2count(TOTAL_PERIOD);
> total_period = nano2count(TOTAL_PERIOD);
>
> now = rt_get_time() + total_period;
> rt_task_make_periodic(&my_task, now, total_period);
>
> return 0;
> }
>
>
> void cleanup_module(void)
> {
> stop_rt_timer();
> rt_busy_sleep(10000000);
> rt_task_delete(&my_task);
> }
>
>
>
>
>
>
> ************************Makefile*************************
>
> obj-m := rtai_pulsmod.o
>
> KDIR := /lib/modules/$(shell uname -r)/build
> PWD := $(shell pwd)
> EXTRA_CFLAGS := -I/usr/realtime/include
> -I/usr/include/
>
> default:
> $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
> *******************************************************
> arabhi:/usr/realtime# make
> make -C /lib/modules/2.6.7-adeos/build
> SUBDIRS=/usr/realtime modules
> make[1]: Entering directory `/usr/src/linux-2.6.7'
> CC [M] /usr/realtime/rtai_pulsmod.o
> /usr/realtime/rtai_pulsmod.c:1: error: parse error
> before "is"
> In file included from include/linux/kernel.h:10,
> from /usr/realtime/rtai_pulsmod.c:3:
> /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/include/stdarg.h:105:
> error: parse error before "va_list"
> In file included from /usr/realtime/rtai_pulsmod.c:3:
> include/linux/kernel.h:71: error: parse error before
> "va_list"
> include/linux/kernel.h:71: warning: function
> declaration isn't a prototype
> include/linux/kernel.h:74: error: parse error before
> "va_list"
> include/linux/kernel.h:74: warning: function
> declaration isn't a prototype
> include/linux/kernel.h:77: error: parse error before
> "va_list"
> include/linux/kernel.h:77: warning: function
> declaration isn't a prototype
> include/linux/kernel.h:81: error: parse error before
> "va_list"
> include/linux/kernel.h:81: warning: function
> declaration isn't a prototype
> make[2]: *** [/usr/realtime/rtai_pulsmod.o] Error 1
> make[1]: *** [_module_/usr/realtime] Error 2
> make[1]: Leaving directory `/usr/src/linux-2.6.7'
> make: *** [default] Error 2
>
>
> With Regards
>
> D.Shivji
>
>
> dat
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
>
> _______________________________________________
> RTAI mailing list
> RTAI at rtai.org
> https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
More information about the Rtai
mailing list