News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Ast

X-Mass Application

Started by Ast, 15:18, 04 March 16

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ast

#100
Ok,I agree of what you wrote but why don't simply use some unused bytes into the boot ? I was thinking about fake serial number written in the Boot.... for example...
My philosophy : It will be easy and faster to find the last sector written (and store here) instead of searching on the whole fat the most bigger sector.

All you have to do is :

On each file written, you'll just have to write the last sector used and store it onto the boot (sector 0) in the fake serial number.
I don't know if i'm definitively clear...
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

pelrun

And what happens when someone writes to the drive using another tool that doesn't update your magic value? You just overwrite the sector and corrupt the drive?

Ast

#102
Right !
That's why we discuss about making Something compatible and usable by all.

Edit : That's why i've decided to open "the solution" i used and discuss with other people to see how they do.
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Fessor

#103
Why not storing it in the Place where a/the Bootloader would reside at the Bootsector?

*edit*
But, how will this value be helpful when the drive gets more and more fragmentated over the time?
*/edit*

andycadley

It's a bit late in the day to try and persuade everyone of a new requirement for FAT drives. And then you have the problem that the last written block may not be immediately followed by a free block, so you're just going to end up moving the scan to the end of each block write, rather than the beginning....

Singaja

#105
The incorrect bootloader could mess up with other operating systems so I think it's not the best approach.
My idea is following use the volume serial , and the most safe 5-th byte of OEM as checksum mod 255 (or any other approach squeezing the checksum to 1byte). The chances of fake-positive clash from other systems not using this approach would be very very low.

Prodatron

Quote from: pelrun on 20:22, 20 March 16
And what happens when someone writes to the drive using another tool that doesn't update your magic value? You just overwrite the sector and corrupt the drive?

Pelrun and Andycadley are right. IMHO such a hack doesn't make much sense. At least in SymbOS I am not allowed to do such a trick at all, as it runs on systems which removeable IDE devices, and which are also handled by the native OSes of the machines (MSX-DOS, EXOS). If SymbOS would use such an optimizations, people would destroy their filesystems/storages. The same for the CPC and the SYMBiFACE II: You usually swap CF-cards/harddiscs with a PC for transfering data, and in this case it would be corrupted, too.
It would be an X-MASS-only solution, but why should you limit your new IDE-DOS in this way?

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Ast

Quote from: Prodatron on 20:51, 20 March 16
It would be an X-MASS-only solution, but why should you limit your new IDE-DOS in this way?
But, for information, iMPdos was first developped for the x-Mass :)
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

pelrun

#108
Quote from: Ast on 20:29, 20 March 16That's why we discuss about making Something compatible and usable by all.
No, there will always be someone who uses a tool that doesn't follow your "standard". Or they connect the DOM to their PC to access it.

Since you can't force everyone to update their FAT support, and you can't force your users to only use the tools you cooperate with, the only correct way to handle this is to do it the way the FAT standard tells you to. Any "shortcut" you try to implement will be *wrong*. You may as well make your own format and renounce any sort of FAT compatibility.

Ast

#109
ah! That's better like that.
I don't want to force anyone to use a system instead of his own.

_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Singaja

#110
Correct me if I'm wrong but if there was a way to identify whether Ast's optimisation is used or not wouldn't it be good enough? If a drive is not using it, a search would be made to find the value and it would get stored then. Maybe I'm missing something

Prodatron

Quote from: Singaja on 21:07, 20 March 16
Correct me if I'm wrong but if there was away to identify whether Ast's optimisation is used or not wouldn't it be good enough? If a drive is not using it, a search would be made to find the value and it would get stored then. Maybe I'm missing something
Standard FAT-implementations don't know about Asts modification, and there is no fast way for iMPdos to find out, if a drive was modified by a system with standard FAT-implementation.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Singaja

Quote from: Prodatron on 21:17, 20 March 16
Standard FAT-implementations don't know about Asts modification, and there is no fast way for iMPdos to find out, if a drive was modified by a system with standard FAT-implementation.
Quote from: Singaja on 20:41, 20 March 16My idea is following use the volume serial , and the most safe 5-th byte of OEM as checksum mod 255 (or any other approach squeezing the checksum to 1byte). The chances of fake-positive clash from other systems not using this approach would be very very low.

I just proposed a relatively fast way few posts back^.

Prodatron

Quote from: Singaja on 21:21, 20 March 16

I just proposed a relatively fast way few posts back^.

Maybe I don't get you, but another FAT implementation wouldn't change the volume serial/OEM. So how should you recognize any changes on the filesystem?

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Singaja

