From owner-freebsd-questions@FreeBSD.ORG Wed Jun 8 20:54:58 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 14B1316A41C for ; Wed, 8 Jun 2005 20:54:58 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from smtp-out1.blueyonder.co.uk (smtp-out1.blueyonder.co.uk [195.188.213.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6638043D58 for ; Wed, 8 Jun 2005 20:54:56 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from [82.41.37.55] ([82.41.37.55]) by smtp-out1.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.6713); Wed, 8 Jun 2005 21:55:34 +0100 Message-ID: <42A75B1E.2010202@dial.pipex.com> Date: Wed, 08 Jun 2005 21:54:54 +0100 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-GB; rv:1.7.8) Gecko/20050530 X-Accept-Language: en, en-us, pl MIME-Version: 1.0 To: Paul Schmehl References: <0DF7FF668F71A2B85D47F59B@utd59514.utdallas.edu> In-Reply-To: <0DF7FF668F71A2B85D47F59B@utd59514.utdallas.edu> Content-Type: multipart/mixed; boundary="------------070405040003000705020106" X-OriginalArrivalTime: 08 Jun 2005 20:55:34.0927 (UTC) FILETIME=[6A8499F0:01C56C6C] Cc: freebsd-questions@freebsd.org Subject: Re: Editing the boot menu X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2005 20:54:58 -0000 This is a multi-part message in MIME format. --------------070405040003000705020106 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Paul Schmehl wrote: > When you use FreeBSD's boot manager, you get a menu like this at bootup: > > F1 DOS > F2 FreeBSD > F3 Linux > F4 ?? > F5 Drive 1 > > Default: F2 > > Is there a way to edit the list? Or is that fixed when boot manager > is installed and not configurable? > You have to edit the source. If you know the hex for the partition type then it's reasonably easy. Below is a simple patch that adds 0x7 (my NTFS/Windows) and recognises it as DOS. Done out of curiosity, more than anything. (From memory...) cd /usr/src patch < {patchname} cd sys/boot/i386/boot0/ make make install boot0cfg -B -o packet /dev/{your disk} Be warned that the final boot0cfg has to be 512 bytes so if you add a string it may become longer. I haven't tested my patch for the serial console boot. The patch incorporates taking out the bell on non-serial-console boots as well (pinched from somewhere else, now forgotten) -- it was just annoying. The patch comes with no warranties, but it's working for me. (I don't promise either that including it here won't bu**er up the spaces/tabs). Of course, once you applied and rebuilt you have to write it to your boot sector. Man boot0cfg and don't forget -o packet if your partitions go past cylinder 1024. And have a FreebSD boot CD handy so you can rewrite with a standard one if this doesn't work! The final problem is that if you use cvsup it will trash all over any source changes you make when you next run it. Doing anything about that seems more complicated than can be justified for a small number of patches so I just keep them in a separate dir an re-apply them whenever I need to. In this case, it will be just after I reaslise that I've installed a beeping boot manager again :-) --Alex PS just spotted the -m flag to boo0cfg for the first time. Amazing what you find when you read the man pages :-) --------------070405040003000705020106 Content-Type: text/plain; name="patch-boot0.S.i386" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-boot0.S.i386" --- sys/boot/i386/boot0/boot0.S.orig Wed Jan 26 19:11:21 2005 +++ sys/boot/i386/boot0/boot0.S Thu May 26 00:51:34 2005 @@ -29,7 +29,7 @@ .set PRT_OFF,0x1be # Partition table .set TBL0SZ,0x3 # Table 0 size - .set TBL1SZ,0xb # Table 1 size + .set TBL1SZ,0xc # Table 1 size .set MAGIC,0xaa55 # Magic: bootable .set B0MAGIC,0xbb66 # Identification @@ -201,9 +201,13 @@ /* * Start of input loop. Beep and take note of time */ +#ifdef SIO main.10: movb $ASCII_BEL,%al # Signal callw putchr # beep! xorb %ah,%ah # BIOS: Get +#else +main.10: xorb %ah,%ah # BIOS: Get +#endif /* SIO */ int $0x1a # system time movw %dx,%di # Ticks when addw _TICKS(%bp),%di # timeout @@ -409,7 +413,7 @@ /* * These values indicate bootable types we know the names of. */ - .byte 0x1, 0x4, 0x6, 0xb, 0xc, 0xe, 0x83 + .byte 0x1, 0x4, 0x6, 0x7, 0xb, 0xc, 0xe, 0x83 .byte 0x9f, 0xa5, 0xa6, 0xa9 /* * These are offsets that match the known names above and point to the strings @@ -419,6 +423,7 @@ .byte os_dos-. # DOS .byte os_dos-. # DOS .byte os_dos-. # DOS + .byte os_dos-. # Windows .byte os_dos-. # Windows .byte os_dos-. # Windows .byte os_dos-. # Windows --------------070405040003000705020106--