From nobody@FreeBSD.org  Mon Mar  2 00:34:49 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BA1011065672
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  2 Mar 2009 00:34:49 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id A7AAA8FC22
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  2 Mar 2009 00:34:49 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n220YnOR015558
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 2 Mar 2009 00:34:49 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n220Yn17015557;
	Mon, 2 Mar 2009 00:34:49 GMT
	(envelope-from nobody)
Message-Id: <200903020034.n220Yn17015557@www.freebsd.org>
Date: Mon, 2 Mar 2009 00:34:49 GMT
From: Jin Guojun <jguojun@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: msdosfs has problems to read MSDOS Floppy
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         132237
>Category:       kern
>Synopsis:       [msdosfs] msdosfs has problems to read MSDOS Floppy
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-fs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 02 00:40:01 UTC 2009
>Closed-Date:    
>Last-Modified:  Mon May 18 04:28:17 UTC 2009
>Originator:     Jin Guojun
>Release:        6.3-R and 7.1-R
>Organization:
>Environment:
FreeBSD BSD.Belkin 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Sat Jan 10 20:47:04 PST 2009     root@BSD.Belkin:/usr/src/sys/i386/compile/MinMax  i386

>Description:
msdosfs does not like some files created by DOS 6.3 on a floppy disk:
 
[120] BSD.Belkin: mount_msdosfs -o ro /dev/fd0 /mnt
[121] BSD.Belkin: ll /mnt
ls: MA0-2008.TAB: No such file or directory
ls: ST-2008.TAB: No such file or directory
total 756
drwxr-xr-x   1 root  wheel    7168 Jan  1  1980 ./
drwxr-xr-x  23 root  wheel     512 Mar  1 15:16 ../
-rwxr-xr-x   1 root  wheel  265388 Jan  3 21:39 LAST.ZIP*
-rwxr-xr-x   1 root  wheel    9788 Feb 21  2008 MAO-2007.TAB*
-rwxr-xr-x   1 root  wheel    3348 Jan  5  2008 PRIM2007.TAB*
-rwxr-xr-x   1 root  wheel    1800 Mar  1 14:39 PRIM2008.TAB*
-rwxr-xr-x   1 root  wheel     752 Jan  5  2008 ST-2007.TAB*

00 00 00 00 00 A0 41 1B - C4 41 1D E4 41 1F 04 42   ......A..A..A..B  0000001A20
21 24 42 23 44 42 25 F4 - FF 00 00 00 00 00 00 00   !$B#DB%.........  0000001A30
00 00 FF 0F 00 00 00 00 - 00 00 00 00 00 00 00 00   ................  0000001A40
00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00   ................  0000001A50
** 00 ... skipped 186[BAH] lines
53 54 2D 32 30 30 37 20 - 54 41 42 20 00 00 00 00   ST-2007 TAB ....  0000002600
00 00 00 00 00 00 C2 A2 - 25 38 02 00 F0 02 00 00   ........%8......  0000002610
50 52 49 4D 32 30 30 37 - 54 41 42 20 00 00 00 00   PRIM2007TAB ....  0000002620
00 00 00 00 00 00 D8 A2 - 25 38 04 00 14 0D 00 00   ........%8......  0000002630
4D 41 4F 2D 32 30 30 37 - 54 41 42 20 00 00 00 00   MAO-2007TAB ....  0000002640
00 00 61 38 00 00 B0 AD - 55 38 0B 00 3C 26 00 00   ..a8....U8..<&..  0000002650
4C 41 53 54 20 20 20 20 - 5A 49 50 20 00 00 00 00   LAST    ZIP ....  0000002660
00 00 00 00 00 00 FC AC - 23 3A 1E 00 AC 0C 04 00   ........#:......  0000002670
41 78 00 78 00 78 00 00 - 00 FF FF 0F 00 7A FF FF   Ax.x.x.......z..  0000002680
FF FF FF FF FF FF FF FF - FF FF 00 00 FF FF FF FF   ................  0000002690
53 54 2D 32 30 30 38 20 - 54 41 42 20 00 00 00 00   ST-2008 TAB ....  00000026A0
00 00 61 3A 00 00 8B 74 - 61 3A 26 02 F5 01 00 00   ..a:...ta:&.....  00000026B0
50 52 49 4D 32 30 30 38 - 54 41 42 20 00 00 00 00   PRIM2008TAB ....  00000026C0
00 00 00 00 00 00 F7 74 - 61 3A 27 02 08 07 00 00   .......ta:'.....  00000026D0
41 31 00 30 00 33 00 39 - 00 2E 00 0F 00 C7 73 00   A1.0.3.9......s.  00000026E0
61 00 63 00 00 00 FF FF - FF FF 00 00 FF FF FF FF   a.c.............  00000026F0
4D 41 30 2D 32 30 30 38 - 54 41 42 20 00 00 00 00   MA0-2008TAB ....  0000002700
00 00 61 3A 00 00 41 77 - 61 3A 2B 02 0A 16 00 00   ..a:..Awa:+.....  0000002710

