Tiny Core Base > Micro Core

rtc with ds1339

(1/1)

ml:
Hello,
i need a kernel module or an extension for changing the time in ds 1339 (I2C) chip. I found some source:
http://www.daum-electronic.de/de/download/GPL/GPL/modules
I have problems to compile them for my micro core.
Please help

Rich:
Hi ml

In the Makefile there is a compiler directive for an ARM processor. Try removing arm-9dtmi-linux-gnu-gcc
and -O5 from the file and  add  -march=i486 -mtune=i686 -Os  in their place.

ml:
Hi,
i tried the changes in Make file, but i am still not able to compile.
(Intel® Atom™ processor Z5xx)

Any suggestions?

Rich:
Hi ml

--- Quote ---Any suggestions?
--- End quote ---
Yes, ignore my last post, it was incorrect.

The original Makefile looks like this:

--- Code: ---all: clean rtc_ds1339.o

rtc_ds1339.o: rtc_ds1339.c
arm-9dtmi-linux-gnu-gcc -O5 -ffast-math -fexpensive-optimizations -Wall -DLINUX -D__KERNEL__ -DMODULE -I. -c rtc_ds1339.c

clean:
@echo 'Removing all objects !'
-rm -f *.o

--- End code ---
but should probably look more like this:

--- Code: ---all: clean rtc_ds1339.o

rtc_ds1339.o: rtc_ds1339.c
i686-pc-linux-gnu-gcc -O5 -ffast-math -fexpensive-optimizations -Wall -DLINUX -D__KERNEL__ -DMODULE -I. -c rtc_ds1339.c

clean:
@echo 'Removing all objects !'
-rm -f *.o

--- End code ---
Unfortunately the result is a lot of errors. The files not found cause many more errors and warnings.

--- Code: ---i686-pc-linux-gnu-gcc -O5 -ffast-math -fexpensive-optimizations -Wall -DLINUX -D__KERNEL__ -DMODULE -I. -c rtc_ds1339.c
rtc_ds1339.c:54:26: error: linux/config.h: No such file or directory
rtc_ds1339.c:55:26: error: linux/module.h: No such file or directory
rtc_ds1339.c:59:30: error: linux/miscdevice.h: No such file or directory
rtc_ds1339.c:60:26: error: linux/ioport.h: No such file or directory
In file included from /usr/include/asm/fcntl.h:1,
                 from /usr/include/linux/fcntl.h:4,
                 from rtc_ds1339.c:61:
/usr/include/asm-generic/fcntl.h:113: error: expected specifier-qualifier-list before 'pid_t'
rtc_ds1339.c:62:31: error: linux/mc146818rtc.h: No such file or directory
rtc_ds1339.c:63:24: error: linux/init.h: No such file or directory
rtc_ds1339.c:65:27: error: linux/proc_fs.h: No such file or directory
rtc_ds1339.c:66:28: error: linux/spinlock.h: No such file or directory
In file included from rtc_ds1339.c:67:
/usr/include/linux/sysctl.h:40: error: expected specifier-qualifier-list before 'size_t'
rtc_ds1339.c:69:75: error: linux/slab.h: No such file or directory
rtc_ds1339.c:70:75: error: linux/mm.h: No such file or directory
rtc_ds1339.c:76:75: error: linux/delay.h: No such file or directory
rtc_ds1339.c:77:75: error: asm/io.h: No such file or directory

--- End code ---
The files are from 2004 and I think there were some changes made to the kernel tree that are causing
some of these errors. I know config.h was removed. I think it was replaced with autoconfig.h. The others
may be because they were moved in the kernel or because of a missing or incorrect include directive
in the makefile. The -O5 also doesn't look correct, I don't think it goes up to 5. Since this is a module
there are some directives used that I'm not familiar with.

Bottom line is I'm in over my head at this point. Maybe someone more capable in this area can provide
a few pointers and set me straight.

Navigation

[0] Message Index

Go to full version