COMPUTER SYSTEM LABORATORY Lab8 - Debugging II. Lab 8 Experimental Goal Learn how to debug Linux in source-level by Domingo and diagnose target boards.

Slides:



Advertisements
Similar presentations
Computer System Laboratory
Advertisements

U-Boot and Linux Kernel Debug using CCSv5
Lab 4 Department of Computer Science and Information Engineering National Taiwan University Lab4 - Bootloader 2014/10/14/ 13 1.
Computer System Laboratory
Installing software on personal computer
Computer System Laboratory
Introduction Purpose Objectives Content Learning Time
UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.
COMPUTER SYSTEM LABORATORY Lab4 - Bootloader. Lab 4 Experimental Goal Learn how to build U-Boot bootloader for PXA /10/8/ 142.
Part 1 Using the ARM board And start working with C Tutorial 5 and 6
U-Boot Debug using CCSv5 In this session we will cover fundamentals necessary to use CCSv5 and a JTAG to debug a TI SDK-based U-Boot on an EVM platform.
One to One instructions Installing and configuring samba on Ubuntu Linux to enable Linux to share files and documents with Windows XP.
Lab 3 Department of Computer Science and Information Engineering National Taiwan University Lab3 - Cross Tools 2014/10/7/ 20 1.
Computer System Laboratory
Tutorial 11 Installing, Updating, and Configuring Software
COMPUTER SYSTEM LABORATORY Lab10 - Sensor II. Lab 10 Experimental Goal Learn how to write programs on the PTK development board (STM32F207). 2013/11/19/
Modifying Network Packet Buffering in Network Layer CS518 Final Presentation and Instruction Guide Li Zhang.
N ETWORKED & D ISTRIBUTED COMPUTING S YSTEMS L AB Programming Assignments EE323 Computer Networks.
Computer System Laboratory
VsFTP in Linux. Introduction to FTP The File Transfer Protocol (FTP) is used as one of the most common means of copying files between servers over the.
Lab 11 Department of Computer Science and Information Engineering National Taiwan University Lab11 - Porting 2014/12/9/ 26 1.
Please Note: Information contained in this document is considered LENOVO CONFIDENTIAL For Lenovo Internal Use Only Do Not Copy or Distribute!! For Lenovo.
GBT Interface Card for a Linux Computer Carson Teale 1.
Lab 1 Department of Computer Science and Information Engineering National Taiwan University Lab1 - Sensor 2014/9/23/ 13 1.
Conventions Department of Computer Science and Information Engineering National Taiwan University Conventions 2014/9/16/ 3 1.
Lab 10 Department of Computer Science and Information Engineering National Taiwan University Lab10 – Debugging II 2014/12/2 1 /16.
COMPUTER SYSTEM LABORATORY Lab6 - Root Filesystem.
Implementation of Embedded OS Lab3 Linux Kernel Modules.
Lab 14 Department of Computer Science and Information Engineering National Taiwan University Lab14 – Camera 2014/12/30 1 /14.
SAM9260-EK WinCE DEMO AT91 SAM9 Product Group. Version 1.0 October 2006.
7200 Samsung Confidential & Proprietary Information Copyright 2006, All Rights Reserved. 1/16 OfficeServ 7200 Enterprise IP Solutions Data Server S/W Upgrade.
Implementation of Embedded OS Lab4 Cortex-M3 Programming.
Lab 12 Department of Computer Science and Information Engineering National Taiwan University Lab12 – Driver 2014/12/16 1 /21.
Implementation of Embedded OS Lab3 Porting μC/OS-II.
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 – Bootloader + OS Kernel 2015/10/27/ 25 1.
Lab 1 Department of Computer Science and Information Engineering National Taiwan University Lab1 - Environment Setup 2015/9/15/ 30 1.
Lab 8 Department of Computer Science and Information Engineering National Taiwan University Lab8 - Root Filesystem 2015/11/10/ 22 1.
 Contents 1.Introduction about operating system. 2. Minimum requirement for Windows 7 operating system. 3. Procedure to install Window 7 operating system.
