Snapgear Linux for LEON
Total Page:16
File Type:pdf, Size:1020Kb
SnapGear Linux for LEON Manual: SnapGear Linux for LEON LINUX-SNAPGEAR Version 1.36.0 Written by Daniel Hellström December 2007 Första Långgatan 19 413 27 Göteborg Sweden tel: +46 31 7758650 fax: +46 31 421407 www.gaisler.com LINUX-SNAPGEAR 2 Table of Contents 1 INTRODUCTION..............................................................................................................................5 1.1 LEON Linux.......................................................................................................................................5 1.2 SnapGear Linux..................................................................................................................................5 1.3 Boot loader for LEON Linux.............................................................................................................5 1.4 LEON simulator to speed up the development process.....................................................................6 1.5 Obtaining the software.......................................................................................................................6 1.6 Supported hardware............................................................................................................................6 1.7 Support...............................................................................................................................................6 2 INSTALLING GNU TOOLCHAIN AND LEON LINUX...............................................................7 2.1 Selecting Toolchain............................................................................................................................7 2.2 Installing the toolchain.......................................................................................................................7 2.3 Installing SnapGear for LEON Linux 2.0..........................................................................................8 2.4 Installing SnapGear for LEON Linux 2.6..........................................................................................8 3 CONFIGURING LINUX...................................................................................................................9 3.1 Processor type and MMU...................................................................................................................9 3.2 C library............................................................................................................................................10 3.2.1 Static vs Dynamic linking................................................................................................................10 3.2.2 Toolchains for Linux 2.6..................................................................................................................10 3.2.3 Toolchains for Linux 2.0..................................................................................................................10 3.3 Kernel version..................................................................................................................................10 3.4 Configuring the boot loader.............................................................................................................11 3.4.1 Symmetric multi-processing............................................................................................................13 3.5 Configuring the 2.6.x kernel............................................................................................................13 3.5.1 LEON processor type.......................................................................................................................13 3.5.2 Symmetric multi-processing support...............................................................................................13 3.5.3 Gaisler AMBA Plug&Play procfs support.......................................................................................14 3.5.4 GRLib APBUART (LEON3)...........................................................................................................14 3.5.5 LEON Serial (LEON2).....................................................................................................................14 3.5.6 GRLib GRETH 10/100/1000...........................................................................................................14 3.5.7 GRLib OpenCores Ethernet MAC...................................................................................................14 3.5.8 SMC 91x Ethernet MAC..................................................................................................................15 3.5.9 GRLib GRETH 10/100/1000 over PCI............................................................................................15 3.5.10 GRLib OpenCores I2C-master.........................................................................................................15 3.5.11 GRLib PCI support...........................................................................................................................15 3.5.12 GRLib GRPS2..................................................................................................................................15 3.5.13 GRLib SPICTRL..............................................................................................................................15 3.5.14 GRLib GRUSBHC...........................................................................................................................16 3.5.15 GRLib GRVGA................................................................................................................................16 3.5.16 GRLib ATA Controller....................................................................................................................17 3.6 Configuring the 2.0.x kernel............................................................................................................18 3.6.1 LEON processor type.......................................................................................................................18 3.6.2 GRLib APBUART (LEON3)...........................................................................................................18 3.6.3 LEON Serial (LEON2).....................................................................................................................19 3.6.4 GRLib GRETH 10/100 Ethernet MAC............................................................................................19 3.6.5 GRLib OpenCores 10/100 Ethernet MAC.......................................................................................19 3.6.6 SMC 91C111 10/100 Ethernet MAC...............................................................................................19 3.6.7 GRLib VGA text frame buffer support............................................................................................19 3.6.8 GRLib GRPS2 PS/2 interface/keyboard..........................................................................................20 3.7 Applications included in ROMFS....................................................................................................20 3.8 Template configurations...................................................................................................................21 4 BUILDING SNAPGEAR................................................................................................................23 5 ADDING CUSTOM APPLICATIONS...........................................................................................24 LINUX-SNAPGEAR 3 5.1 Creating an application.....................................................................................................................24 5.2 Setting up compilation directives.....................................................................................................24 5.3 Including application to file system.................................................................................................24 6 DEBUGGING LINUX-2.6 AND APPLICATIONS.......................................................................25 6.1 Debugging symbols..........................................................................................................................25 6.2 Debugging the kernel.......................................................................................................................25 6.2.1 Configuring GRLIB for kernel debugging.......................................................................................26 6.2.2 Using GRMON.................................................................................................................................26 6.2.3 GRMON Example: debugging the Linux kernel.............................................................................26 6.3 Debugging userspace applications...................................................................................................29 6.3.1 Setting up a debugging environment................................................................................................30 6.3.2 GDB introduction.............................................................................................................................30 6.3.3 Starting GDB server on target..........................................................................................................30 6.3.4 Connecting with GDB to gdbserver.................................................................................................31 6.3.5 GDB example usage.........................................................................................................................31