ts-7000
[Top] [All Lists]

[ts-7000] kernel module compilation, 7400

To:
Subject: [ts-7000] kernel module compilation, 7400
From: Colin Copeland <>
Date: Mon, 16 Apr 2007 13:40:59 -0400
Hello,

I'm attempting to build a simple kernel module on a TS-7400,  
following the outline here:
   Building and Running Modules - http://www.xml.com/ldd/chapter/book/ 
ch02.html

I downloaded the kernel source (ts11):
   ftp://ftp.embeddedarm.com:21//ts-arm-linux-cd/sources/ 
tskernel-2.4.26-ts11-src.tar.gz

scp'd include/ to /usr/src/linux24/include/ and made a symbolic link  
for asm -> asm-arm//

I attached my code and Makefile below. When I try to compile, I get  
the following errors.

Thanks,
   colin

 make hello_world
gcc -Wall -gstabs+ -c -D__KERNEL__ -DMODULE -I/usr/src/linux24/ 
include hello_world.c
In file included from /usr/src/linux24/include/asm/memory.h:16,
                  from /usr/src/linux24/include/asm/cpu-single.h:54,
                  from /usr/src/linux24/include/asm/proc-fns.h:134,
                  from /usr/src/linux24/include/asm/system.h:36,
                  from /usr/src/linux24/include/linux/spinlock.h:6,
                  from /usr/src/linux24/include/linux/module.h:11,
                  from hello_world.c:1:
/usr/include/asm/arch/memory.h:44:2: #error "Undefined footbridge mode"
/usr/include/asm/arch/memory.h:62:2: #error "Undefined footbridge  
architecture"
In file included from /usr/src/linux24/include/asm/cpu-single.h:54,
                  from /usr/src/linux24/include/asm/proc-fns.h:134,
                  from /usr/src/linux24/include/asm/system.h:36,
                  from /usr/src/linux24/include/linux/spinlock.h:6,
                  from /usr/src/linux24/include/linux/module.h:11,
                  from hello_world.c:1:
/usr/src/linux24/include/asm/memory.h: In function `virt_to_phys':
/usr/src/linux24/include/asm/memory.h:33: error: `PAGE_OFFSET'  
undeclared (first use in this function)
/usr/src/linux24/include/asm/memory.h:33: error: (Each undeclared  
identifier is reported only once
/usr/src/linux24/include/asm/memory.h:33: error: for each function it  
appears in.)
/usr/src/linux24/include/asm/memory.h: In function `phys_to_virt':
/usr/src/linux24/include/asm/memory.h:38: error: `PAGE_OFFSET'  
undeclared (first use in this function)
In file included from /usr/src/linux24/include/asm/cpu-single.h:55,
                  from /usr/src/linux24/include/asm/proc-fns.h:134,
                  from /usr/src/linux24/include/asm/system.h:36,
                  from /usr/src/linux24/include/linux/spinlock.h:6,
                  from /usr/src/linux24/include/linux/module.h:11,
                  from hello_world.c:1:
/usr/src/linux24/include/asm/page.h:4:27: asm/proc/page.h: No such  
file or directory
In file included from /usr/src/linux24/include/asm/cpu-single.h:55,
                  from /usr/src/linux24/include/asm/proc-fns.h:134,
                  from /usr/src/linux24/include/asm/system.h:36,
                  from /usr/src/linux24/include/linux/spinlock.h:6,
                  from /usr/src/linux24/include/linux/module.h:11,
                  from hello_world.c:1:
/usr/src/linux24/include/asm/page.h: In function `get_order':
/usr/src/linux24/include/asm/page.h:86: error: `PAGE_SHIFT'  
undeclared (first use in this function)
In file included from /usr/src/linux24/include/linux/spinlock.h:6,
                  from /usr/src/linux24/include/linux/module.h:11,
                  from hello_world.c:1:
/usr/src/linux24/include/asm/system.h:48:29: asm/proc/system.h: No  
such file or directory
In file included from /usr/src/linux24/include/asm/processor.h:43,
                  from /usr/src/linux24/include/linux/prefetch.h:13,
                  from /usr/src/linux24/include/linux/list.h:6,
                  from /usr/src/linux24/include/linux/module.h:12,
                  from hello_world.c:1:
