From owner-freebsd-hackers Thu Mar 25 16:41:56 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from dingo.cdrom.com (dingo.cdrom.com [204.216.28.145]) by hub.freebsd.org (Postfix) with ESMTP id 42BA11555C for ; Thu, 25 Mar 1999 16:41:55 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost.cdrom.com [127.0.0.1]) by dingo.cdrom.com (8.9.3/8.8.8) with ESMTP id QAA01323; Thu, 25 Mar 1999 16:33:00 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Message-Id: <199903260033.QAA01323@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: rkw@dataplex.net Cc: hackers@freebsd.org Subject: Re: Booting from non-standard floppy In-reply-to: Your message of "Thu, 25 Mar 1999 14:40:13 CST." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 25 Mar 1999 16:33:00 -0800 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I needed to cram "a few more bytes" on a floppy. > After doing the fdformat and writing everything, I tried to boot it. > Unfortunately, it fails with "Not ufs". > > Looking through the bootstraps, it appears that the new loader is using > the bios to actually read the floppy. As long as I stay on track 0, > everything is fine. However, even after we have loaded "boot2", we still > use the bios's idea of the format rather than the disklabel which has > the actual values. Unfortunately, the fs description extends beyond the > first track. > > It's been a long time since I wrote bootstrap loaders. But, as I > recall, the "bios" read the 0th sector (boot1) and jumped to it. > That short piece of code got the disk format from the label and > read in the next piece of the loader. After that, address->c.t.s > was under the software control. > > Is there some reason we no longer do this? Several; - Disklabels on floppies can't be trusted. - All disks are treated as equal, and geometries in disklabels on many disks can't be trusted. Often you can't get to the disklabel until after you've made assumptions about geometry anyway. You can save space a couple of ways; if you haven't already, gzip everything except the loader. If you don't need the loader for anything other than loading a kernel, throw the loader away; the bootblocks themselves know how to load ELF kernels. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message