All of lore.kernel.org
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: Maximum bootable kernel size in current ARM linux
Date: Mon, 13 Sep 2010 13:38:13 +0100	[thread overview]
Message-ID: <20100913123813.GF30787@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <4C8E11D6.4050402@parrot.com>

On Mon, Sep 13, 2010 at 01:58:14PM +0200, Matthieu CASTET wrote:
> Russell King - ARM Linux a ?crit :
>> On Mon, Sep 13, 2010 at 10:10:39AM +0000, Simon Guinot wrote:
>>> On Mon, Sep 13, 2010 at 05:56:30PM +0800, Haojian Zhuang wrote:
>>>> On Mon, Sep 13, 2010 at 4:43 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
>>>>> Cheers
>>>> If initramfs is built in, we'll get a huge kernel. Even using LZMA, my
>>>> kernel size is near 5MB.
>>> The initramfs is located at the end of the init section and before the
>>> text section. Because the kernel must be able to 'branch' between the
>>> init and text sections, the initramfs size can't be greater than the
>>> 'branch' maximum offset. 32MB ?
>>>
>>> I guess that relocate the initramfs just after the text section should
>>> break this limitation.
>>
>> But then means that it won't be freed after init time.
> And why not putting it before init section ?

You still need code at the start of the kernel for the boot loader to
run, and some of that code needs to be reachable from the __init code.

You could move it away from the start of the kernel, replacing it with
a couple of instructions to branch to it, but then you're into problems
with setting up a 1:1 MMU mapping to cover the necessary code - and
making sure that the instructions don't overlap a mapping boundary.

Moreover, putting an initramfs at the very start risks making kernel
modules useless, as they're placed below the kernel in virtual space.
Adding an initramfs at the start of the kernel image pushes the kernel
text further away from the modules, possibly meaning that the modules
can't be linked.

So, all in all, having a large initramfs built into the kernel is a
stupid idea.  It's not going to work on ARM.

  reply	other threads:[~2010-09-13 12:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-13  7:40 Maximum bootable kernel size in current ARM linux Bruce M. Penrod
2010-09-13  8:43 ` Marek Vasut
2010-09-13  9:56   ` Haojian Zhuang
2010-09-13 10:10     ` Simon Guinot
2010-09-13 10:15       ` Russell King - ARM Linux
2010-09-13 11:58         ` Matthieu CASTET
2010-09-13 12:38           ` Russell King - ARM Linux [this message]
2010-09-14 12:35       ` Dave P. Martin
2010-09-14 12:54         ` Catalin Marinas
2010-09-14 17:37           ` Nicolas Pitre
2010-09-16 17:16             ` Catalin Marinas
2010-09-16 17:51               ` Russell King - ARM Linux
2010-09-16 18:37                 ` Nicolas Pitre
2010-09-17 10:09                 ` Catalin Marinas
2010-09-16 17:58               ` Nicolas Pitre
2010-09-17 10:09                 ` Catalin Marinas
2010-09-13 10:01 ` Russell King - ARM Linux
2010-09-13 19:43   ` Bruce M. Penrod
2010-09-14 17:32     ` Nicolas Pitre
2010-09-14 17:55       ` Bruce M. Penrod
2010-09-14 18:46         ` Nicolas Pitre
2010-09-15 20:30           ` Bruce M. Penrod
2010-09-15 22:02             ` Alexander Clouter
2010-09-15 22:19             ` Nicolas Pitre

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=20100913123813.GF30787@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.