(Sorry if this topic has been beaten to death, I'm new to the list, in adddition to being a kernel newbie in general). I'm running 2.6.0-test9 kernel (yes, I know test11 is out). I was intrigued by the post "major doubt" and had the book in question (Linux Device Drivers) so I tried implementing the sample "Hello World" module. Please refer to that message for the source code. (Posted Monday 7:16am ET.) I couldn't get it to compile on my 2.6.0-test9 kernel (I realize it's 2.4 code), can someone tell me what's wrong or what I need to do to make it work on 2.6.x?. Here are my compile-time errors : # gcc -c -I/usr/src/linux-2.4.6-test9/include hello.c In file included from /usr/include/linux/jiffies.h:6, from /usr/include/linux/sched.h:12, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/linux/spinlock.h: In function `bit_spin_lock': /usr/include/linux/spinlock.h:413: error: invalid type argument of `->' /usr/include/linux/spinlock.h: In function `bit_spin_trylock': /usr/include/linux/spinlock.h:430: error: invalid type argument of `->' /usr/include/linux/spinlock.h:433: error: invalid type argument of `->' /usr/include/linux/spinlock.h:433: error: `TIF_NEED_RESCHED' undeclared (first u se in this function) /usr/include/linux/spinlock.h:433: error: (Each undeclared identifier is reporte d only once /usr/include/linux/spinlock.h:433: error: for each function it appears in.) /usr/include/linux/spinlock.h: In function `bit_spin_unlock': /usr/include/linux/spinlock.h:451: error: invalid type argument of `->' /usr/include/linux/spinlock.h:451: error: `TIF_NEED_RESCHED' undeclared (first u se in this function) In file included from /usr/include/linux/jiffies.h:7, from /usr/include/linux/sched.h:12, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/linux/seqlock.h: In function `write_seqlock': /usr/include/linux/seqlock.h:52: error: invalid type argument of `->' /usr/include/linux/seqlock.h: In function `write_sequnlock': /usr/include/linux/seqlock.h:61: error: invalid type argument of `->' /usr/include/linux/seqlock.h:61: error: `TIF_NEED_RESCHED' undeclared (first use in this function) /usr/include/linux/seqlock.h: In function `write_tryseqlock': /usr/include/linux/seqlock.h:66: error: invalid type argument of `->' /usr/include/linux/seqlock.h:66: error: invalid type argument of `->' /usr/include/linux/seqlock.h:66: error: `TIF_NEED_RESCHED' undeclared (first use in this function) In file included from /usr/include/linux/sched.h:12, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/linux/jiffies.h: At top level: /usr/include/linux/jiffies.h:16: error: parse error before "jiffies_64" /usr/include/linux/jiffies.h:20: error: parse error before "get_jiffies_64" In file included from /usr/include/linux/cpumask.h:8, from /usr/include/linux/sched.h:15, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/linux/bitmap.h: In function `bitmap_empty': /usr/include/linux/bitmap.h:15: error: `BITS_PER_LONG' undeclared (first use in this function) /usr/include/linux/bitmap.h: In function `bitmap_full': /usr/include/linux/bitmap.h:29: error: `BITS_PER_LONG' undeclared (first use in this function) /usr/include/linux/bitmap.h: In function `bitmap_equal': /usr/include/linux/bitmap.h:44: error: `BITS_PER_LONG' undeclared (first use in this function) /usr/include/linux/bitmap.h: In function `bitmap_shift_right': /usr/include/linux/bitmap.h:85: error: `__shr_tmp' undeclared (first use in this function) /usr/include/linux/bitmap.h: In function `bitmap_shift_left': /usr/include/linux/bitmap.h:98: error: `__shl_tmp' undeclared (first use in this function) /usr/include/linux/bitmap.h: In function `bitmap_weight': /usr/include/linux/bitmap.h:144: error: `BITS_PER_LONG' undeclared (first use in this function) In file included from /usr/include/linux/sched.h:15, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/linux/cpumask.h: At top level: /usr/include/linux/cpumask.h:15: error: variable-size type declared outside of a ny function In file included from /usr/include/linux/sched.h:15, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/linux/cpumask.h: In function `next_online_cpu': /usr/include/linux/cpumask.h:56: error: structure has no member named `val' In file included from /usr/include/linux/sched.h:21, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/asm/mmu.h: At top level: /usr/include/asm/mmu.h:13: error: field `sem' has incomplete type In file included from /usr/include/asm/smp.h:16, from /usr/include/linux/smp.h:17, from /usr/include/linux/sched.h:23, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/asm/fixmap.h:72: error: `FIX_ACPI_PAGES' undeclared here (not in a function) /usr/include/asm/fixmap.h:72: error: enumerator value for `FIX_ACPI_END' not int eger constant /usr/include/asm/fixmap.h:84: error: parse error before "pgprot_t" In file included from /usr/include/asm/smp.h:18, from /usr/include/linux/smp.h:17, from /usr/include/linux/sched.h:23, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/asm/mpspec.h:6:25: mach_mpspec.h: No such file or directory In file included from /usr/include/asm/smp.h:18, from /usr/include/linux/smp.h:17, from /usr/include/linux/sched.h:23, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/asm/mpspec.h:8: error: `MAX_MP_BUSSES' undeclared here (not in a fu nction) /usr/include/asm/mpspec.h:9: error: `MAX_MP_BUSSES' undeclared here (not in a fu nction) /usr/include/asm/mpspec.h:10: error: `MAX_MP_BUSSES' undeclared here (not in a f unction) /usr/include/asm/mpspec.h:12: error: `MAX_MP_BUSSES' undeclared here (not in a f unction) /usr/include/asm/mpspec.h:19: error: `MAX_APICS' undeclared here (not in a funct ion) /usr/include/asm/mpspec.h:20: error: `MAX_MP_BUSSES' undeclared here (not in a f unction) /usr/include/asm/mpspec.h:20: error: conflicting types for `mp_bus_id_to_type' /usr/include/asm/mpspec.h:8: error: previous declaration of `mp_bus_id_to_type' /usr/include/asm/mpspec.h:22: error: `MAX_IRQ_SOURCES' undeclared here (not in a function) /usr/include/asm/mpspec.h:24: error: `MAX_MP_BUSSES' undeclared here (not in a function) /usr/include/asm/mpspec.h:24: error: conflicting types for `mp_bus_id_to_pci_bus ' /usr/include/asm/mpspec.h:12: error: previous declaration of `mp_bus_id_to_pci_b us' /usr/include/asm/mpspec.h:35: error: parse error before "id" /usr/include/asm/mpspec.h:36: error: parse error before "address" /usr/include/asm/mpspec.h:37: error: parse error before "id" /usr/include/asm/mpspec.h:38: error: parse error before "bus_irq" /usr/include/asm/mpspec.h:54: error: `MAX_APICS' undeclared here (not in a funct ion) /usr/include/asm/mpspec.h:54: error: variable-size type declared outside of any function In file included from /usr/include/asm/smp.h:20, from /usr/include/linux/smp.h:17, from /usr/include/linux/sched.h:23, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/asm/io_apic.h:26: error: parse error before "u32" /usr/include/asm/io_apic.h:28: error: parse error before "u32" /usr/include/asm/io_apic.h:34: error: parse error before '}' token /usr/include/asm/io_apic.h:37: error: parse error before "u32" /usr/include/asm/io_apic.h:39: error: parse error before "u32" /usr/include/asm/io_apic.h:45: error: parse error before '}' token /usr/include/asm/io_apic.h:48: error: parse error before "u32" /usr/include/asm/io_apic.h:50: error: parse error before "u32" /usr/include/asm/io_apic.h:54: error: parse error before '}' token /usr/include/asm/io_apic.h:57: error: parse error before "u32" /usr/include/asm/io_apic.h:59: error: parse error before "u32" /usr/include/asm/io_apic.h:62: error: parse error before '}' token /usr/include/asm/io_apic.h:120: error: `MAX_IRQ_SOURCES' undeclared here (not in a function) /usr/include/asm/io_apic.h:120: error: conflicting types for `mp_irqs' /usr/include/asm/mpspec.h:22: error: previous declaration of `mp_irqs' In file included from /usr/include/linux/smp.h:17, from /usr/include/linux/sched.h:23, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/asm/smp.h:73:26: mach_apicdef.h: No such file or directory In file included from /usr/include/linux/sched.h:23, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/linux/smp.h: In function `on_each_cpu': /usr/include/linux/smp.h:65: error: invalid type argument of `->' /usr/include/linux/smp.h:68: error: invalid type argument of `->' /usr/include/linux/smp.h:68: error: `TIF_NEED_RESCHED' undeclared (first use in this function) In file included from /usr/include/linux/signal.h:4, from /usr/include/linux/sched.h:25, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/linux/list.h:576:2: warning: #warning "don't include kernel headers in userspace" In file included from /usr/include/asm/siginfo.h:4, from /usr/include/linux/signal.h:7, from /usr/include/linux/sched.h:25, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/asm-generic/siginfo.h: At top level: /usr/include/asm-generic/siginfo.h:53: error: size of array `_pad' is too large In file included from /usr/include/linux/sched.h:29, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/linux/completion.h:15: error: parse error before "wait_queue_head_t " /usr/include/linux/completion.h: In function `init_completion': /usr/include/linux/completion.h:26: error: dereferencing pointer to incomplete t ype /usr/include/linux/completion.h:27: error: dereferencing pointer to incomplete t ype In file included from /usr/include/linux/sched.h:30, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/linux/pid.h: At top level: /usr/include/linux/pid.h:18: error: field `task_list' has incomplete type /usr/include/linux/pid.h:19: error: field `hash_chain' has incomplete type /usr/include/linux/pid.h:24: error: field `pid_chain' has incomplete type In file included from /usr/include/linux/sched.h:102, from /usr/include/linux/module.h:10, from hello.c:2: /usr/include/linux/timer.h:11: error: field `entry' has incomplete type In file included from hello.c:2: /usr/include/linux/module.h:190: error: field `list' has incomplete type /usr/include/linux/module.h: In function `MOD_INC_USE_COUNT': /usr/include/linux/module.h:483: error: `KERN_WARNING' undeclared (first use in this function) /usr/include/linux/module.h:483: error: parse error before string constant .. And "that's it" .. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/