From mboxrd@z Thu Jan 1 00:00:00 1970 From: tuffkidtt@gmail.com (Gavin Guo) Date: Fri, 1 Jul 2011 07:53:49 +0800 Subject: checking atags for boot parameters In-Reply-To: <1a6c14aa701560fd0dcda32478cebe5b@basementcode.com> References: <168051d7805b6717014ba340feec0ffa@basementcode.com> <1a6c14aa701560fd0dcda32478cebe5b@basementcode.com> Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org > ?It's not an error message, but with difficulty I was able to trace some > ?of the code and it ends up in a prefetch exception handler. I am not > ?able to find out from where however, and the line stepping is a bit > ?sketchy. No major patches to the kernel, and it runs in QEMU without > ?error. Adding uboot to QEMU then booting the same kernel yields the > ?problems. To see what's happened, you can check the register about exceptional virtual address in your platform, then up to the instruction caused the exception. As to the atags parameter, searching MACHINE_START under the platform you use, then the struct member, named boot_params, below the MACHINE_START should be found. According to the assigned value of boot_params, the address which uboot stick the parameter in can be examine to see if the value is the same as the one assigned in uboot. > ?It would be nice to find out what physical address the kernel is > ?uncompressed to as well, I'm as of yet unable to properly trace after > ?decompression. Referring to what I replied in another thread: You can see that in /arch/arm/kernel/head.S, the Kernel startup entry point is put in "ENTRY(stext)" above that is a line .section ".text.head", "ax" which says that the Kernel startup code is allocated in .text.head section. And also you can find the following at the beginning of the /arch/arm/kernel/vmlinux.lds.S: ENTRY(stext) #ifndef __ARMEB__ jiffies = jiffies_64; #else jiffies = jiffies_64 + 4; #endif SECTIONS { #ifdef CONFIG_XIP_KERNEL . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR); #else . = PAGE_OFFSET + TEXT_OFFSET; #endif .text.head : { _stext = .; _sinittext = .; *(.text.head) } Obviously, ".text.head" section begins with TEXT_OFFSET + PAGE_OFFSET. So, what is TEXT_OFFSET? It is defined in arch/arm/Makefile as TEXT_OFFSET := $(textofs-y) where you can also find that textofs-y is defined as "textofs-y := 0x00008000". PAGE_OFFSET is defined under configs/bcmring_defconfig:CONFIG_PAGE_OFFSET=0xC0000000, here bcmring_defconfig is just an example. You can find other defconfig also has CONFIG_PAGE_OFFSET too. The other trick is objdumpping the vmlinux under kernel root, then you can see the kernel startup address in the beginning of the first line. Gavin Guo OS kernel engineer Andestech