Lab 9 Department of Computer Science and Information Engineering National Taiwan University Lab9 - Debugging I 2014/11/4/ 28 1.
Implementation of Embedded OS
Virtual Machines Module 2. Objectives Define virtual machine Define common terminology Identify advantages and disadvantages Determine what software is.
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 - OS Kernel 2014/10/21/ 16 1.
Embedded Real-Time Systems Introduction to embedded software development Lecturer Department University.
Embedded Software Design Week II Linux Intro Linux Kernel.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course demonstrates the use of the High-performance.
Chap. 4 ARM Boot Loader Internals. 2 S3C2500 ARM940T Core module ARM9TDMI CoreIC.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com The U-boot bootloader Michael.
Computer System Laboratory
Computer System Laboratory
Computer System Laboratory
Implementation of Embedded OS
Computer System Laboratory
PL-IV (Group B-12) Printer Server
Computer System Laboratory
Computer System Laboratory
Implementation of Embedded OS
Implementation of Embedded OS
Data Server S/W Upgrade Samsung Electronics Co., Ltd.
Implementation of Embedded OS
Computer System Laboratory
PRU-ICSS Programming with CCS
Computer System Laboratory
Lecture9: Embedded Network Operating System: cisco IOS
Computer System Laboratory
Virtual Machine and VirtualBox
Computer System Laboratory
Computer System Laboratory
Computer System Laboratory
Virtual Machine and VirtualBox
Lecture9: Embedded Network Operating System: cisco IOS
Presentation transcript:

COMPUTER SYSTEM LABORATORY Lab8 - Debugging II

Lab 8 Experimental Goal Learn how to debug Linux in source-level by Domingo and diagnose target boards. 2013/11/5/ 262

Lab 8 Environment Host System Windows XP Build System VirtualBox + Ubuntu 8.04 Target System Creator XScale PXA270 Software Domingo Linux kernel Microtime diag program You can download all software from RSWiki CSL Course SoftwareRSWiki CSL Course Software 2013/11/5/ 263

Lab 8 Introduction to Debugging 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 Lab1 and 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. 2013/11/5/ 264 reference: wikipedia - debugging,

Lab 8 Prepare Linux Kernel and Source Codes We prepare a Linux kernel with some bugs for this Lab. Step1: download Linux source codes (linux lab8.tar.gz).linux lab8.tar.gz Step2: please refer to Lab5 to configure creator_pxa270_partitions[] for your filesystem. Step3: compile the new Linux kernel. Step4: convert to U-Boot bootable image. You can set image name in mkimage to identify different kernel images. Step5: copy to PXA /11/5/ 265

Lab 8 Install Samba Server (1/4) Before using Domingo, you should make sure that you can access your Linux source codes in Windows. However, we can not directly extract Linux source codes in Windows because there are many symbolic links in the source codes. To preserved these links, the source codes are usually extracted in Linux, e.g., in build system, Ubuntu8.04. Therefore, to access Linux source codes in Windows, we need to set up a samba server in the build system. Samba is a free implementation of the SMB/CIFS networking protocol originally developed by Andrew Tridgell. Through SMB/CIFS protocol, we can share files between Windows XP and Linux by network neighborhood ( 網路芳鄰 ). 2013/11/5/ 266 reference: wikipedia - samba,

Lab 8 Install Samba Server (2/4) Step1: install samba server in the build system. % sudo apt-get install samba Step2: add an user account for samba service. % sudo smbpasswd –a You can use the Linux account created in Lab1. Or add a new account to Linux by useradd before executing smbpasswd. 2013/11/5/ 267

Lab 8 Install Samba Server (3/4) Step3: suppose your Linux source codes are in (slide5) and the shared folder is, you can add a new entry in /etc/samba/smb.conf.slide5 [ ] path = browseable = yes read only = no create mask = 0664 directory mask = 0755 security = share Please also set the workgroup in [global] entry to the workgroup of host system (Windows XP), e.g., MSHOME, etc. You can check the workgroup in Windows XP by right-clicking on “ 我的電腦 ”  “ 內容 ”  “ 電腦名稱 ”. 2013/11/5/ 268

Lab 8 Install Samba Server (4/4) Step4: restart the samba service. % sudo /etc/init.d/samba restart 2013/11/5/ 269

Lab 8 Map Network Drive in Windows (1/3) Step1: refer to Lab7 to set up LAN IP address for Windows XP and Ubuntu8.04. Step2: check whether you can see Ubuntu in “ 網路芳鄰 ” or not. “ 我的電腦 ”  “ 網路上的芳鄰 ”  “ 檢視工作群組電腦 ” Or type \\ \ in the file browser. 2013/11/5/ 2610

