Chinaunix首页 | 论坛 | 博客
  • 博客访问: 107351
  • 博文数量: 41
  • 博客积分: 2132
  • 博客等级: 大尉
  • 技术积分: 305
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-16 16:08
文章分类

全部博文(41)

文章存档

2012年(5)

2011年(3)

2010年(20)

2009年(13)

我的朋友

分类: LINUX

2009-09-25 19:56:16

1.编译带调试信息的内核,并将对应的zImage烧写到nandz中(bootloader在此必须已经正确的配置,确保传递参数的正确性)

2.目标板上电

##### FriendlyARM BIOS for 2440 #####                                          
[x] bon part 0 320k 2368k                                                      
[v] Download vivi                                                              
[k] Download linux kernel                                                      
[y] Download root_yaffs image                                                  
[c] Download root_cramfs image                                                 
[n] Download Nboot                                                             
[e] Download Eboot                                                             
[i] Download WinCE NK.nb0                                                      
[w] Download WinCE NK.bin                                                      
[d] Download & Run                                                             
[f] Format the nand flash                                                      
[p] Partition for Linux                                                        
[b] Boot the system                                                            
[s] Set the boot parameters                                                    
[t] Print the TOC struct of wince                                              
[q] Goto shell of vivi                                                         
Enter your selection:

3.启动OPENOCD并用telnet链接到OPENOCD然后说输入以下命令:

#halt

#bp 0x30008000 4 hw/*这是Bootloader加载zImage到内存的地址*/

#bp /*查看断点是否成功*/

#resume

3.minicom终端按下b键

##### FriendlyARM BIOS for 2440 #####                                          
[x] bon part 0 320k 2368k                                                      
[v] Download vivi                                                              
[k] Download linux kernel                                                      
[y] Download root_yaffs image                                                  
[c] Download root_cramfs image                                                 
[n] Download Nboot                                                             
[e] Download Eboot                                                             
[i] Download WinCE NK.nb0                                                      
[w] Download WinCE NK.bin                                                      
[d] Download & Run                                                             
[f] Format the nand flash                                                      
[p] Partition for Linux                                                        
[b] Boot the system                                                            
[s] Set the boot parameters                                                    
[t] Print the TOC struct of wince                                              
[q] Goto shell of vivi                                                         
Enter your selection: b

Copy linux kernel from 0x00050000 to 0x30008000, size = 0x00200000 ... done    
zImage magic = 0x016f2818                                                      
Setup linux parameters at 0x30000100                                           
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttyS"
MACH_TYPE = 782                                                                
NOW, Booting Linux......

4.回到telnet界面输入以下命令:

#rbp 0x30008000

#bp 0x300080d4 4 hw/*通过查看反汇编得知在这里开启MMU*/

#resume

5.这是minicom输出为

##### FriendlyARM BIOS for 2440 #####                                          
[x] bon part 0 320k 2368k                                                      
[v] Download vivi                                                              
[k] Download linux kernel                                                      
[y] Download root_yaffs image                                                  
[c] Download root_cramfs image                                                 
[n] Download Nboot                                                             
[e] Download Eboot                                                             
[i] Download WinCE NK.nb0                                                      
[w] Download WinCE NK.bin                                                      
[d] Download & Run                                                             
[f] Format the nand flash                                                      
[p] Partition for Linux                                                        
[b] Boot the system                                                            
[s] Set the boot parameters                                                    
[t] Print the TOC struct of wince                                              
[q] Goto shell of vivi                                                         
Enter your selection: b                                                        
Copy linux kernel from 0x00050000 to 0x30008000, size = 0x00200000 ... done    
zImage magic = 0x016f2818                                                      
Setup linux parameters at 0x30000100                                           
linux command line is: "noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttyS"
MACH_TYPE = 782                                                                
NOW, Booting Linux......                                                       
Uncompressing Linux.............................................................

6.开启eclipse 配置arm-linuc-gdb初始化命令如下

target remote localhost:3333
monitor halt
monitor step
monitor rbp 0x300080d4
monitor arm7_9 sw_bkpts enable
hbreak start_kernel
continue

7.启动GDB然后可以看见在start_kernel处停止

阅读(1101) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:如何编译OPENOCD 0.2.0

给主人留下些什么吧!~~