After insert this floppy on a W2K machine and copy them to C:/ and copy them back on to the floppy, the FAT table seems changed and msdosfs is happy:
(original table entries are marked as E5 -- ereased)

4D 41 30 2D 32 30 30 38 - 54 41 42 20 00 8F 2E 80   MAO-2008TAB ....  0000003980
61 3A 61 3A 00 00 41 77 - 61 3A 2B 02 0A 16 00 00   a:a:..Awa:+.....  0000003990
53 54 2D 32 30 30 38 20 - 54 41 42 20 00 5C 25 80   ST-2008 TAB .\%.  00000039A0
61 3A 61 3A 00 00 8B 74 - 61 3A 26 02 F5 01 00 00   a:a:...ta:&.....  00000039B0

All of files on this floppy are created by MSDOS 6.3. 
>How-To-Repeat:
No sure MS-DOS 6.3 will always create such FAT entries, which are readable by MS OSs, but FreeBSD.

FAT tables (before and after) are provided in description section. I will keep this floppy in case further may be needed for debug.
>Fix:


>Release-Note:
>Audit-Trail:

From: Garrett Cooper <yanefbsd@gmail.com>
To: Jin Guojun <jguojun@gmail.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/132237: msdosfs has problems to read MSDOS Floppy
Date: Sun, 1 Mar 2009 16:52:29 -0800

      The question is whether or not msdosfs properly supports FAT16 or  
 not, because that's what disks were formatted with under MSDOS 4.0 -  
 6.22. What happened when you converted the disk via Win2k is that the  
 machine converted the filesystem to FAT32, which is a completely  
 different system from FAT16, and which is guaranteed to be supported  
 with FreeBSD and msdosfs.
 HTH,
 -Garrett

From: "Jin Guojun[VFF]" <jguojun@gmail.com>
To: Garrett Cooper <yanefbsd@gmail.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/132237: msdosfs has problems to read MSDOS Floppy
Date: Mon, 02 Mar 2009 22:35:06 -0800

 Garrett Cooper wrote:
 
 >     The question is whether or not msdosfs properly supports FAT16 or  
 > not, because that's what disks were formatted with under MSDOS 4.0 -  
 > 6.22. What happened when you converted the disk via Win2k is that the  
 > machine converted the filesystem to FAT32, which is a completely  
 > different system from FAT16, and which is guaranteed to be supported  
 > with FreeBSD and msdosfs.
 > HTH,
 > -Garrett
 
 To make this a little bit more clear.
 The floppy has about 7-8 files, three of them are created under dos 
 Yesterday, and two are not
 recognized by FreeBSD MSDOS FS system.
 
 When putting the floppy in a Win2K machine, there is no disk format 
 involved.
 Two un-recgnized files are copied to hard drive, and they are deleted 
 from floppy (mark as erased).
 Then the two copies were copied back onto floppy, so the FAT table 
 should be kept the same as
 before. Only the table entries are changed becasue the original entries 
 are marked erased not freed.
 Thus, there is no file system change.
 If the FAT16 file system format is not supported, then we may not see 
 other files either, yes/no?
 
 -Jin
Responsible-Changed-From-To: freebsd-bugs->freebsd-fs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon May 18 04:28:06 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer(s). 

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