Results 1 to 2 of 2
hi frds
iam very interested in device drivers but i have zero knowledge in module programming.
i started learning dev dri with "hello world!" programme in first run i got ...
- 02-09-2011 #1Just Joined!
- Join Date
- Jan 2011
- Posts
- 1
device driver programming--need help
hi frds
iam very interested in device drivers but i have zero knowledge in module programming.
i started learning dev dri with "hello world!" programme in first run i got an error module.h no such file or directory. i overcome this problem but its listing following errors which i cant resolve. i hope u guys will help me out...iam working on debian linux distro
here is my make file
1.
TARGET := hello-1
WARN := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
INCLUDE := -isystem /lib/modules/`uname -r`/build/include
CFLAGS := -O2 -DMODULE -D__KERNEL__ ${WARN} ${INCLUDE}
CC := gcc-4.3
${TARGET}.o: ${TARGET}.c
.PHONY: clean
clean:
rm -rf {TARGET}.o
2.ERRORS. on console
gcc-4.3 -O2 -DMODULE -D__KERNEL__ -W -Wall -Wstrict-prototypes -Wmissing-prototypes -isystem /lib/modules/`uname -r`/build/include -c -o hello-1.o hello-1.c
In file included from /lib/modules/2.6.26-1-686/build/include/linux/prefetch.h:14,
from /lib/modules/2.6.26-1-686/build/include/linux/list.h:6,
from /lib/modules/2.6.26-1-686/build/include/linux/module.h:9,
from hello-1.c:1:
/lib/modules/2.6.26-1-686/build/include/asm/processor.h:112: error: ‘CONFIG_X86_L1_CACHE_SHIFT’ undeclared here (not in a function)
/lib/modules/2.6.26-1-686/build/include/asm/processor.h:112: error: requested alignment is not a constant
/lib/modules/2.6.26-1-686/build/include/asm/processor.h: In function ‘load_cr3’:
/lib/modules/2.6.26-1-686/build/include/asm/processor.h:184: error: ‘CONFIG_PAGE_OFFSETUL’ undeclared (first use in this function)
/lib/modules/2.6.26-1-686/build/include/asm/processor.h:184: error: (Each undeclared identifier is reported only once
/lib/modules/2.6.26-1-686/build/include/asm/processor.h:184: error: for each function it appears in.)
/lib/modules/2.6.26-1-686/build/include/asm/processor.h: At top level:
/lib/modules/2.6.26-1-686/build/include/asm/processor.h:233: error: requested alignment is not a constant
In file included from /lib/modules/2.6.26-1-686/build/include/asm/thread_info.h:5,
from /lib/modules/2.6.26-1-686/build/include/linux/thread_info.h:47,
from /lib/modules/2.6.26-1-686/build/include/linux/preempt.h:9,
from /lib/modules/2.6.26-1-686/build/include/linux/spinlock.h:49,
from /lib/modules/2.6.26-1-686/build/include/linux/seqlock.h:29,
from /lib/modules/2.6.26-1-686/build/include/linux/time.h:8,
from /lib/modules/2.6.26-1-686/build/include/linux/stat.h:60,
from /lib/modules/2.6.26-1-686/build/include/linux/module.h:10,
from hello-1.c:1:
/lib/modules/2.6.26-1-686/build/include/asm/thread_info_64.h: In function ‘current_thread_info’:
/lib/modules/2.6.26-1-686/build/include/asm/thread_info_64.h:66: error: ‘THREAD_SIZE’ undeclared (first use in this function)
/lib/modules/2.6.26-1-686/build/include/asm/thread_info_64.h: In function ‘stack_thread_info’:
/lib/modules/2.6.26-1-686/build/include/asm/thread_info_64.h:74: error: ‘THREAD_SIZE’ undeclared (first use in this function)
In file included from /lib/modules/2.6.26-1-686/build/include/linux/elf.h:7,
from /lib/modules/2.6.26-1-686/build/include/linux/module.h:14,
from hello-1.c:1:
/lib/modules/2.6.26-1-686/build/include/asm/elf.h: In function ‘elf_common_init’:
/lib/modules/2.6.26-1-686/build/include/asm/elf.h:166: error: ‘struct pt_regs’ has no member named ‘r8’
/lib/modules/2.6.26-1-686/build/include/asm/elf.h:166: error: ‘struct pt_regs’ has no member named ‘r9’
/lib/modules/2.6.26-1-686/build/include/asm/elf.h:166: error: ‘struct pt_regs’ has no member named ‘r10’
/lib/modules/2.6.26-1-686/build/include/asm/elf.h:166: error: ‘struct pt_regs’ has no member named ‘r11’
/lib/modules/2.6.26-1-686/build/include/asm/elf.h:167: error: ‘struct pt_regs’ has no member named ‘r12’
/lib/modules/2.6.26-1-686/build/include/asm/elf.h:167: error: ‘struct pt_regs’ has no member named ‘r13’
/lib/modules/2.6.26-1-686/build/include/asm/elf.h:167: error: ‘struct pt_regs’ has no member named ‘r14’
/lib/modules/2.6.26-1-686/build/include/asm/elf.h:167: error: ‘struct pt_regs’ has no member named ‘r15’
In file included from /lib/modules/2.6.26-1-686/build/include/linux/module.h:21,
from hello-1.c:1:
/lib/modules/2.6.26-1-686/build/include/asm/module.h:70:2: error: #error unknown processor family
make: *** [hello-1.o] Error 1
- 02-14-2011 #2Linux Newbie
- Join Date
- Apr 2010
- Location
- Novosibirsk, Russia
- Posts
- 136
I would advice you to have a look at 'Linux Device Drivers'


Reply With Quote