Download MIPS32 Malta Linux - Open Virtual Platforms

Transcript
MIPS32 Malta Linux Platform
9
Debugging the Linux Kernel...................................................................................... 55
9.1
Non-Intrusive Instrumentation ........................................................................... 55
9.2
Attaching the Debugger ..................................................................................... 55
9.2.1
Starting the Platform Simulation................................................................ 55
10 Transferring Files to Guest Linux .............................................................................. 57
10.1 Introduction ........................................................................................................ 57
10.2 Using an FTP Server .......................................................................................... 57
10.2.1
Starting the Simulation............................................................................... 57
10.2.2
Adding Additional Linux Components ...................................................... 58
10.2.3
Transfer Files.............................................................................................. 58
10.3 Using TFTP ........................................................................................................ 59
10.3.1
Starting the Simulation............................................................................... 60
10.3.2
Adding Additional Linux Components ...................................................... 60
10.3.3
Transfer Files into Guest Operating System .............................................. 61
11 Debugging Linux User Applications.......................................................................... 63
11.1 Introduction ........................................................................................................ 63
11.2 Linux Installation ............................................................................................... 63
11.3 Booting Linux .................................................................................................... 63
11.3.1
Redirecting TCP Port ................................................................................. 63
11.3.2
Enabling TFTP File Transfer ..................................................................... 64
11.4 Compiling a User Program................................................................................. 64
11.4.1
Cross Compiler ToolChain......................................................................... 64
11.4.2
Cross Compiler Make Environment........................................................... 64
11.4.3
Building the Application ............................................................................ 65
11.5 Adding Additional Linux Components .............................................................. 65
11.6 Remote Debug using GDBserver....................................................................... 66
11.6.1
Starting GDB Server .................................................................................. 66
11.6.2
Connecting to GDB Server ........................................................................ 67
11.6.2.1
Using Eclipse......................................................................................67
11.6.2.2
Using DDD from a Linux Host ..........................................................67
11.6.2.3
Using GDB from local Windows Host .............................................. 68
11.6.3
Debugging Multiple Applications in Parallel............................................. 70
11.7 Debug using Simulated GDB............................................................................. 71
12 Creating an Example Linux Kernel Module .............................................................. 73
12.1 Introduction ........................................................................................................ 73
12.2 Pre-Requsites...................................................................................................... 73
12.3 Starting the Platform Simulation........................................................................ 73
12.4 Example Source.................................................................................................. 74
12.4.1
Included Header Files................................................................................. 74
12.4.2
Callback Table and Functions .................................................................... 74
12.4.2.1
Table...................................................................................................74
12.4.2.2
Device Open.......................................................................................74
12.4.2.3
Device Close ......................................................................................74
12.4.2.4
Device Read .......................................................................................75
12.4.2.5
Device Write ...................................................................................... 75
12.4.3
Device Module Initialize and Exit ............................................................. 75
12.4.3.1
Device Initialisation ........................................................................... 75
© 2010 Imperas Software Limited
www.OVPworld.org
.
Page 5 of 115