Welcome to AVR32 Linux... Users Groups

Extracting the Linux console log using the JTAGICEmkII

Have you ever built a new kernel, only to see this disappointing output when trying to boot it?

   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK

Starting kernel at 90000000 (params at 107c0040)... 

...and nothing more. Now, what you probably want to know is what the kernel is really up to — has it crashed really early, before the console had been initialized? Is some of the boot parameters wrong? All this would be a lot easier to answer if you could only see the console log.

If you've got a JTAGICEmkII around, here's how you might be able to see the console log even if the console is non-working.

First, find the address of the log buffer. Open up the file called System.map in the directory where you built the kernel and search for __log_buf. The number right in front of it is its virtual address as seen by the kernel (on hexadecimal form)

If you can't find __log_buf, you probably haven't enabled printk support. This can be found under General setup -> Configure standard kernel features (for small systems)

Convert this virtual address to a physical address by zeroing out the three most significant bits. For example, if the address you found is 0x90131b14, the physical address is 0x10131b14 (i.e. just turn the first 9 into a 1.)

Now, you should be able to extract the contents of the log buffer using the avr32program utility. You need to specify the starting addres, which you just found, as well as a size. 16384 is as good a size as anything, but you might need to adjust it if you changed the size of the log buffer when configuring the kernel. Also, you need to select "binary" format output, as the contents of the log buffer is just ASCII in the first place.

avr32program read -Fbin -O0x10131b14 -s16384

The log buffer is padded with zeroes at the end, so normally you shouldn't see anything but the contents of the log buffer as nice ASCII text. If you see only garbage, the value you found for __log_buf is probably wrong — double-check that the System.map you're using corresponds to the kernel you're trying to boot.

If everything goes well, you should see some output like this:

Connected to JTAGICE mkII version 4.9, 4.24 at USB.
Reading 16384 bytes from 0x1013fe64.
<5>Linux version (root@RDavr32) (gcc version 4.0.2) #2 Wed Aug 23 15:48:32 CEST 2006
<4>CPU: 120.000 MHz CPU detected
<4>config0: 0100253e config1: 01f789e2
<4>CPU: AP7000 [01] revision 0 (AVR32B revision 1)
<4>CPU: MMU configuration: Shared TLB
<4>CPU: features: java perfctr ocd
<4>Physical memory:
<4>  10000000 - 10800000

and so on. Hopefully, this will help you determine what's wrong with your setup, or perhaps the kernel itself.

(some of this text was snatched from the AVR32 forum on avrfreaks.net. The actual procedure was posted by how, while mitsus posted the text dumps and gave feedback on the procedure.)

r2 - 2006-11-09 - 10:05:12 - HaavardSkinnemoen
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
Atmel®, AVR® and others are registered trademarks or trademarks of Atmel Corporation or its subsidiaries.
All other trademarks are the property of their respective owners.
Syndicate this site RSSATOM