Lab 8 Map Network Drive in Windows (2/3) If you can not see the shared folder, you can: Check network configuration in Ubuntu and VirtualBox. (Refer to Lab7) Check firewall in Windows XP. Restart virtual machine and PC. Step3: open command line in Windows XP. “ 開始 ”  “ 執行...” Type cmd and execute. Step4: map the directory to S: drive. % net use s: \\ \ /persistent:yes /user: is the IP of Ubuntu8.04. is the same as in slide8.slide8 and are the same as slide7.slide7 2013/11/5/ 2611

Lab 8 Map Network Drive in Windows (3/3) You can check the drive status by: % net use Or delete the drive by: % net use s: /DELETE Or read the usage of net use command by: % net use /? 2013/11/5/ 2612

Lab 8 Domingo Configuration (1/2) Step1: create a new project for PXA270. Step2: configure “OS support”. “Config”  “OS support”  “Linux 2.6” Step3: 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 2013/11/5/ 2613

Lab 8 Domingo Configuration (2/2) Step4: 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:\ 2013/11/5/ 2614

Lab 8 Download Linux in Domingo (1/3) Step1: connect to your PXA270 in Domingo. Step2: load debug module. “Debug”  “Load Module...” Choose vmlinux. Step3-1: configure the module. ModuleFormat = Elf for ARM Options = ELF path substitution Download Raw Data = unchecked Goto Main Address = 0xa ;start_kernel Linux - Dynamic Loaded Module = checked 2013/11/5/ 2615

Lab 8 Download Linux in Domingo (2/3) Step3-2: Additional Modules... = Set the path of zImage, i.e., \arch\arm\boot\zImage. Set the start address to P;a Step4: execute “UART View” or putty to access the console of PXA270. Step5: click “Ok” to start downloading Linux. 2013/11/5/ 2616

Lab 8 Download Linux in Domingo (3/3) After downloading is complete, you will see the Linux is stopped at start_kernel() function. Now, you can start debugging the Linux kernel. 2013/11/5/ 2617

Lab 8 Troubleshooting If you can not download the Linux image, you may refer to the following settings (TA’s): Workgroup = MSHOME = = /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 2013/11/5/ 2618

Lab 8 Debug Linux in Domingo (1/3) 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. 2013/11/5/ 2619

Lab 8 Debug Linux in Domingo (2/3) 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. 2013/11/5/ 2620 breakpoints

Lab 8 Debug Linux in Domingo (3/3) 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” 2013/11/5/ 2621

Lab 8 Debug Linux Kernel Please use Domingo to find out why the values of memory clock and system bus clock are zero. 2013/11/5/ 2622 ?

Lab 8 Diagnose Target Boards (1/2) Microtime provides a program diag that can help developers diagnose peripheral devices on PXA270, e.g., SDRAM, flash, LED, CCD, LCD, etc. You can diagnose the target board by yourself first if you think it is broken. Step1: download diag (diag_ram.bin).diag_ram.bin Step2: copy diag_ram.bin to flash address 0x40000 on PXA270. The erased end address is 0x7ffff (2 sectors). Please refer to Lab5 to configure creator_pxa270_partitions[] for diag. Step3: modify bootcmd environment variable in U-Boot. u-boot$ setenv bootcmd run diag u-boot$ saveenv You can change bootcmd back to “ run linux ” for booting Linux. 2013/11/5/ 2623

Lab 8 Diagnose Target Boards (2/2) Step4: reset PXA270 and then you will see the menu of diag on the LCD. You can select the menu item by pressing keys on the 4x4 keypad. You can check LEDs, LCD, keypads, and CMOS for coming Labs. 2013/11/5/ 2624 LCD 4x4 Keypad

Lab 8 Diagnose Target Boards (Optional) Furthermore, Microtime provides a whole image which includes bootloader, diag, Linux kernel, and root filesystem. It also can help developers to restore factory default. Step1: download the image (som-pxa270-u4-v2.0.bin).som-pxa270-u4-v2.0.bin Step2: copy som-pxa270-u4-v2.0.bin to flash address 0x0 on PXA270. The erased end address is 0x167ffff (183 sectors). It will take about 18 minutes. U-Boot will execute diag in default setting. 2013/11/5/ 2625 Memory Layout of the Image

Lab 8 Lab Requirement & Bonus Show how you find and correct the bug of Linux kernel we gave. Bonus: There is no Bonus here. Please send your report to both TAs. Please use this title format: [CSL] G# Lab# Ver# E.g., [CSL] G13 Lab8 Ver1 2013/11/5/ 2626