1 uClinux in the GDB/ARMulator
2 ----------------------------
4 This page can be found on the web at:
6 http://www.uclinux.org/pub/uClinux/utilities/armulator/
8 The web copy contains real links to many of the packages described herein.
11 Here are some patches to GDB to allow the existing gdb ARM emulator to run
12 uClinux targets. It can run both little-endian and big-endian code, as well
13 as apcs-32/26 code and Thumb. I have tested little/big endian kernels but
14 haven't played with thumb at this point.
16 The patch is heavily based on an ARM7100 patch that Ben Williamson produced
17 back around 1999 for gdb-4.18. The changes include Atmel AT91 emulation for
18 timers/system registers and serial ports, removal of Bens LCD support and
22 1. Getting GDB/ARMulator
24 Here are the files you need to use to put together the GDB/ARMulator.
27 The orginal gdb-5.0 archive.
29 gdb-5.0-uclinux-armulator-20021127.patch.gz
30 Patches against gdb-5.0 based heavily on the ARMulator changes from
31 Ben Williamson <benw@pobox.com> with changes to behave like an Atmel
35 2. Building GDB/ARMulator
37 bunzip2 < gdb-5.0.tar.bz2 | tar xvf -
38 gunzip < gdb-5.0-uclinux-armulator-20021127.patch.gz | patch -p0
40 ./configure --target=arm-elf
42 su root -c "make install"
47 During the configuration stepo choose GDB/ARMulator as the target. You
48 can select either the linux-2.0.x or linux-2.4.x kernels, and you can
49 choose either uC-libc or uClibc as the libaray.
52 4. Running the Binaries
54 The ARMulator expects the romfs to be in a file called "boot.rom".
55 So link the romfs.img to boot.rom with:
57 ln -s images/romfs.img boot.rom
59 Then to run uCLinux do:
61 arm-elf-gdb linux-2.X.X/linux
72 To save some typing you can create a .gdbinit file that conatins:
77 Then you just need to use "run" to start the kernel each time.
81 Just type ^C to drop into gdb. You have full source debugging of the kernel
82 (and apps if you load their symbols appropriately). You can step and
83 continue just like a normal debugger.
86 6. Messing with the Emulator
88 If you want to see how much of a hack this really is, the main files to
91 gdb-5.0/sim/arm/armmem.c
92 gdb-5.0/sim/arm/armio.c
94 These still include the old 7100 code commented out and the Atmel
95 emulation that is truly hacked in on top. You can add more memory and
96 change the size of the rom in armmem.c. You can fix most bugs in the
102 Patrick Doyle for the time.h patch to fixcompiling on RedHat 7.2/7.3
103 Fernando José Cardozo de Sá for his Native 32 port (and binaries).
104 Daniel Versick's big-endian patches for uaccess
105 (taken from http://mac.os.nctu.edu.tw/distfiles/4530.patch).
109 David McCullough <davidm@snapgear.com>