做的是led驱动,如下:
[root@localhost root]# cd /working/boot/
[root@localhost boot]# ls
built-in.o led_driver.c Makefile
[root@localhost boot]# make clean
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
[root@localhost boot]# make
make -C /working/linux2.6.8/ M=/working/boot
make[1]: Entering directory `/working/linux2.6.8'
LD /working/boot/built-in.o
CC [M] /working/boot/led_driver.o
In file included from include/asm/page.h:192,
from include/asm/cpu-single.h:33,
from include/asm/proc-fns.h:154,
from include/asm/system.h:90,
from include/asm/atomic.h:130,
from include/asm/processor.h:25,
from include/linux/prefetch.h:14,
from include/linux/list.h:7,
from include/linux/wait.h:14,
from include/linux/fs.h:12,
from /working/boot/led_driver.c:2:
include/asm/memory.h:16:29: asm/arch/memory.h: 没有那个文件或目录
In file included from include/asm/page.h:192,
from include/asm/cpu-single.h:33,
from include/asm/proc-fns.h:154,
from include/asm/system.h:90,
from include/asm/atomic.h:130,
from include/asm/processor.h:25,
from include/linux/prefetch.h:14,
from include/linux/list.h:7,
from include/linux/wait.h:14,
from include/linux/fs.h:12,
from /working/boot/led_driver.c:2:
include/asm/memory.h: In function `virt_to_phys':
include/asm/memory.h:94: error: `PHYS_OFFSET' undeclared (first use in this function)
include/asm/memory.h:94: error: (Each undeclared identifier is reported only once
include/asm/memory.h:94: error: for each function it appears in.)
include/asm/memory.h: In function `phys_to_virt':
include/asm/memory.h:99: error: `PHYS_OFFSET' undeclared (first use in this function)
In file included from include/linux/time.h:4,
from include/linux/stat.h:57,
from include/linux/fs.h:17,
from /working/boot/led_driver.c:2:
include/asm/param.h:13:45: asm/arch/param.h: 没有那个文件或目录
In file included from include/linux/timex.h:155,
from include/linux/time.h:29,
from include/linux/stat.h:57,
from include/linux/fs.h:17,
from /working/boot/led_driver.c:2:
include/asm/timex.h:15:28: asm/arch/timex.h: 没有那个文件或目录
In file included from include/linux/stat.h:57,
from include/linux/fs.h:17,
from /working/boot/led_driver.c:2:
include/linux/time.h:145:31: division by zero in #if
include/linux/time.h:145:31: division by zero in #if
include/linux/time.h:145:31: division by zero in #if
include/linux/time.h:145:31: division by zero in #if
include/linux/time.h:145:31: division by zero in #if
include/linux/time.h:145:31: division by zero in #if
include/linux/time.h:145:31: division by zero in #if
include/linux/time.h:145:31: division by zero in #if
include/linux/time.h:145:31: division by zero in #if
include/linux/time.h:145:31: division by zero in #if
include/linux/time.h:145:31: division by zero in #if
include/linux/time.h:145:31: division by zero in #if
include/linux/time.h:145:31: division by zero in #if
include/linux/time.h:145:31: division by zero in #if
include/linux/time.h:145:31: division by zero in #if
In file included from include/linux/stat.h:57,
from include/linux/fs.h:17,
from /working/boot/led_driver.c:2:
include/linux/time.h: In function `timespec_to_jiffies':
include/linux/time.h:223: error: `CLOCK_TICK_RATE' undeclared (first use in this function)
include/linux/time.h: In function `jiffies_to_timespec':
include/linux/time.h:242: error: `CLOCK_TICK_RATE' undeclared (first use in this function)
include/linux/time.h: In function `timeval_to_jiffies':
include/linux/time.h:264: error: `CLOCK_TICK_RATE' undeclared (first use in this function)
include/linux/time.h: In function `jiffies_to_timeval':
include/linux/time.h:280: error: `CLOCK_TICK_RATE' undeclared (first use in this function)
In file included from include/asm/hardirq.h:7,
from include/asm-generic/local.h:7,
from include/asm/local.h:1,
from include/linux/module.h:21,
from include/linux/device.h:20,
from /working/boot/led_driver.c:5:
include/asm/irq.h:4:27: asm/arch/irqs.h: 没有那个文件或目录
In file included from include/linux/mm.h:30,
from include/linux/poll.h:10,
from /working/boot/led_driver.c:8:
include/asm/pgtable.h:15:30: asm/arch/vmalloc.h: 没有那个文件或目录
In file included from include/linux/mm.h:30,
from include/linux/poll.h:10,
from /working/boot/led_driver.c:8:
include/asm/pgtable.h: In function `pmd_page_kernel':
include/asm/pgtable.h:336: error: `PHYS_OFFSET' undeclared (first use in this function)
In file included from include/linux/poll.h:10,
from /working/boot/led_driver.c:8:
include/linux/mm.h: In function `lowmem_page_address':
include/linux/mm.h:406: error: `PHYS_OFFSET' undeclared (first use in this function)
In file included from /working/boot/led_driver.c:15:
include/asm-arm/hardware.h:16:31: asm/arch/hardware.h: 没有那个文件或目录
In file included from /working/boot/led_driver.c:16:
include/asm-arm/arch-s3c2410/io.h: In function `__ioaddr':
include/asm-arm/arch-s3c2410/io.h:71: error: `S3C2410_VA_ISA_WORD' undeclared (first use
in this function)
include/asm-arm/arch-s3c2410/io.h: In function `__inb':
include/asm-arm/arch-s3c2410/io.h:80: error: `S3C2410_VA_ISA_BYTE' undeclared (first use
in this function)
include/asm-arm/arch-s3c2410/io.h: In function `__outb':
include/asm-arm/arch-s3c2410/io.h:80: error: `S3C2410_VA_ISA_BYTE' undeclared (first use
in this function)
include/asm-arm/arch-s3c2410/io.h: In function `__inw':
include/asm-arm/arch-s3c2410/io.h:81: error: `S3C2410_VA_ISA_WORD' undeclared (first use
in this function)
include/asm-arm/arch-s3c2410/io.h: In function `__outw':
include/asm-arm/arch-s3c2410/io.h:81: error: `S3C2410_VA_ISA_WORD' undeclared (first use
in this function)
include/asm-arm/arch-s3c2410/io.h: In function `__inl':
include/asm-arm/arch-s3c2410/io.h:82: error: `S3C2410_VA_ISA_WORD' undeclared (first use
in this function)
include/asm-arm/arch-s3c2410/io.h: In function `__outl':
include/asm-arm/arch-s3c2410/io.h:82: error: `S3C2410_VA_ISA_WORD' undeclared (first use
in this function)
/working/boot/led_driver.c: In function `LedSet':
/working/boot/led_driver.c:80: warning: implicit declaration of function `__raw_writel'
/working/boot/led_driver.c:80: warning: implicit declaration of function `__raw_readl'
make[2]: *** [/working/boot/led_driver.o] Error 1
make[1]: *** [_module_/working/boot] Error 2
make[1]: Leaving directory `/working/linux2.6.8'
make: *** [all] Error 2
请告诉是什么问题,如何为什么不能生成led_driver.o文件?
error: `PHYS_OFFSET' undeclared (first use in this function)
include/asm/memory.h:94: error: (Each undeclared identifier is reported only once
include/asm/memory.h:94: error: for each function it appears in.)
include/asm/memory.h: In function `phys_to_virt':
include/asm/memory.h:99: error: `PHYS_OFFSET' undeclared (first use in this function)
这么多error,当然不成功。
看看是不是“include/asm/memory.h:16:29: asm/arch/memory.h: 没有那个文件或目录” 引起的。
看起来是因为有一些头文件找不到所以无法编译。
asm/arch是空目录?