Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Apr 2002 07:52:06 -0700 (PDT)
From:      Niels Heinen <niels.heinen@ubizen.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/37380: boot0 partition list is outdated (patch included)
Message-ID:  <200204231452.g3NEq6787812@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         37380
>Category:       misc
>Synopsis:       boot0 partition list is outdated (patch included)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 23 08:00:07 PDT 2002
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204231452.g3NEq6787812>