public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Joseph Parmelee <jparmele@wildbear.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: Re: Old version of lilo fails to boot 2.6.23
Date: Fri, 26 Oct 2007 11:37:54 -0700	[thread overview]
Message-ID: <47223402.1050402@zytor.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0710260131280.17830@bruno>

Joseph Parmelee wrote:
> 
> This patch will work in my particular case, though it appears to violate 
> the rules about getting too close to the EBDA (SP=0xB000 on entry).
> 
> The boot loader is responsible for loading the kernel loader at a suitable
> location in low memory, but I don't understand why the boot loader 
> should be
> involved in setting the stack at all.  If we explicitly allocate the stack
> as part of the .data segment, why not just play it safe and in all cases
> fully set up the stack in header.S?  This insures that the stack pointer is
> not zero, is as low as possible to stay out of the EBDA, and that ss=ds;
> quite irrespective of what the boot loader does.
> 
> What am I missing?
> 

What you're missing is that "just loading into a suitable location in 
low memory" isn't a sufficient condition.  This is something that one 
finds out very quickly trying to do boot loader work.

Heap and stack control the amount of functionality that is available, 
and therefore the protocol allows them to be dynamic.

Anyway, the final version of the patch that I sent you privately uses 
this logic:

- If heap size is properly reported, use it.
- Otherwise, if %ss == %ds, then use the stack pointer as entered.
- Otherwise, use the minimum stack.

This seems like a fairly reasonable compromise, especially since 
anything even remotely modern will be handled by the first clause.

	-hpa




      reply	other threads:[~2007-10-26 18:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-16  7:07 Old version of lilo fails to boot 2.6.23 Joseph Parmelee
2007-10-25  8:47 ` Andrew Morton
2007-10-25  9:08   ` H. Peter Anvin
2007-10-25 21:53   ` H. Peter Anvin
2007-10-25 22:31     ` H. Peter Anvin
2007-10-26 18:25       ` Joseph Parmelee
2007-10-26 18:37         ` H. Peter Anvin [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=47223402.1050402@zytor.com \
    --to=hpa@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=jparmele@wildbear.com \
    --cc=linux-kernel@vger.kernel.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