Chinaunix首页 | 论坛 | 博客
  • 博客访问: 552114
  • 博文数量: 99
  • 博客积分: 4010
  • 博客等级: 上校
  • 技术积分: 1117
  • 用 户 组: 普通用户
  • 注册时间: 2009-06-23 15:17
文章分类

全部博文(99)

文章存档

2011年(4)

2010年(13)

2009年(82)

我的朋友

分类: LINUX

2009-07-18 17:19:00

最近想学习下arm linux 的启动过程,于是就想把sep4020的现有Linux2.6.16平台升级到2.6.26平台上,顺便学习下linux启动过程:

步骤一:

下载一个Linux2.6.26版本下来可以到

上下载2.6.26版本,并在fedora 7的根目录下面解压缩。

步骤二:

修改linux-2.6.26根目录下面的Makefile,在内核根目录下的Makefile文件中指定要用到的编译器和架构(arch),方法:在第194行添加代码 ,将ARCH    ?=(SUBARCH) 改为,
ARCH ?=arm
CROSS_COMPILE ?=arm-linux-

步骤三:

由于我们是已经有很完善的Linux2.6.16平台了,(这个平台的移植参考leeming的文章Porting Linux2.6.16内核到sep4020(arm720T)),我在这里就比较轻松的将两个主要目录arch/arm/mach-sep4020和include/asm-arm/arch-sep4020直接拷贝到2.6.26内核相应目录,修改好arch/arm的Kconfig和Makefile文件,让它支持我们的SEP4020处理器。

另外还需要注意的是,在arch/arm/tools/mach-types文件中增加一行sep4020的机器ID

 

步骤四:

make menuconfig,将内核大部分选项全部去掉,这里有关sep4020的能正常用的config文件,如果需要,大家可以参考这个来改menuconfig

文件: gfd4020_defconfig.rar
大小: 3KB
下载: 下载

步骤五:

编译内核,问题相当多,分别列举如下:

问题1:

[ linux-2.6.26]# make
 HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf -s arch/arm/Kconfig
 CHK     include/linux/version.h
 SYMLINK include/asm-arm/arch -> include/asm-arm/arch-sep4020
make[1]: “include/asm-arm/mach-types.h”是最新的。
 CHK     include/linux/utsrelease.h
 CC      kernel/bounds.s
 GEN     include/linux/bounds.h
 CC      arch/arm/kernel/asm-offsets.s
In file included from include/linux/irqflags.h:46,
                from include/asm/system.h:65,
                from include/asm/bitops.h:27,
                from include/linux/bitops.h:17,
                from include/linux/kernel.h:15,
                from include/linux/sched.h:52,
                from arch/arm/kernel/asm-offsets.c:13:
include/asm/irqflags.h:11:5: warning: "__LINUX_ARM_ARCH__" is not defined
In file included from include/asm/bitops.h:27,
                from include/linux/bitops.h:17,
                from include/linux/kernel.h:15,
                from include/linux/sched.h:52,
                from arch/arm/kernel/asm-offsets.c:13:
include/asm/system.h:167:5: warning: "__LINUX_ARM_ARCH__" is not defined
include/asm/system.h:173:5: warning: "__LINUX_ARM_ARCH__" is not defined
include/asm/system.h:177:35: warning: "__LINUX_ARM_ARCH__" is not defined
include/asm/system.h:297:5: warning: "__LINUX_ARM_ARCH__" is not defined
include/asm/system.h:302:5: warning: "__LINUX_ARM_ARCH__" is not defined
In file included from include/linux/bitops.h:17,
                from include/linux/kernel.h:15,
                from include/linux/sched.h:52,
                from arch/arm/kernel/asm-offsets.c:13:
include/asm/bitops.h:237:5: warning: "__LINUX_ARM_ARCH__" is not defined
In file included from include/asm/thread_info.h:16,
                from include/linux/thread_info.h:47,
                from include/linux/preempt.h:9,
                from include/linux/spinlock.h:49,
                from include/linux/seqlock.h:29,
                from include/linux/time.h:8,
                from include/linux/timex.h:57,
                from include/linux/sched.h:54,
                from arch/arm/kernel/asm-offsets.c:13:
include/asm/fpstate.h:32:5: warning: "__LINUX_ARM_ARCH__" is not defined
In file included from include/linux/prefetch.h:14,
                from include/linux/list.h:6,
                from include/linux/preempt.h:11,
                from include/linux/spinlock.h:49,
                from include/linux/seqlock.h:29,
                from include/linux/time.h:8,
                from include/linux/timex.h:57,
                from include/linux/sched.h:54,
                from arch/arm/kernel/asm-offsets.c:13:
include/asm/processor.h:109:5: warning: "__LINUX_ARM_ARCH__" is not defined
In file included from include/linux/spinlock.h:302,
                from include/linux/seqlock.h:29,
                from include/linux/time.h:8,
                from include/linux/timex.h:57,
                from include/linux/sched.h:54,
                from arch/arm/kernel/asm-offsets.c:13:
include/asm/atomic.h:25:5: warning: "__LINUX_ARM_ARCH__" is not defined
In file included from include/asm/page.h:29,
                from include/linux/mm_types.h:13,
                from include/linux/sched.h:61,
                from arch/arm/kernel/asm-offsets.c:13:
include/asm/glue.h:119:2: #error Unknown data abort handler type
include/asm/glue.h:146:2: #error Unknown prefetch abort handler type
In file included from include/linux/mm_types.h:13,
                from include/linux/sched.h:61,
                from arch/arm/kernel/asm-offsets.c:13:
include/asm/page.h:111:2: #error Unknown user operations model
make[1]: *** [arch/arm/kernel/asm-offsets.s] 错误 1
make: *** [prepare0] 错误 2
解决方法:
这个主要是由于我没在/arch/arm/mm/Kconfig的720T中增加sep4020引起的。
 
问题 2:
include/linux/compiler.h:34:1: warning: this is the location of the previous definition
 CC      init/do_mounts_rd.o
 CC      init/do_mounts_initrd.o
 LD      init/mounts.o
 CC      init/initramfs.o
 CC      init/calibrate.o
 LD      init/built-in.o
 HOSTCC  usr/gen_init_cpio
 GEN     usr/initramfs_data.cpio.gz
 AS      usr/initramfs_data.o
 LD      usr/built-in.o
 CC      arch/arm/kernel/compat.o
 AS      arch/arm/kernel/entry-armv.o
arch/arm/kernel/entry-armv.S: Assembler messages:
arch/arm/kernel/entry-armv.S:210: Error: bad instruction `get_irqnr_preamble r5,lr'
arch/arm/kernel/entry-armv.S:431: Error: bad instruction `get_irqnr_preamble r5,lr'
make[1]: *** [arch/arm/kernel/entry-armv.o] 错误 1
make: *** [arch/arm/kernel] 错误 2
解决方法:
进入arch/arm/kernel/entry-armv.S屏掉这两句话
因为

[ARM] 4185/2: entry: introduce get_irqnr_preamble and arch_ret_to_user

get_irqnr_preamble allows machines to take some action before entering the

get_irqnr_and_base loop. On iop we enable cp6 access.

arch_ret_to_user is added to the userspace return path to allow individual

architectures to take actions, like disabling coprocessor access, before

the final return to userspace.

Per Nicolas Pitre's note, there is no need to cp_wait on the return to user

as the latency to return is sufficient.

Signed-off-by: Dan Williams

Signed-off-by: Russell King