Quote from: Prodatron on 21:29, 20 March 16
Maybe I don't get you, but another FAT implementation wouldn't change the volume serial/OEM. So how should you recognize any changes on the filesystem?
Let's consider the case of Dos/Windows formatted FAT16. It will have some arbitrary 4byte volume serial number and OEM of something like "DOS  5.0" "WIN  4.0" (I did this cover the other OEMs in detail in my previous post for reference). Now the drive gets connected and it's X-mass like device running on CPC.
Ast's Impdos reads the 4byte volume serial and computes a checksum. I did suggest using a 1 byte checksum (it's not a necessary condition though a bigger checksum would be even better), because that would be least invasive for DOS3.x from various vendors (also covered in my OEM post).
Now the computed checksum is checked against the place against where the stored checksum is expected. If they are not equal (and for the above case they should not be equal but it's important to minimise the chance of false positive clash) then voila it's not a "pimped by Ast" Fat16 so time for searching. When done the value is found it should get stored, the checksum computed and stored too. The opposite case is pretty straightforward, the volume serial vs the checksum matches so it's safe to use the volume serial storing Ast's special value.

Ast

That's exactly this way... This debate is very exciting.
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

pelrun

Step 1. Use the drive with iMPdos so that it sets this custom value.
Step 2. Write to the drive with something else that doesn't update the value and *doesn't* automatically overwrite the volume label.
Step 3. Write to the drive with iMPdos. iMPdos reads the label, sees the checksum is intact, reads the custom value, then overwrites the wrong sector with new data. BAM, you've corrupted it.


The *only* way to ensure you don't hit a corruption path is to ensure it's only ever written to by iMPdos. At that point, there's no reason to pretend to be FAT compatible, you're effectively doing your own thing anyway.

Prodatron

Quote from: pelrun on 22:09, 20 March 16Step 2. Write to the drive with something else that doesn't update the value and *doesn't* automatically overwrite the volume label.
...which is usual for all FAT-implementations. So this is the standard case.

Quote from: pelrun on 22:09, 20 March 16Step 3. Write to the drive with iMPdos. iMPdos reads the label, sees the checksum is intact, reads the custom value, then overwrites the wrong sector with new data. BAM, you've corrupted it.
And because of this such hacks won't work, when using multiple FAT-implementations for the same storage.

Did you already test, how long it takes to find the first free cluster on a 128MB DOM which is nearly full, when starting from the beginning?
As I said before, you only need to do it once after booting, so even if it takes some seconds it's not an issue IMHO.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Singaja

#118
Quote from: pelrun on 22:09, 20 March 16
Step 1. Use the drive with iMPdos so that it sets this custom value.
Step 2. Write to the drive with something else that doesn't update the value and *doesn't* automatically overwrite the volume label.
Step 3. Write to the drive with iMPdos. iMPdos reads the label, sees the checksum is intact, reads the custom value, then overwrites the wrong sector with new data. BAM, you've corrupted it.


The *only* way to ensure you don't hit a corruption path is to ensure it's only ever written to by iMPdos. At that point, there's no reason to pretend to be FAT compatible, you're effectively doing your own thing anyway.
Ok, I must admit this is a problem. I'm reading about Last Access Time and/or Write Access Time of Directory Entry Structure (having the root directory in mind). Perhaps it could be useful but I'll need my mind fresh to evaluate it. More to come I hope  :P

Audronic

@Ast
Please make Impdos fully compatible with FAT 16.

Quote from Prodatron
""Did you already test, how long it takes to find the first free cluster on a 128MB DOM which is nearly full, when starting from the beginning?As I said before, you only need to do it once after booting, so even if it takes some seconds it's not an issue IMHO.""

Please keep up the good work.Ray
Procrastinators Unite,
If it Ain't Broke PLEASE Don't Fix it.
I keep telling you I am Not Pedantic.
As I Live " Down Under " I Take my Gravity Tablets and Wear my Magnetic Boots to Keep me from Falling off.

Prodatron

Quote from: Singaja on 22:59, 20 March 16I'm reading about Last Access Time and/or Write Access Time of Directory Entry Structure (having the root directory in mind).
I think there is no rule to update timestamps of parent directories, if you write into sub directories. So this shouldn't work as well.

Quote from: Audronic on 23:06, 20 March 16
@Ast
Please make Impdos fully compatible with FAT 16.
I agree! :)

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Ast

Here is a new video showing iMPdos in action... It's good and Fast ! Mmmmm !



Do you agree ?
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

||C|-|E||

It is really awesome!

Ast

A new video, just to show you how you can copy all files from drive a/b to x-Mass.
Usage :
ùcopy,"* -> copy all files



Life is so beautifull!
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Ast

As you probably know, you can't write many and many files on your x-Mass.
Fat 16 has his limit. Root can allow up to 512 files and Directory up to 64 files per directory, of course.
It's what's i did this afternoon. Result ? It works very well.

_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Powered by SMFPacks Menu Editor Mod