Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763508AbXJZSiR (ORCPT ); Fri, 26 Oct 2007 14:38:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756846AbXJZSiF (ORCPT ); Fri, 26 Oct 2007 14:38:05 -0400 Received: from terminus.zytor.com ([198.137.202.10]:56354 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753473AbXJZSiC (ORCPT ); Fri, 26 Oct 2007 14:38:02 -0400 Message-ID: <47223402.1050402@zytor.com> Date: Fri, 26 Oct 2007 11:37:54 -0700 From: "H. Peter Anvin" User-Agent: Thunderbird 2.0.0.5 (X11/20070727) MIME-Version: 1.0 To: Joseph Parmelee CC: Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: Old version of lilo fails to boot 2.6.23 References: <20071025014746.96e5e776.akpm@linux-foundation.org> <47211070.4090502@zytor.com> <4721194F.1040202@zytor.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1661 Lines: 43 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/