kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: tuffkidtt@gmail.com (Gavin Guo)
To: kernelnewbies@lists.kernelnewbies.org
Subject: checking atags for boot parameters
Date: Fri, 1 Jul 2011 07:53:49 +0800	[thread overview]
Message-ID: <BANLkTi=g4w1qoD3jNrwMj4WP1CwwzwwUdg@mail.gmail.com> (raw)
In-Reply-To: <1a6c14aa701560fd0dcda32478cebe5b@basementcode.com>

> ?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

      reply	other threads:[~2011-06-30 23:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-21 14:20 checking atags for boot parameters Christopher Harvey
2011-06-21 17:14 ` Mulyadi Santosa
2011-06-21 18:24   ` Christopher Harvey
2011-06-30 23:53     ` Gavin Guo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTi=g4w1qoD3jNrwMj4WP1CwwzwwUdg@mail.gmail.com' \
    --to=tuffkidtt@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).