From owner-freebsd-hackers@freebsd.org Mon Oct 8 21:02:22 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5E6610CB4FC; Mon, 8 Oct 2018 21:02:21 +0000 (UTC) (envelope-from jude.obscure@yandex.com) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DAF87D272; Mon, 8 Oct 2018 21:02:20 +0000 (UTC) (envelope-from jude.obscure@yandex.com) Received: from mxback12g.mail.yandex.net (mxback12g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:91]) by forward104j.mail.yandex.net (Yandex) with ESMTP id 987A541CD9; Tue, 9 Oct 2018 00:01:18 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback12g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id hplfwsPQ2D-1IgSrv6x; Tue, 09 Oct 2018 00:01:18 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1539032478; bh=PgQFt5AWpvRxcev8k01xcf5LUrQHhljsjUoS+kX8kQM=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=NAOIAXazNQyfTXH534ZYYJGx4eczIJtZmJTOTqYRzOwrl59O07hWrs9kaiX7ItUpM 2KIVI7tYmy00Ene6qQ9c/UGbuE0YZUL+6Ht7A4v9JXEETasZOxQnRf/xq3EyocKCVG OOEtH+xboDLn4qb4eQO8wwKR3q5D1KJ61Zd3Fq3I= Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Ucz6wPNY68-1GJqRHS0; Tue, 09 Oct 2018 00:01:17 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1539032477; bh=PgQFt5AWpvRxcev8k01xcf5LUrQHhljsjUoS+kX8kQM=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=ABFBd2A7TlzJ2M7s0csLsZuh0ujzyrH0Tg7XoDMptNl4LsqnXqtLeyhHZXNl6fzQl AO1supZO5/i5RlF+S6Bx2vI+69Y6kLDbtDk2/ge80BTrJXqEuMxjtS9abYL4GmXNd4 /ZXkd6q7Z3BIUtTvN8JfNTV63L2H0+tddXpMATb8= Authentication-Results: smtp1p.mail.yandex.net; dkim=pass header.i=@yandex.com Subject: Re: FreeBSD boot manager customization for single-disk multiboot (4 x DOS) To: Polytropon , FreeBSD Questions Cc: FreeBSD Hackers References: <20181007234040.028639f8.freebsd@edvax.de> From: Manish Jain Message-ID: <38342ce8-990a-ce05-7ab9-9f7d6017f91b@yandex.com> Date: Tue, 9 Oct 2018 02:30:10 +0530 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20181007234040.028639f8.freebsd@edvax.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Mon, 08 Oct 2018 21:48:19 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Oct 2018 21:02:22 -0000 On 10/08/18 03:10, Polytropon wrote: > I'm crossposting to the freebsd-hackers@ list, hope that's okay. > Replies from that list please keep me CC'd as I'm not subscribed > to that list. Thanks in advance! > > I have a strange and unique problem to solve and would like to > ask for pointers into the right direction (or at least pointers > into wrong directions _not_ to take). > > My IBM Thinkpad 755C died. In fact, the very special PSU exploded. > It provided special voltages (10V=, 20V=) on a special plug (4-pin > semi-rectangular). Its special disk can't be placed into a comparable > laptop as it's not a regular 2.5" unit - it's a little bit taller > and therefore won't fit the usual (P)ATA 2.5" disk bays. There is > some special software on that disk that I need to use from time > to time, and there is no way to use a modern laptop (too fast, > missing required connectors and drives, as well as low-level > control over those resources). The software I have to use is > very special and cannot be replaced by anything else. > > I can access (P)ATA laptop disks fine with FreeBSD and a USB > disk adapter, so reading disk content and copying it to somewhere > else is not a problem. > > I plan to dedicate a Fujitsu-Siemens Litebook LFL-G (500 MHz AMD > CPU, 128 MB RAM) as a replacement. It will also obtain the functions > formerly provided by a Toshiba T-2130CT laptop whose disk drive, > power supply, battery, case etc. died. But the disk is still there. > The Litebook will get a hard disk of 10 GB (or less, if I still > have one) partitioned as follows: > > 1st slice: 100 MB MS-DOS 5.0 from the Toshiba T-2130CT > > 2nd slice: 500 MB MS-DOS 6.22 + NDOS from a different DOS system > > 3rd slice: 1000 MB "Windows '95" + NDOS hybrid that was on the > IBM disk in the Thinkpad 755C > > 4th slice: remaining space: "Windows '98" as it came with that > laptop (original CD and license key present) > > The intended use of "slice" indicates that there will be 4 "DOS > primary partitions" on the disk. Staying with the "drive letters" > from DOS, every OS should see the partition it booted from as C:, > and it would be great if it didn't touch (or maybe even didn't > recognize) any of the other partitions. > > I think I could even use a 500 MB disk and strip everything down > to 50 + 100 + 150 + 200 MB as per the layout shown above! That > would also be fully sufficient for the special purposes. > > What I'm asking for _now_ is a convenient way to select which OS > to boot. I would not want to use today's GRUB because I don't plan > to use Linux on that particular system. In my opinion, the FreeBSD > boot manager will work nicely, but it will list all 4 systems with > the name "DOS". From what I learned by reading its source, this is > due to auto detection. I don't need that feature, I'd think about > altering the code in order to hard-code 4 names, like this: > > F1 DOS 5 > F2 DOS 6 > F3 Win 95 > F4 Win 98 > > Default: F1 > > So if I needed to boot the system that formerly ran on the Thinkpad > 755C, I'd press F3 and it would boot. Sure, I understand that there > is a good chance that I have to reconfigure drivers and such (as > it's a typical thing with "Windows"), but that won't be the big > problem. > > I know everything has to fit 512 bytes (and the code of the boot > manager illustrates this requirement very nicely by how the text > for the possible boot options is stored and selected). > > Questions: > > Would you say this is a possible way to go? Or would you suggest > that I refresh my assembly knowledge and write something myself, > maybe using the existing FreeBSD boot manager as inspiration and > organ donor? ;-) > > Or maybe there is something that can be installed and initially > configured from DOS? > > Distant past... I know there _were_ multi-boot utilities decades > ago, but I cannot remember any names. There is no luxury required, > no GUI, no boot graphics - just a simple means to select the OS > that should be booted. > > Oh, or maybe there is a long-forgotten functionality in the newer > "Windows" versions ('95 and '98 will be finally installed, but > none of then will ever see the Internet, of course), those also > once contained some kind of strange boot manager? > > If everything fails, I could still try to use the FreeBSD boot > manager "as is", with the following result predicted: > > F1 DOS > F2 DOS > F3 DOS > F4 DOS > > Default: F1 > > I'm not sure if it will recognize old-fashioned "Windows '95" > as "DOS" or "Windows"... > > > > Thank you for any inspiration! :-) > > > Poly, I suggest a better way than to use FreeBSD/Linux boot manager. Create 1 primary partition + an EBR with 4 logical drives (with the primary partition at the beginning of the disk). Install 4 x DOS/Win into the logical drives (all using the first primary partition as C:) Finally and if needed, alter the boot.ini in C: as you wish. Does that solve your problem, or compound it ? Regards, Manish Jain