Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lab 10 Department of Computer Science and Information Engineering National Taiwan University Lab10 – Debugging II 2014/12/2 1 /16.

Similar presentations


Presentation on theme: "Lab 10 Department of Computer Science and Information Engineering National Taiwan University Lab10 – Debugging II 2014/12/2 1 /16."— Presentation transcript:

1 Lab 10 Department of Computer Science and Information Engineering National Taiwan University Lab10 – Debugging II 2014/12/2 1 /16

2 Lab 10 Department of Computer Science and Information Engineering National Taiwan University  Learn how to debug Linux in source-level by Domingo. 2014/12/2 2 /16

3 Lab 10 Department of Computer Science and Information Engineering National Taiwan University  Host System  Windows XP  Build System  VirtualBox + Ubuntu 8.04  Target System  Creator XScale PXA270  Software  Domingo  Linux kernel  You can download all software from RSWiki CSL Course SoftwareRSWiki CSL Course Software 2014/12/2 3 /16

4 Lab 10 Department of Computer Science and Information Engineering National Taiwan University  Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware, thus making it behave as expected.  In Lab2, we introduce Domingo, which is an integrated development environment developed by Microtime Computer Inc.  Domingo can be used to not only transfer binaries to RAM but also debug in source-level.  In this lab, we will introduce how to debug Linux kernel in source-level. 2014/12/2 4 /16

5 Lab 10 Department of Computer Science and Information Engineering National Taiwan University  We prepare a Linux kernel with some bugs for this Lab.  Step 1: download Linux source codes (linux-2.6.15.3.lab10.tar.gz).linux-2.6.15.3.lab10.tar.gz  Step 2: please refer to Lab5 to configure creator_pxa270_partitions[] for your filesystem.  Step 3: compile the new Linux kernel.  Step 4: convert to U-Boot bootable image.  You can set image name in mkimage to identify different kernel images.  Step 5: copy to PXA270. 2014/12/2 5 /16

6 Lab 10 Department of Computer Science and Information Engineering National Taiwan University  Step 1: create a new project for PXA270.  Step 2: configure “OS support”.  “Config”  “OS support”  “Linux 2.6”  Step 3: configure Linux path.  “Linux 2.6”  “Linux Path Setting...”  Linux Debug Information ( vmlinux ) = the path of vmlinux  Linux dist Path = the path of linux directory  Device Driver Path = the path of device drivers  S is your network drive of samba server. 2014/12/2 6 /16

7 Lab 10 Department of Computer Science and Information Engineering National Taiwan University  Step 4: since the path of Linux source codes in Ubuntu is different from Windows XP, we need to configure “ELF path substitution” to replace the path.  “Debug”  “Default ELF Path Substitution...”  Path Prefix = your path of kernel compilation  Replace As = S:\ 2014/12/2 7 /16

8 Lab 10 Department of Computer Science and Information Engineering National Taiwan University  Step 1: connect to your PXA270 in Domingo.  Step 2: load debug module.  “Debug”  “Load Module...”  Choose vmlinux.  Step 3-1: configure the module.  ModuleFormat = Elf for ARM  Options = ELF path substitution  Download Raw Data = unchecked  Goto Main Address = 0xa0008000;start_kernel  Linux - Dynamic Loaded Module = checked 2014/12/2 8 /16

9 Lab 10 Department of Computer Science and Information Engineering National Taiwan University  Step 3-2:  Additional Modules... =  Set the path of zImage, i.e., \arch\arm\boot\zImage.  Set the start address to P;a0008000.  Step 4: execute “UART View” or putty to access the console of PXA270.  Step 5: click “Ok” to start downloading Linux. 2014/12/2 9 /16

10 Lab 10 Department of Computer Science and Information Engineering National Taiwan University  After downloading is complete, you will see the Linux is stopped at start_kernel () function.  Now, you can start debugging the Linux kernel. 2014/12/2 10 /16

11 Lab 10 Department of Computer Science and Information Engineering National Taiwan University  If you can not download the Linux image, you may refer to the following settings (TA’s):  Workgroup = MSHOME  = 192.168.0.101  = /home/lab202/CSL/10201/lab8/pxa270/  = Creator  Path of linux directory = /home/lab202/CSL/10201/lab8/pxa270/linux  Path of vmlinux = /home/lab202/CSL/10201/lab8/pxa270/linux/vmlinux  Path of Linux device drivers = /home/lab202/CSL/10201/lab8/pxa270/linux/drivers 2014/12/2 11 /16

12 Lab 10 Department of Computer Science and Information Engineering National Taiwan University  You can select specific functions on the menu bar for debugging.  M: images.  F: source files in the specific image M.  L: functions in the specific source file F. 2014/12/2 12 /16

13 Lab 10 Department of Computer Science and Information Engineering National Taiwan University  You can set breakpoints by clicking the line number.  Breakpoints can be cancelled by clicking again.  After setting breakpoints, you can continue the program by following operations. breakpoints 2014/12/2 13 /16

14 Lab 10 Department of Computer Science and Information Engineering National Taiwan University  You can see register values in register window.  You also can watch variables in watch list.  Please refer to Domingo tutorial for more information.  “View”  “Tutorial” 2014/12/2 14 /16

15 Lab 10 Department of Computer Science and Information Engineering National Taiwan University  Please use Domingo to find out why the values of memory clock and system bus clock are zero. ? 2014/12/2 15 /16

16 Lab 10 Department of Computer Science and Information Engineering National Taiwan University  Show how you find and correct the bug of Linux kernel we gave. 2014/12/2 16 /16


Download ppt "Lab 10 Department of Computer Science and Information Engineering National Taiwan University Lab10 – Debugging II 2014/12/2 1 /16."

Similar presentations


Ads by Google