/usr/src/linux24/include/asm/atomic.h:30:29: asm/proc/system.h: No  
such file or directory
In file included from /usr/src/linux24/include/asm/processor.h:43,
                  from /usr/src/linux24/include/linux/prefetch.h:13,
                  from /usr/src/linux24/include/linux/list.h:6,
                  from /usr/src/linux24/include/linux/module.h:12,
                  from hello_world.c:1:
/usr/src/linux24/include/asm/atomic.h: In function `atomic_add':
/usr/src/linux24/include/asm/atomic.h:39: warning: implicit  
declaration of function `local_irq_save'
/usr/src/linux24/include/asm/atomic.h:41: warning: implicit  
declaration of function `local_irq_restore'
In file included from /usr/src/linux24/include/asm/processor.h:44,
                  from /usr/src/linux24/include/linux/prefetch.h:13,
                  from /usr/src/linux24/include/linux/list.h:6,
                  from /usr/src/linux24/include/linux/module.h:12,
                  from hello_world.c:1:
/usr/src/linux24/include/asm/ptrace.h:14:29: asm/proc/ptrace.h: No  
such file or directory
In file included from /usr/src/linux24/include/asm/elf.h:9,
                  from /usr/src/linux24/include/asm/processor.h:46,
                  from /usr/src/linux24/include/linux/prefetch.h:13,
                  from /usr/src/linux24/include/linux/list.h:6,
                  from /usr/src/linux24/include/linux/module.h:12,
                  from hello_world.c:1:
/usr/src/linux24/include/asm/user.h: At top level:
/usr/src/linux24/include/asm/user.h:55: error: field `regs' has  
incomplete type
In file included from /usr/src/linux24/include/asm/processor.h:46,
                  from /usr/src/linux24/include/linux/prefetch.h:13,
                  from /usr/src/linux24/include/linux/list.h:6,
                  from /usr/src/linux24/include/linux/module.h:12,
                  from hello_world.c:1:
/usr/src/linux24/include/asm/elf.h:10:26: asm/proc/elf.h: No such  
file or directory
In file included from /usr/src/linux24/include/asm/processor.h:46,
                  from /usr/src/linux24/include/linux/prefetch.h:13,
                  from /usr/src/linux24/include/linux/list.h:6,
                  from /usr/src/linux24/include/linux/module.h:12,
                  from hello_world.c:1:
/usr/src/linux24/include/asm/elf.h:19: error: invalid application of  
`sizeof' to an incomplete type
In file included from /usr/src/linux24/include/linux/prefetch.h:13,
                  from /usr/src/linux24/include/linux/list.h:6,
                  from /usr/src/linux24/include/linux/module.h:12,
                  from hello_world.c:1:
/usr/src/linux24/include/asm/processor.h:47:32: asm/proc/processor.h:  
No such file or directory
In file included from /usr/src/linux24/include/linux/prefetch.h:13,
                  from /usr/src/linux24/include/linux/list.h:6,
                  from /usr/src/linux24/include/linux/module.h:12,
                  from hello_world.c:1:
/usr/src/linux24/include/asm/processor.h:77: error: syntax error  
before "EXTRA_THREAD_STRUCT"
/usr/src/linux24/include/asm/processor.h:77: warning: no semicolon at  
end of struct or union
/usr/src/linux24/include/asm/processor.h: In function `thread_saved_pc':
/usr/src/linux24/include/asm/processor.h:90: error: dereferencing  
pointer to incomplete type
/usr/src/linux24/include/asm/processor.h:90: error: dereferencing  
pointer to incomplete type
/usr/src/linux24/include/asm/processor.h:90: error: `PCMASK'  
undeclared (first use in this function)
/usr/src/linux24/include/asm/processor.h: In function `thread_saved_fp':
/usr/src/linux24/include/asm/processor.h:95: error: dereferencing  
pointer to incomplete type
/usr/src/linux24/include/asm/processor.h:95: error: dereferencing  
pointer to incomplete type
make: *** [hello_world] Error 1


--------------------------------------------
 cat hello_world.c
#include <linux/module.h>

int init_module(void) {
         printk("<1>Hello, world\n");
         return 0;
}

void cleanup_module(void) {
         printk("<1>Goodbye cruel world\n");
}
--------------------------------------------
 cat Makefile
     obj-m := hello_world.o
KERNELDIR := /usr/src/linux24
    CFLAGS := -Wall -gstabs+

hello_world:
         gcc $(CFLAGS) -c -D__KERNEL__ -DMODULE -I$(KERNELDIR)/ 
include hello_world.c

clean:
         rm -rf *.o
--------------------------------------------




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU