From owner-freebsd-arch@FreeBSD.ORG Wed Mar 23 20:51:14 2011 Return-Path: Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7868E106564A; Wed, 23 Mar 2011 20:51:14 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id F0A538FC12; Wed, 23 Mar 2011 20:51:13 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id p2NKovvH017465; Wed, 23 Mar 2011 21:51:12 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id p2NKov4g017463; Wed, 23 Mar 2011 21:50:57 +0100 (CET) (envelope-from olli) From: Oliver Fromme Message-Id: <201103232050.p2NKov4g017463@lurza.secnetix.de> To: arundel@FreeBSD.ORG (Alexander Best) Date: Wed, 23 Mar 2011 21:50:57 +0100 (CET) In-Reply-To: <20110323200200.GA85810@freebsd.org> X-Mailer: ELM [version 2.5 PL8] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.5 (lurza.secnetix.de [127.0.0.1]); Wed, 23 Mar 2011 21:51:13 +0100 (CET) Cc: bz@FreeBSD.ORG, freebsd-arch@FreeBSD.ORG Subject: Re: kernel memory checks on boot vs. boot time X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2011 20:51:14 -0000 Alexander Best wrote: > On Wed Mar 23 11, Oliver Fromme wrote: > > Alexander Best wrote: > > > just as a side note: booting a kernel directly from boot stage 2 is broken on > > > amd64. :( so there's no way around using the boot loader, which will cost extra > > > time (even with autoboot_delay=0). > > > > > > so was the adbility to boot a kernel directly from boot2 abandoned? i heard > > > reports it still works under i386. dunno about the other archs. > > > > The loader checks the type of the kernel binary (i386 vs > > amd64). In case of amd64, it enables "long mode", among > > other things. This is required for amd64, because the > > kernel expects to be started in long mode. boot2 doesn't > > do that, so you can't start an amd64 kernel directly from > > boot2. > > hmm...i can't seem to find the location in loader/main.c. could you pinpoint > me to the exact location? this is something i'd *really* like to try in amd64. The actual code is in sys/boot/i386/libi386/amd64_tramp.S which is called from sys/boot/i386/libi386/elf64_freebsd.c (see the elf64_exec() function), which in turn is called indirectly via a method of a struct file_format from the boot loader. Beware, I don't know if this is the *only* thing preventing boot2 from booting an amd64 kernel. There might be more. I haven't tried booting FreeBSD without the boot loader in a long time. Probably not in this century. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "I made up the term 'object-oriented', and I can tell you I didn't have C++ in mind." -- Alan Kay, OOPSLA '97