checking atags for boot parameters
I'm suspicious that the bootloader I'm using isn't passing atags to the kernel properly.
I'm getting a prefetch exception right after the "uncompressing linux....done" message, does it make sense that this could happen because mem=128M isn't getting passed properly?
Basically what I want to do is have the kernel print out the boot parameters along with the "uncompressing linux" message.
thanks,
Christopher
Hi Christ... :)
Quoted 2 lines · Christopher Harvey
?I'm suspicious that the bootloader I'm using isn't passing atags to the ?kernel properly.
which bootloader?
Quoted 3 lines
?I'm getting a prefetch exception right after the "uncompressing ?linux....done" message, does it make sense that this could happen ?because mem=128M isn't getting passed properly?
uhm, fairly unlikely for me.... must be something else... could you tell us which arch it is and which kernel version (along with patches from certain tree, if any) that yield that error message?
Signature · 7 lines
regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
Quoted 1 line · Mulyadi Santosa
Hi Christ... :)
It's Chris.
Quoted 8 lines
Quoted 3 lines · Christopher Harvey
?I'm suspicious that the bootloader I'm using isn't passing atags to the
?kernel properly.which bootloader?
uboot
Quoted 8 lines
Quoted 4 lines
?I'm getting a prefetch exception right after the "uncompressing ?linux....done" message, does it make sense that this could happen ?because mem=128M isn't getting passed properly?
uhm, fairly unlikely for me.... must be something else... could you tell us which arch it is and which kernel version (along with patches from certain tree, if any) that yield that error message?
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.
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.
-C
Quoted 6 lines
?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.
Quoted 3 lines
?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