问题3:
arch/arm/kernel/entry-common.S: Assembler messages:
arch/arm/kernel/entry-common.S:30: Error: bad instruction `arch_ret_to_user r1,lr'
arch/arm/kernel/entry-common.S:69: Error: bad instruction `arch_ret_to_user r1,lr'
make[1]: *** [arch/arm/kernel/entry-common.o] 错误 1
make: *** [arch/arm/kernel] 错误 2
解决方法:
直接屏掉这两句话,原因同上
 
问题4:
In file included from include/linux/init.h:4,
                from arch/arm/mach-sep4020/irq.c:1:
include/linux/compiler.h:34:1: warning: this is the location of the previous definition
arch/arm/mach-sep4020/irq.c:35: error: variable `sep4020_chip' has initializer but incomplete type
arch/arm/mach-sep4020/irq.c:37: error: unknown field `ack' specified in initializer
arch/arm/mach-sep4020/irq.c:37: warning: excess elements in struct initializer
arch/arm/mach-sep4020/irq.c:37: warning: (near initialization for `sep4020_chip')
arch/arm/mach-sep4020/irq.c:38: error: unknown field `mask' specified in initializer
arch/arm/mach-sep4020/irq.c:38: warning: excess elements in struct initializer
arch/arm/mach-sep4020/irq.c:38: warning: (near initialization for `sep4020_chip')
arch/arm/mach-sep4020/irq.c:39: error: unknown field `unmask' specified in initializer
arch/arm/mach-sep4020/irq.c:39: warning: excess elements in struct initializer
arch/arm/mach-sep4020/irq.c:39: warning: (near initialization for `sep4020_chip')
arch/arm/mach-sep4020/irq.c: In function `sep4020_init_irq':
arch/arm/mach-sep4020/irq.c:54: error: `do_level_IRQ' undeclared (first use in this function)
arch/arm/mach-sep4020/irq.c:54: error: (Each undeclared identifier is reported only once
arch/arm/mach-sep4020/irq.c:54: error: for each function it appears in.)
arch/arm/mach-sep4020/irq.c:55: warning: passing arg 2 of `set_irq_chip' from incompatible pointer type
arch/arm/mach-sep4020/irq.c: At top level:
arch/arm/mach-sep4020/irq.c:35: error: storage size of `sep4020_chip' isn't known
make[1]: *** [arch/arm/mach-sep4020/irq.o] 错误 1
make: *** [arch/arm/mach-sep4020] 错误 2
解决方法:
将irq.c的35行换为static struct irq_chip sep4020_chip
将54行的set_irq_handler(i, do_level_IRQ);换为 set_irq_handler(i, handle_level_irq);
 
问题5:
In file included from include/linux/timex.h:56,
                from arch/arm/mach-sep4020/time.c:1:
include/linux/compiler.h:34:1: warning: this is the location of the previous definition
arch/arm/mach-sep4020/time.c: In function `sep4020_timer_interrupt':
arch/arm/mach-sep4020/time.c:29: error: too many arguments to function `timer_tick'
arch/arm/mach-sep4020/time.c: At top level:
arch/arm/mach-sep4020/time.c:38: error: `SA_INTERRUPT' undeclared here (not in a function)
arch/arm/mach-sep4020/time.c:38: error: `SA_TIMER' undeclared here (not in a function)
arch/arm/mach-sep4020/time.c:38: error: initializer element is not constant
arch/arm/mach-sep4020/time.c:38: error: (near initialization for `sep4020_timer_irq.flags')
arch/arm/mach-sep4020/time.c:39: warning: initialization from incompatible pointer type
arch/arm/mach-sep4020/time.c: In function `sep4020_timer_init':
arch/arm/mach-sep4020/time.c:47: error: implicit declaration of function `setup_irq'
make[1]: *** [arch/arm/mach-sep4020/time.o] 错误 1
make: *** [arch/arm/mach-sep4020] 错误 2
解决方法:
将29行 timer_tick(regs);换为 timer_tick();
将23行static irqreturn_t sep4020_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)换为static irqreturn_t sep4020_timer_interrupt(int irq, void *dev_id)
将38行 .flags = SA_INTERRUPT | SA_TIMER,换为 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
另外在开头处写上#include
 
问题6:
[ linux-2.6.26]# make
 CHK     include/linux/version.h
make[1]: “include/asm-arm/mach-types.h”是最新的。
 CHK     include/linux/utsrelease.h
 CALL    scripts/checksyscalls.sh
:1097:2: warning: #warning syscall fadvise64 not implemented
:1265:2: warning: #warning syscall migrate_pages not implemented
:1321:2: warning: #warning syscall pselect6 not implemented
:1325:2: warning: #warning syscall ppoll not implemented
:1365:2: warning: #warning syscall epoll_pwait not implemented
 CHK     include/linux/compile.h
 CC      arch/arm/mach-sep4020/Devices.o
 CC      arch/arm/mach-sep4020/clock.o
In file included from include/asm/io.h:85,
                from arch/arm/mach-sep4020/clock.c:27:
include/asm/arch/io.h:53:1: warning: "__cond_lock" redefined
In file included from include/linux/stddef.h:4,
                from include/linux/list.h:4,
                from include/linux/module.h:9,
                from arch/arm/mach-sep4020/clock.c:13:
include/linux/compiler.h:34:1: warning: this is the location of the previous definition
In file included from include/asm/io.h:85,
                from arch/arm/mach-sep4020/clock.c:27:
include/asm/arch/io.h:53:1: warning: "__cond_lock" redefined
In file included from include/linux/stddef.h:4,
                from include/linux/list.h:4,
                from include/linux/module.h:9,
                from arch/arm/mach-sep4020/clock.c:13:
include/linux/compiler.h:34:1: warning: this is the location of the previous definition
 CC      arch/arm/mach-sep4020/dma.o
In file included from include/asm/io.h:85,
                from arch/arm/mach-sep4020/dma.c:16:
include/asm/arch/io.h:53:1: warning: "__cond_lock" redefined
In file included from include/linux/stddef.h:4,
                from include/linux/list.h:4,
                from include/linux/module.h:9,
                from arch/arm/mach-sep4020/dma.c:5:
include/linux/compiler.h:34:1: warning: this is the location of the previous definition
 CC      arch/arm/mach-sep4020/4020.o
In file included from include/asm/io.h:85,
                from arch/arm/mach-sep4020/4020.c:2:
include/asm/arch/io.h:53:1: warning: "__cond_lock" redefined
In file included from include/linux/stddef.h:4,
                from include/linux/posix_types.h:4,
                from include/linux/types.h:11,
                from include/asm/io.h:26,
                from arch/arm/mach-sep4020/4020.c:2:
include/linux/compiler.h:34:1: warning: this is the location of the previous definition
In file included from include/linux/time.h:8,
                from include/linux/timex.h:57,
                from include/linux/sched.h:54,
                from include/linux/interrupt.h:12,
                from arch/arm/mach-sep4020/4020.c:7:
include/linux/seqlock.h:76:34: macro "__cond_lock" passed 2 arguments, but takes just 1
In file included from include/linux/time.h:8,
                from include/linux/timex.h:57,
                from include/linux/sched.h:54,
                from include/linux/interrupt.h:12,
                from arch/arm/mach-sep4020/4020.c:7:
include/linux/seqlock.h: In function `write_tryseqlock':
include/linux/seqlock.h:76: error: `__cond_lock' undeclared (first use in this function)
include/linux/seqlock.h:76: error: (Each undeclared identifier is reported only once
include/linux/seqlock.h:76: error: for each function it appears in.)
make[1]: *** [arch/arm/mach-sep4020/4020.o] 错误 1
make: *** [arch/arm/mach-sep4020] 错误 2
解决方法:
将include/asm-arm/arch-sep4020/io.h中的
#ifdef __CHECKER__
# define __user __attribute__((noderef, address_space(1)))
# define __kernel // default address space
# define __safe __attribute__((safe))
# define __force __attribute__((force))
# define __nocast __attribute__((nocast))
# define __iomem __attribute__((noderef, address_space(2)))
# define __acquires(x) __attribute__((context(0,1)))
# define __releases(x) __attribute__((context(1,0)))
# define __acquire(x) __context__(1)
# define __release(x) __context__(-1)
# define __cond_lock(x) ((x) ? ({ __context__(1); 1; }) : 0)
extern void __chk_user_ptr(void __user *);
extern void __chk_io_ptr(void __iomem *);
#else
# define __user
# define __kernel
# define __safe
# define __force
# define __nocast
# define __iomem
# define __chk_user_ptr(x) (void)0
# define __chk_io_ptr(x) (void)0
# define __builtin_warning(x, y...) (1)
# define __acquires(x)
# define __releases(x)
# define __acquire(x) (void)0
# define __release(x) (void)0
# define __cond_lock(x) (x)
#endif
这一大段屏掉,因为在/include/linux/compiler.h中也定义了这些,重复定义了
 
问题7:
 SYSMAP  System.map
 SYSMAP  .tmp_System.map
 OBJCOPY arch/arm/boot/Image
 Kernel: arch/arm/boot/Image is ready
 AS      arch/arm/boot/compressed/head.o
 GZIP    arch/arm/boot/compressed/piggy.gz
 AS      arch/arm/boot/compressed/piggy.o
 CC      arch/arm/boot/compressed/misc.o
arch/arm/boot/compressed/misc.c:73: error: redefinition of 'putstr'
include/asm/arch/uncompress.h:44: error: previous definition of 'putstr' was here
arch/arm/boot/compressed/misc.c: In function `putstr':
arch/arm/boot/compressed/misc.c:78: error: implicit declaration of function `putc'
arch/arm/boot/compressed/misc.c:82: error: implicit declaration of function `flush'
make[2]: *** [arch/arm/boot/compressed/misc.o] 错误 1
make[1]: *** [arch/arm/boot/compressed/vmlinux] 错误 2
make: *** [zImage] 错误 2
解决方法:
将linux/include/asm-arm/arch-4020/uncompress.h 的43行的
static void putstr(const char *s)
{
char c;
 
while ((c = *s++) != '\0') {
while (clps_readl(SYSFLGx) & SYSFLG_UTXFF)
barrier();
clps_writel(c, UARTDRx);
 
if (c == '\n') {
while (clps_readl(SYSFLGx) & SYSFLG_UTXFF)
barrier();
clps_writel('\r', UARTDRx);
}
}
while (clps_readl(SYSFLGx) & SYSFLG_UBUSY)
barrier();
}
改为:
static inline void putc(int c)
{
while (clps_readl(SYSFLGx) & SYSFLG_UTXFF)
barrier();
clps_writel(c, UARTDRx);
}
 
static inline void flush(void)
{
while (clps_readl(SYSFLGx) & SYSFLG_UBUSY)
barrier();
}
 
步骤六:
经过上面的出错过程,编译基本上没有什么问题了,现在开始调试:
(1)直接编译成uImage,通过uboot加载引导,但出现乱码:
发现已经进入了/init/main.c的start_kernel函数了,因为一旦我在start_kernel开始处加入while(1);他就死在此处,不会输出任何东西了,所以我就准备用AXD直接调试Linux未压缩的内核/arch/arm/boot/Image(它是elf格式vmlinux的二进制文件,没有经过任何压缩),我将此文件用axd下载到0x30008000的地址,并且将r0=0,r1=194,然后将pc移到0x30008000开始运行,刚开始位于0x30008000处的函数就是/arch/arm/kernel/head.s中的78行的stext函数,这个就是内核入口函数,呵呵!!
今天移植的第二天了,本来在ADS上调试发现是在
__turn_mmu_on:
mov r0, r0
mcr p15, 0, r0, c1, c0, 0 @ write control reg
mrc p15, 0, r3, c0, c0, 0 @ read id reg
mov r3, r3
mov r3, r3
mov pc, r13
这段程序飞掉了,看来是在开MMU后飞掉的,但自己又觉得是ADS ICE出问题了,于是我就换了jlink和另外一块MBT1.0的板子来调试,这次一下就都过去了,很快就到了start_kernel函数,太激动了啊,于是我赶紧将内核镜像直接做成uImage行式,直接用uboot来引导它,呵呵,果然一下什么都好了,看来已经移植成功了:
Starting kernel ...
 
Linux version 2.6.26 () (gcc version 3.4.1) #30 Sat Jul 18 14:41:36 CST 2009
CPU: ARM720T [41807202] revision 2 (ARMv4T), cr=0000217f
Machine: 4020 board
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
Kernel command line: root=/dev/nfs rw nfsroot=192.168.0.3:/nfs ip=192.168.0.2:192.168.0.3:192.168.0.1:255.255.255.0::eth0:off console=ttyS0,115200 init=/linuxrc
Trying to install interrupt handler for IRQ0
Trying to install interrupt handler for IRQ1
Trying to install interrupt handler for IRQ2
Trying to install interrupt handler for IRQ3
Trying to install interrupt handler for IRQ4
Trying to install interrupt handler for IRQ5
Trying to install interrupt handler for IRQ6
Trying to install interrupt handler for IRQ7
Trying to install interrupt handler for IRQ8
Trying to install interrupt handler for IRQ9
Trying to install interrupt handler for IRQ10
Trying to install interrupt handler for IRQ11
Trying to install interrupt handler for IRQ12
Trying to install interrupt handler for IRQ13
Trying to install interrupt handler for IRQ14
Trying to install interrupt handler for IRQ15
Trying to install interrupt handler for IRQ16
Trying to install interrupt handler for IRQ17
Trying to install interrupt handler for IRQ18
Trying to install interrupt handler for IRQ19
Trying to install interrupt handler for IRQ20
Trying to install interrupt handler for IRQ21
Trying to install interrupt handler for IRQ22
Trying to install interrupt handler for IRQ23
Trying to install interrupt handler for IRQ24
Trying to install interrupt handler for IRQ25
Trying to install interrupt handler for IRQ26
Trying to install interrupt handler for IRQ27
Trying to install interrupt handler for IRQ28
Trying to install interrupt handler for IRQ29
Trying to install interrupt handler for IRQ30
Trying to install interrupt handler for IRQ31
PID hash table entries: 128 (order: 7, 512 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 32MB = 32MB total
Memory: 31248KB available (1012K code, 104K data, 64K init)
SLUB: Genslabs=12, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
platform_device_register sep4020_fb_set_platdata
msgmni has been set to 61
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x10005000 (irq = 24) is a 16450
console [ttyS0] enabled
serial8250.0: ttyS1 at MMIO 0x10006000 (irq = 23) is a 16450
serial8250.0: ttyS2 at MMIO 0x10007000 (irq = 22) is a 16450
serial8250.0: ttyS3 at MMIO 0x10008000 (irq = 21) is a 16450
mice: PS/2 mouse device common for all mice
Freeing init memory: 64K
Failed to execute /linuxrc.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
 
这个中间会出现
Trying to install interrupt handler for IRQ0
Trying to install interrupt handler for IRQ1
Trying to install interrupt handler for IRQ2
Trying to install interrupt handler for IRQ3
Trying to install interrupt handler for IRQ4
Trying to install interrupt handler for IRQ5
Trying to install interrupt handler for IRQ6
Trying to install interrupt handler for IRQ7
Trying to install interrupt handler for IRQ8
Trying to install interrupt handler for IRQ9
Trying to install interrupt handler for IRQ10
Trying to install interrupt handler for IRQ11
Trying to install interrupt handler for IRQ12
Trying to install interrupt handler for IRQ13
Trying to install interrupt handler for IRQ14
Trying to install interrupt handler for IRQ15
Trying to install interrupt handler for IRQ16
Trying to install interrupt handler for IRQ17
Trying to install interrupt handler for IRQ18
Trying to install interrupt handler for IRQ19
Trying to install interrupt handler for IRQ20
Trying to install interrupt handler for IRQ21
Trying to install interrupt handler for IRQ22
Trying to install interrupt handler for IRQ23
Trying to install interrupt handler for IRQ24
Trying to install interrupt handler for IRQ25
Trying to install interrupt handler for IRQ26
Trying to install interrupt handler for IRQ27
Trying to install interrupt handler for IRQ28
Trying to install interrupt handler for IRQ29
Trying to install interrupt handler for IRQ30
Trying to install interrupt handler for IRQ31
这个问题,这是由于在/arch/arm/mach-sep4020/irq.c中
void __init sep4020_init_irq(void)
{
unsigned int i;
unsigned long flags;
local_save_flags(flags);
*(RP)(INTC_IER_V) = 0XFFFFFFFF;
*(RP)(INTC_IMR_V) = 0XFFFFFFFF;
*(RP)(INTC_IPLR_V) = 0X0;
local_irq_restore(flags);
printk("sep4020_init_irq(void)\n");
for(i = 0; i < NR_IRQS; i++)
{
set_irq_handler(i, handle_level_irq);
       set_irq_chip(i, &sep4020_chip);
       set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
      
}
// __raw_writel(0, INTC_IMR_V);
}
函数中set_irq_handler(i, handle_level_irq);这句应该放在
set_irq_chip(i, &sep4020_chip);
       set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
这两句话后面才行的:现在的结果是
Starting kernel ...
Uncompressing Linux....................................... done, booting the kernel.
Linux version 2.6.26 () (gcc version 3.4.1) #35 Sat Jul 18 15:50:34 CST 2009
setup_arch(&command_line);
CPU: ARM720T [41807202] revision 2 (ARMv4T), cr=0000217f
Machine: 4020 board
Memory policy: ECC disabled, Data cache writeback
mm_init_owner(&init_mm, &init_task);
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8128
page_alloc_init();
Kernel command line: root=/dev/nfs rw nfsroot=192.168.0.3:/nfs ip=192.168.0.2:192.168.0.3:192.168.0.1:255.255.255.0::eth0:off console=ttyS0,115200 init=/linuxrc
trap_init();
init_IRQ();
sep4020_init_irq(void)
PID hash table entries: 128 (order: 7, 512 bytes)
init_timers();
time_init();
console_init();
Console: colour dummy device 80x30
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 32MB = 32MB total
Memory: 31248KB available (1012K code, 104K data, 68K init)
SLUB: Genslabs=12, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
rest_init();
platform_device_register sep4020_fb_set_platdata
msgmni has been set to 61
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0x10005000 (irq = 24) is a 16450
console [ttyS0] enabled
serial8250.0: ttyS1 at MMIO 0x10006000 (irq = 23) is a 16450
serial8250.0: ttyS2 at MMIO 0x10007000 (irq = 22) is a 16450
serial8250.0: ttyS3 at MMIO 0x10008000 (irq = 21) is a 16450
mice: PS/2 mouse device common for all mice
Freeing init memory: 68K
Failed to execute /linuxrc.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.
 
到这一步,移植就算结束了吧,呵呵
阅读(4210) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-11-14 00:57:22

你好,我 要使用AXD 调试LINUX2-6内核,现在不知道怎么写那个启动脚本,能否给些帮助,我不太清楚该怎么使用这个工具,我现在使用的 multi-ice 仿真器,是 realview debugger 但是调试的时候,程序总飞掉,想换成AXD,做试验,但是不知道那个脚本文件该怎么写! 谢谢,email/msn : rui-wang2002@163.COM