From nobody@FreeBSD.org  Tue Apr 23 07:52:07 2002
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 7A4D437B417
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 23 Apr 2002 07:52:06 -0700 (PDT)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.6/8.11.6) id g3NEq6787812;
	Tue, 23 Apr 2002 07:52:06 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200204231452.g3NEq6787812@freefall.freebsd.org>
Date: Tue, 23 Apr 2002 07:52:06 -0700 (PDT)
From: Niels Heinen <niels.heinen@ubizen.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: boot0 partition list is outdated (patch included)
X-Send-Pr-Version: www-1.0

>Number:         37380
>Category:       kern
>Synopsis:       [boot0] [patch] boot0 partition list is outdated
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    jhb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 23 08:00:07 PDT 2002
>Closed-Date:    Wed Jan 30 12:01:37 UTC 2008
>Last-Modified:  Wed Jan 30 12:01:37 UTC 2008
>Originator:     Niels Heinen
>Release:        4.5-STABLE
>Organization:
>Environment:
FreeBSD lappie 4.5-STABLE FreeBSD 4.5-STABLE #0: Thu Apr 18 02:05:19 CEST 2002     root@lappie:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
      
The partition lists, which is included in the boot0 code, is outdated
so an update would be nice ;-) The current boot0 code can detect 12 partition
types from which 6 are DOS based. Due to this outdated list, booot0 fails
to detect partitions such as those used by Windows NT / 2000 / XP. 

Because many people are using FreeBSD in combination with Windows and because
DOS is not a common operating system anymore, updating this excelent boot code
wouldn't do no harm ;-) 

A patch can be found in this report that removes some DOS paritions (FAT 12 for 
example) and adds Windows fat 32 and NTFS support to it. Please see that patch for 
more information. It has been tested on several Intel machines and seems to work 
fine.

A patched boot0 will be able to recognize 13 partitions:

5 Windows types
2 DOS types
1 NetBSD
1 FreeBSD
1 Linux
1 OpenBSD
1 Unix Sys V/386 and GNU HURD
1 Unknown (yeah this counts ;-)


>How-To-Repeat:
      

Created A small Windows partition (NTFS = 7) and reboot.

You will see something like:

F1 ??
F2 FreeBSD

?? will represent the Windows partion that isn't recognized.
>Fix:

If you want me to mail this patch please let me know and I'll do so..


--- boot0/boot0.s       Thu Apr 18 14:12:31 2002
+++ newboot0/boot0.s    Thu Apr 18 19:01:22 2002
@@ -12,6 +12,7 @@
 # warranties of merchantability and fitness for a particular
 # purpose.
 #
+# Minor changes where made to this file by Niels Heinen 18/04/2002
 
 # $FreeBSD: src/sys/boot/i386/boot0/boot0.s,v 1.14.2.6 2000/12/19 00:32:19 rnordier Exp $
 
@@ -25,7 +26,7 @@
                .set PRT_OFF,0x1be              # Partition table
 
                .set TBL0SZ,0x3                 # Table 0 size
-               .set TBL1SZ,0xc                 # Table 1 size
+               .set TBL1SZ,0xd                 # Table 1 size
 
                .set MAGIC,0xaa55               # Magic: bootable
                .set B0MAGIC,0xbb66             # Identification
@@ -351,7 +352,7 @@
 # Menu strings
 
 item:          .ascii "  ";         .byte ' '|0x80
-prompt:        .ascii "\nDefault:"; .byte ' '|0x80
+prompt:        .ascii "\nBoot:"; .byte ' '|0x80
 crlf:          .ascii "\r";         .byte '\n'|0x80
 
 # Partition type tables
@@ -364,18 +365,20 @@
 #
 # These values indicate bootable types we know the names of
 #
-               .byte 0x1, 0x4, 0x6, 0xb, 0xc, 0xe, 0x63, 0x83
-               .byte 0x9f, 0xa5, 0xa6, 0xa9
+               .byte 0x1, 0x7, 0x42, 0xb, 0xc, 0xe, 0x6
+               .byte 0x63, 0x83, 0x9f, 0xa5, 0xa6, 0xa9
 #
 # These are offsets that match the known names above and point to the strings
 # that will be printed.
 #
                .byte os_misc-.                 # Unknown
+               .byte os_win-.                  # Windows NTFS 
+               .byte os_win-.                  # Windows 2000 dyn ext 
+               .byte os_win-.                  # Windows 32-bit FAT 
+               .byte os_win-.                  # Windows 32-bit FAT ext in 13 
+               .byte os_win-.                  # Windows
                .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_unix-.                 # UNIX
                .byte os_linux-.                # Linux
@@ -388,9 +391,10 @@
 # the end of the string. (not so great for Russians but...)
 #
 os_misc:       .ascii "?";    .byte '?'|0x80
-os_dos:        .ascii "DO";   .byte 'S'|0x80
+os_dos:        .ascii "Do";   .byte 's'|0x80
 os_unix:       .ascii "UNI";  .byte 'X'|0x80
 os_linux:      .ascii "Linu"; .byte 'x'|0x80
+os_win:        .ascii "Wi"; .byte 'n'|0x80
 os_freebsd:    .ascii "Free"
 os_bsd:        .ascii "BS";   .byte 'D'|0x80  

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->jhb 
Responsible-Changed-By: johan 
Responsible-Changed-When: Tue Apr 23 14:08:21 PDT 2002 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37380 
Responsible-Changed-From-To: jhb->rnordier 
Responsible-Changed-By: johan 
Responsible-Changed-When: Tue Apr 23 16:59:57 PDT 2002 
Responsible-Changed-Why:  
John pointed out that rnordier is boot0 maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37380 
Responsible-Changed-From-To: rnordier->freebsd-bugs 
Responsible-Changed-By: rnordier 
Responsible-Changed-When: Wed Apr 24 11:17:48 PDT 2002 
Responsible-Changed-Why:  
Throw this one back in the pool.  I haven't been maintainer since 
mid-2001. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37380 
Responsible-Changed-From-To: freebsd-bugs->jhb 
Responsible-Changed-By: johan 
Responsible-Changed-When: Tue Aug 20 12:02:20 PDT 2002 
Responsible-Changed-Why:  
John, Robert do not consider himself maintainer 
anymore. Can you please have a look at this? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37380 

From: Volker <volker@vwsoft.com>
To: bug-followup@FreeBSD.org, niels.heinen@ubizen.com
Cc:  
Subject: Re: kern/37380: [boot0] [patch] boot0 partition list is outdated
Date: Wed, 30 Jan 2008 12:50:54 +0100

 I think this PR is obsolete and changes have been included into
 /usr/src/sys/boot/i386/boot0/boot0ext.S
 
 $FreeBSD: src/sys/boot/i386/boot0/boot0ext.S,v 1.7 2004/04/29 18:58:38
 ru Exp $
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Wed Jan 30 12:01:07 UTC 2008 
State-Changed-Why:  
Apparently the changes were incorporated some time ago. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37380 
>Unformatted:
