fat16 en xcopy

Página 3/3
1 | 2 |

Por konamiman

Paragon (1157)

Imagen del konamiman

10-04-2006, 12:32

I doubt XCOPY and MultiMente use anything but standard DOS function calls

Why do you think that? I don't have any problem using copy (at least not yet), but my problems with xcopy and multi mente are 100% reproducable. This would indicate different mechanisms, wouldn't it?

First, because "invalid attributes" is an error code returned by DOS function calls. And second, because directly accessing the disk sectors and dealing with the FAT filesystem to manage files when DOS already handles all of this, would be really insane, and I doubt someone programs this way.

It would be interisting to see at which point of the execution of XCOPY the error arises. Anyone with an emulator with debugger and a lot of patience?

Por diederick76

Expert (114)

Imagen del diederick76

26-04-2006, 20:47

Well, it seems that xcopy is not the only standard tool that suffers the problem described.

# xdir spellen > spellen.txt

on my fat16 partition creates a file of exactly 147 lines, starting with:

Volume in drive B: is files      
X-Directory of B:\SPELLEN

\SPELLEN\PLATFORM
   \SPELLEN\PLATFORM\A

and ending with

*** Invalid attributes

on line 146. The last line is empty, the directory listing starts at line 4 and ends at line 143, therefore the number of files en directories listed before xdir fails is 140. An xdir on my fat12 partition shows me all 1054 files and directories on that partition without any problem.

Por arnold_m

Master (173)

Imagen del arnold_m

26-04-2006, 23:40

I doubt XCOPY and MultiMente use anything but standard DOS function calls

Why do you think that? I don't have any problem using copy (at least not yet), but my problems with xcopy and multi mente are 100% reproducable. This would indicate different mechanisms, wouldn't it?

First, because "invalid attributes" is an error code returned by DOS function calls. And second, because directly accessing the disk sectors and dealing with the FAT filesystem to manage files when DOS already handles all of this, would be really insane, and I doubt someone programs this way.
[...]

The FAT file system is overly complicated. I have made two programs that list all directories on a drive, one using direct access to sectors and one using high level bdos calls via the directory functions in libdos2. Both are written in C and the program using opendir, readdir, closedir takes about 70 to 80 percent more time than the program using direct sector access.
So it does make sense to use direct sector access to read directories, but doing so does mean more work to make the program FAT16 safe.

Por diederick76

Expert (114)

Imagen del diederick76

27-04-2006, 09:13

I have made two programs that list all directories on a drive, one using direct access to sectors and one using high level bdos calls via the directory functions in libdos2. Both are written in C and the program using opendir, readdir, closedir takes about 70 to 80 percent more time than the program using direct sector access. So it does make sense to use direct sector access to read directories, but doing so does mean more work to make the program FAT16 safe.

70 to 80 percent is a lot, agreed. But if I want to list all files on my partition that'll take time anyhow, and if I can trust the tool to work and not corrupt my data, that's more important to me than its speed.

Por konamiman

Paragon (1157)

Imagen del konamiman

27-04-2006, 09:37

and ending with

*** Invalid attributes

on line 146.
You get always the same error on the same line? If so, it could be a problem with sector or cluster number calculation, as it was the error I discovered. Do you know which one is the item that should appear when the error arises? (a file, a directory?)

Por arnold_m

Master (173)

Imagen del arnold_m

27-04-2006, 15:02

The FAT file system is overly complicated.
I actually wanted to write that that the FAT file system is not overly complicated. Maybe I shouldn't post so late at night. A preview for forum posts might have helped as well.

Por konamiman

Paragon (1157)

Imagen del konamiman

28-04-2006, 20:27

I have solved the "Invalid attributes" issue! Big smile

The problem is that the patched DOS code uses one single byte to store bits 16-23 of current sector number for the FIBs used to enumerate files. If two or more FIBs having different values for these bits are used at the same time, chaos is ensured. The solution is to store this extra byte on the FIB itslef, this is possible because there are unused bytes on FIB.

I'll write to Manuel Pazos, the Spain representative of Okei (well, sort of) so that she can develop a new version. In the mean time, there is a patched version 0.09 here:

http://www.konamiman.com/msx/FAT009B.COM

Por diederick76

Expert (114)

Imagen del diederick76

03-05-2006, 18:47

I have solved the "Invalid attributes" issue! Big smile

Thanks a bunch!

BTW could this also possibly solve the Multi Mente problems I described at the start of this thread? I am hesitant to try it out because everytime I had those problems the only way to solve it was to reformat the partition.

Por konamiman

Paragon (1157)

Imagen del konamiman

03-05-2006, 19:45

Can you mirror your data on an empty partition? Using XCOPY for this would be a good test. And if XCOPY succeeds, try Multimente on the mirror partition. Just an idea.

Por diederick76

Expert (114)

Imagen del diederick76

04-05-2006, 23:55

Well, I have the day of tomorrow and I found a spare harddrive lying around. I'll get back to you. xdir worked like a charm in any case.Big smile

Página 3/3
1 | 2 |