Active Topics

 


Reply
Thread Tools
Posts: 5 | Thanked: 0 times | Joined on Jun 2007 @ Dallas, US
#1
Hello:

I am working on a dummy device driver that used to be compiled with another kernel source (open source 2.6.14) but when I tried to compile a kernel module for it for the N800, the compilation breaks with the following errors.

Note: The problem seems to be originated when the driver includes

asm/memory.h

The errors are the following:

/home/csanta/kernel-source-rx-34-2.6.18//include/asm/memory.h: In function `virt_to_phys':
/home/csanta/kernel-source-rx-34-2.6.18//include/asm/memory.h:170: error: `CONFIG_DRAM_BASE' undeclared (first use in this function)
/home/csanta/kernel-source-rx-34-2.6.18//include/asm/memory.h:170: error: (Each undeclared identifier is reported only once
/home/csanta/kernel-source-rx-34-2.6.18//include/asm/memory.h:170: error: for each function it appears in.)
/home/csanta/kernel-source-rx-34-2.6.18//include/asm/memory.h: In function `phys_to_virt':
/home/csanta/kernel-source-rx-34-2.6.18//include/asm/memory.h:175: error: `CONFIG_DRAM_BASE' undeclared (first use in this function)
/home/csanta/kernel-source-rx-34-2.6.18//include/asm/memory.h: In function `virt_to_bus':
/home/csanta/kernel-source-rx-34-2.6.18//include/asm/memory.h:193: error: `CONFIG_DRAM_BASE' undeclared (first use in this function)
/home/csanta/kernel-source-rx-34-2.6.18//include/asm/memory.h: In function `bus_to_virt':
/home/csanta/kernel-source-rx-34-2.6.18//include/asm/memory.h:198: error: `CONFIG_DRAM_BASE' undeclared (first use in this function)

Then, it keeps going and it finally outputs:

/home/csanta/kernel-source-rx-34-2.6.18//include/linux/jiffies.h:33:3: #error You lose.
/home/csanta/kernel-source-rx-34-2.6.18//include/linux/jiffies.h:210:31: division by zero in #if
/home/csanta/kernel-source-rx-34-2.6.18//include/linux/jiffies.h:210:31: division by zero in #if
/home/csanta/kernel-source-rx-34-2.6.18//include/linux/jiffies.h:210:31: division by zero in #if
/home/csanta/kernel-source-rx-34-2.6.18//include/linux/jiffies.h:210:31: division by zero in #if
/home/csanta/kernel-source-rx-34-2.6.18//include/linux/jiffies.h:210:31: division by zero in #if
/home/csanta/kernel-source-rx-34-2.6.18//include/linux/jiffies.h:210:31: division by zero in #if
/home/csanta/kernel-source-rx-34-2.6.18//include/linux/jiffies.h:210:31: division by zero in #if
/home/csanta/kernel-source-rx-34-2.6.18//include/linux/jiffies.h:210:31: division by zero in #if

Do you guys know why there are actually missing files in the kernel source?

What are the implications of using a slighlty different header file (in this case memory.h) from another directory, that be usr/include/ or even inside the compilers header file. If use the one in the compilers directory the errors go away, but I am afraid that my module will later on face further problems regarding memory mapping.

Please advice,

CS
 
Posts: 2,152 | Thanked: 1,490 times | Joined on Jan 2006 @ Czech Republic
#2
First try to configure or better even build the kernel. This will prepare kernel sources and make proper architecture specific symbolic links in include directory. Also make sure the include path is correct for your driver Makefile so you are not including other headers by mistake. there are tons of examples on the net how to make out of tree kernel driver. You can also check my simple kernel module example (hack to mess with mtd partition flags) for n770 http://fanoush.wz.cz/maemo/nand_rw_enable.tgz
 
Posts: 5 | Thanked: 0 times | Joined on Jun 2007 @ Dallas, US
#3
Hi fanoush,

I did compiled the kernel and was able to flash it and everything. I even created a much simpler module and worked just fine. I am thinking whether I am missing additional header files. The fact that I have a bunch of undeclared's make think that. Is there a kernel 2.6.18-omap1 "developer version" of the source?

thanks,
CS
 
Reply


 
Forum Jump


All times are GMT. The time now is 22:54.