From owner-freebsd-stable@FreeBSD.ORG Wed Jul 31 16:15:21 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 26578402; Wed, 31 Jul 2013 16:15:21 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E0FCA2A11; Wed, 31 Jul 2013 16:15:20 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.15]) by ltcfislmsgpa07.fnfis.com (8.14.5/8.14.5) with ESMTP id r6VGFGVP005231 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Wed, 31 Jul 2013 11:15:16 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([10.132.99.23]) by LTCFISWMSGHT04.FNFIS.com ([10.132.206.15]) with mapi id 14.02.0309.002; Wed, 31 Jul 2013 11:15:15 -0500 From: "Teske, Devin" To: "Daniel O'Connor" Subject: Re: Booting FreeBSD with Syslinux Thread-Topic: Booting FreeBSD with Syslinux Thread-Index: AQHOjfdhEsIPFyDHo0KRCYhTn21ScJl/SiqA Date: Wed, 31 Jul 2013 16:15:14 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D7201FFC385@ltcfiswmsgmb21> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.126] Content-Type: text/plain; charset="us-ascii" Content-ID: <7F118CC2A4E16B4E8BEDFB53E595352B@fisglobal.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-07-31_05:2013-07-31,2013-07-31,1970-01-01 signatures=0 Cc: Devin Teske , freebsd-stable stable X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2013 16:15:21 -0000 On Jul 31, 2013, at 6:38 AM, Daniel O'Connor wrote: > Hi, > I am trying to make a FreeBSD 9.2 hybrid image (ie ISO & USB from the sam= e file) and as part of that I need to use syslinux. Unfortunately I can't g= et Syslinux's mboot.c32 to run the kernel or loader as suggested at http://= www.syslinux.org/wiki/index.php/Mboot.c32 - it reports "Invalid Multiboot i= mage: neither ELF header nor a.out kludge found". >=20 > I suspect I would be able to use memdisk as I have used that in the past = with syslinux (for 7.x) however this was seems a lot cleaner and easier to = generate. >=20 > Has anyone had any success with this? >=20 Absolutely. You can download and dissect the following to show you how it's done... http://druidbsd.sourceforge.net/download.shtml#FreeBSD_Druid It uses syslinux, as you can see here: http://druidbsd.cvs.sourceforge.net/viewvc/druidbsd/druidbsd/druid/src/boot= /freebsd/isolinux.cfg?revision=3D1.1&view=3Dmarkup As you can see, I use the memdisk.c32 module. Notice that I append "iso raw" as options to memdisk.c32. You may then be asking yourself... if the thing to do is to use memdisk wit= h an ISO... what's in said ISO? http://druidbsd.cvs.sourceforge.net/viewvc/druidbsd/druidbsd/druid/mdroot/ Basically... 1. Kernel 2. Boot Forth 3. mfsroot All that goes into an ISO. When memdisk initiates the ISO, "/boot/cdboot" t= hen gets invoked. >From there, /boot/loader gets invoked. >From there, the /boot/loader.rc is loaded. >From there, loader.4th is loaded. >From there, loader.conf is loaded. In a normal FreeBSD boot process, then the kernel gets loaded (I've modifie= d that to not load the kernel until later -- because my Forth boot menu pre= sents a kernel selection option) >From there, beastie.4th is loaded. >From there, beastie-start is called and then the beastie menu is drawn. NOTE: I've skipped a whole bunch of other Forth modules that were loaded "a= t-once" indirectly >From there, the user makes any boot option choices, and presses ENTER to bo= ot. >From there, mfsroot.gz is loaded. >From there, /stand/sysinstall gets invoked. >From there, /install.cfg gets invoked. >From there, /stand/fis gets invoked. >From there, /dev/iso9660/druid gets mounted onto /cdrom (this ISO9660 volum= e is actually _not_ the ISO that memdisk booted, but rather this is the act= ual CDROM (or DVD) that you booted from (which contains both the syslinux b= oot loader *and* the ISO it booted *and* anything else you want to access). At this point, /cdrom is your ticket to freedom, busting out of the double-= encapsulation (first encapsulation is wrapping the kernel+forth+mfsroot int= o an ISO, second level of encapsulation is from within the mfsroot; from wi= thin the mfsroot, the GEOM provided /dev/iso9660/ is an escape hatch= to the level *above* the ISO the mfsroot was embedded within). --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you.