info-mtools
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [mtools] Short filenames, codepages and possible mtools/kernel bug


From: David C Niemi
Subject: Re: [mtools] Short filenames, codepages and possible mtools/kernel bug
Date: Sun, 28 May 2006 20:56:37 -0400 (EDT)


This probably goes back to a shortcut I took in 1994 to get VFAT working on Mtools. As you may know VFAT uses 16-bit Unicode, and I assumed that the high bits would always be zero. So there's no support for special code pages unless Alain has since added it.

However, mounting the floppy with the kernel MSDOS file system support is a totally separate implementation, by different people.

DCN

On Sun, 28 May 2006, Jaime wrote:
Hi.

I have a bit of a problem - I'm not sure whether it's
rooted in my stupidity or whether there's a bug somewhere.

I have a diskette which I've formatted under windows 2000 (standard
British English install, codepage is 850).
On the diskette I've created an empty file called ABÇDE.TXT (that's the
letters A to E, but the C has a cedilla under it). Just to check, I open
a command prompt in windows, and run "dir a:" - the filename looks
exactly as above.

Then I swap over to Linux, and run "mdir a:". What I now see is:

AB�DE    TXT         0 2006-05-28  16:00  AB�DE.TXT
       1 file                    0 bytes
                         1 457 664 bytes free

(the capital C cedilla has been replaced by a tiny white question mark
inside a black diamond/lozenge). Just to check, I mount the filesystem
using the following command:

mount -t msdos -o codepage=850 /dev/fd0 temp

Then, ls shows me a question mark where the capital C cedilla should be.

Running "dosfsck -v /dev/fd0" seems to be OK:
dosfsck 2.11 (12 Mar 2005)
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
Checking we can access the last sector of the filesystem
Boot sector contents:
System ID "MSDOS5.0"
Media byte 0xf0 (5.25" or 3.5" HD floppy)
      512 bytes per logical sector
      512 bytes per cluster
        1 reserved sector
First FAT starts at byte 512 (sector 1)
        2 FATs, 12 bit entries
     4608 bytes per FAT (= 9 sectors)
Root directory starts at byte 9728 (sector 19)
      224 root directory entries
Data area starts at byte 16896 (sector 33)
     2847 data clusters (1457664 bytes)
18 sectors/track, 2 heads
        0 hidden sectors
     2880 sectors total
Checking for unused clusters.
/dev/fd0: 1 files, 0/2847 clusters

And when I run a hexeditor on the raw filesystem, I get something like
this:

25F0  00 00 00 00  00 00 00 00   00 00 00 00  00 00 00 00
 ................
2600  E5 41 00 42  00 C7 00 44   00 45 00 0F  00 19 2E 00
 .A.B...D.E......
2610  54 00 58 00  54 00 00 00   FF FF 00 00  FF FF FF FF
 T.X.T...........
2620  E5 42 80 44  45 20 20 20   54 58 54 20  00 30 03 80
 .B.DE   TXT .0..
2630  BC 34 BC 34  00 00 04 80   BC 34 00 00  00 00 00 00
 .4.4.....4......
2640  41 41 00 42  00 C7 00 44   00 45 00 0F  00 19 2E 00
 AA.B...D.E......
2650  54 00 58 00  54 00 00 00   FF FF 00 00  FF FF FF FF
 T.X.T...........
2660  41 42 80 44  45 20 20 20   54 58 54 20  00 30 03 80
 AB.DE   TXT .0..
2670  BC 34 BC 34  00 00 04 80   BC 34 00 00  00 00 00 00
 .4.4.....4......
2680  00 00 00 00  00 00 00 00   00 00 00 00  00 00 00 00
 ................

I assume that the "80"s in between the "42"s and the "44"s are my
missing capital C cedillas (both codepages 437 and 850 list the capital
C cedilla as occupying point 80 hex).

In case it helps, I've left a truncated binary disk image of the
diskette here:
http://www.carbon.eclipse.co.uk/msdosfs.diskImage

Could anyone please tell me whether this is my error, or is it a bug
(possibly in mtools, possibly in the kernel)?

Many thanks,

Jaime :-)



_______________________________________________
mtools mailing list
address@hidden
http://www.tux.org/mailman/listinfo/mtools


+-----------------------------------------------------------+
| David C Niemi  (Reston, VA, USA)  niemi at tuxers dot net |
+-----------------------------------------------------------+
_______________________________________________
mtools mailing list
address@hidden
http://www.tux.org/mailman/listinfo/mtools

reply via email to

[Prev in Thread] Current Thread [Next in Thread]