Jump to content

On Superfloppies and their Images


dencorso

Recommended Posts

Of course I have. Collisions are a big problem if you clone a drive and have both present. My next release of RFDISK has built in checking and repair options for Collisions.

Yes :), that is expected (collisions when cloning in some situations), I was talking of actual "by chance" collisions, more curiosity than anything else, the ID is 4 bytes, thus min 00000000 and max FFFFFFFF, i.e. 4,294,967,296 available values, but 4,294,967,296 to 1 against though pretty rare is not "nearly impossible", and since the ID/Volume serial is not "random" but is calculated, as seen on the little "reversing" spreadsheet I made:

chances are much bigger that that. :ph34r:

jaclaz

Link to comment
Share on other sites


Of course I have. Collisions are a big problem if you clone a drive and have both present. My next release of RFDISK has built in checking and repair options for Collisions.

Yes :), that is expected (collisions when cloning in some situations), I was talking of actual "by chance" collisions, more curiosity than anything else, the ID is 4 bytes, thus min 00000000 and max FFFFFFFF, i.e. 4,294,967,296 available values, but 4,294,967,296 to 1 against though pretty rare is not "nearly impossible", and since the ID/Volume serial is not "random" but is calculated, as seen on the little "reversing" spreadsheet I made:

chances are much bigger that that. :ph34r:

jaclaz

I have never noticed an accidental non-cloned collision. Since they are typically generated from the current date, a non-cloned collision can only occur in one of four ways.

1. Using a formatter that zeroes the ID or sets it to a specific value.

2. Using Partitions formatted with different algorithms. Rare unless #1 is true.

3. Sharing disks with someone else who formatted at the exact same time.

4. Formatting two partitions within a second of each other. This happened when I first added my anti-collision code to RFDISK. It updated multiple Partitions to the same ID..

Link to comment
Share on other sites

3. Sharing disks with someone else who formatted at the exact same time.

I was saying something slightly different, the Volume serial is a form of hash of actual date/time, i.e. the same serial can be generated on different date/times.

If we use some fantasy it is not difficult to increase dramatically probabilties of a collision.

Let's say that an employee in a Swiss watchmakers company :w00t: was told to format a floppy and save to it his morning work just before lunch (or let's assume that a batch including a format command was scheduled to run every day at EXACTLY 12:30 ;)).

Notwithstanding the high level of precision of the guy (or of the scheduler) while the actual job is started exactly at 12:30,00, the actual format command is executed with a delay variable between 0 and 99 hundreths of second.

Another employee of the same company is tasked every month to store the images of the floppies, and, in order to identify them uniquely, uses the volume serial.

What will happen on August 1st, 1992? (with data of July 1992) :unsure:

The probabilities field is a highly slippery one :ph34r: , but my guess is that probabilities of a collision in this scenario are very, very high, actually you have a very high probability of having at least one collision. :w00t:

See the attached spreadsheet.....

Happy F9ing ....

jaclaz

Volchances.zip

Link to comment
Share on other sites

  • 2 weeks later...

@jaclaz: I just found some minor mistakes in Known_floppies.xls: :ph34r:

The 320k formats use 1 (not 2) sectors per FAT-12, and the 360K uses 2 (not 3) sectors per FAT-12.

All FAT-12 formats above 180k and below 1.2 M use 2 sectors per cluster.

The Table below is quoted from Thom Hogan's "The Programmer's PC Sourcebook", 1st. ed., Microsoft Press, 1988 (ISBN 1-55615-118-7) Section 2, p. 61.

post-134642-0-62710800-1327471078_thumb.

Link to comment
Share on other sites

@jaclaz: I just found some minor mistakes in Known_floppies.xls: :ph34r:

That's good, can you post a copy if the spreadsheet with the corrections (manually typing the correction replacing the formula and making the cell, say, RED background?

The 320k formats use 1 (not 2) sectors per FAT-12, and the 360K uses 2 (not 3) sectors per FAT-12.

I'll check . (and see what I can do with the formula)

All FAT-12 formats above 180k and below 1.2 M use 2 sectors per cluster.

Hmmm. :unsure:

jaclaz

Link to comment
Share on other sites

Here's an interesting read: All Those Floppy Disk Formats… by Tim Paterson himself. And it's on-topic too, because it confirms 10 sectors per track is the absolute maximum for Double-Density floppies. There is a controverse point in it, however, because there Tim says that the 9-sector formats were already present in PC-DOS 1.1, which not only contradicts Undocumented DOS (as pointed out in the last comment there by os2museum) and the table by Thom Hogan I posted above, but is, in fact, a mistake, verifiable by simply running PC-DOS 1.1 format, which can only format 160 k and 320 k floppies. The 9-sector formats really were introduced with PC-DOS 2.0, and not before, although I do believe Tim's statement that they knew it was viable perhaps since PC-DOS 1.0 times.

Link to comment
Share on other sites

I have created two new formats using 1KB Sectors. A 10 Sector per Track (1.6MB) Bootable HD Floppy and an 11 Sector per Track (1.76MB) Non-Bootable HD Floppy.

A mixed format could hold 1.759MB and be Bootable. A 1.92MB Floppy using three 4KB Sectors per Track can be created, but is very unreliable.

Link to comment
Share on other sites

Find attached a revised version of KFF spreadsheet.

I corrected the issue by "forcing" anything in the 639<n<2399 sectors size to have 2 sectors per clusters.

This leaves open a possible mistake (still to be verified) about media type 250, but I don't think it is a "real issue".

I re-added the image making part <- please do test it. and report.

The spreadsheet still misses some features, like the 2K/XP vs. DOS reserved sectors emulation for biggish images and a few more, including some switch to more finely choose label, and label type (BS, BS+FS, FS only and 08 vs. 28 type) and possibly a few more bits, but it should be basically working.

I am removing anyway the previous attachment in post #111

For NO apparent reason :w00t: attached is also a small batch to view bootsector contents and make BPB data "human redable".

Clever :unsure: parts:

  1. it uses built-in FC.EXE to do the binary reading, no need for external tools ;)
  2. the output (left part - hex text) can be copied and pasted directly in Tiny Hexer or similar
  3. all variables are defined in the batch as seen on screen (useful for derivative work) and the FULL variable contains the hex text
  4. very handy to quickly show contents of a FAT1x bootsector

Limits:

  1. only XP and later
  2. NOT (yet) duly tested with "strange" characters in text fields like OEM_String, Volume_Label or System_ID
  3. Experimental (release 0.01 ALPHA)

Have fun. :)

jaclaz

Attachment view_bs_001.zip removed, see below.

Known_floppies2.zip

Edited by jaclaz
Link to comment
Share on other sites

Great! :yes: Thanks! :thumbup

Bug report:


N:\>view_bs N:\noname.bs => works as expected.
N:\>view_bs n:\noname.bs => works as expected.
N:\>view_bs .\noname.bs => works as expected.
N:\>view_bs \noname.bs => works as expected.
But...
N:\>view_bs noname.bs => gives instead:
noname.bs
File "N:\noname.bs" does not exist or is not 512 bytes in size !

Press any key to continue . . .
You need to supply a target bootsector to view!

view_bs.cmd - small batch file to view BPB data of bootsectors
by jaclaz - version 0.01 ALPHA

Usage:
view_bs.cmd <FAT1x bootsector file>

Examples:
view_bs.cmd test_01.bs
view_bs.cmd C:\BS_tests\test_01.bs
view_bs.cmd "C:\A stoopidly long path containing spaces\a stoopid file name.bs"

Target bootsector file MUST be 512 bytes in size.
Press any key to continue . . .

N:\>

noname.bs is a bootsector, and is exactly 512 bytes long.

N: is a 768 MiB gavotte ramdisk

OS: Win XP SP3

Now, just in case:

C:\>view_bs noname.bs
noname.bs
File "C:\noname.bs" does not exist or is not 512 bytes in size !

Press any key to continue . . .
<etc.>

Link to comment
Share on other sites

Strange. :w00t:

It works here. :yes:

I tried in both a FAT32 and a NTFS volume (in case the issue is due to the fact that the file is stored directly in the $MFT) but it still does work.

Try replacing:

IF NOT EXIST %1 GOTO :ERROR1

FOR /F "tokens=3" %%A IN ('DIR "%~1"^|FIND /I "%~1"') DO IF NOT %%A==512 GOTO :ERROR1

with:

IF NOT EXIST "%~dpnx1" GOTO :ERROR1

FOR /F "tokens=3" %%A IN ('DIR "%~nx1"^|FIND /I "%~nx1"') DO IF NOT %%A==512 GOTO :ERROR1

but it shouldn't make any difference :unsure:.

Create an :ERROR2 at the end

:Error2

ECHO 2 File "%~dpnx1" does not exist or is not 512 bytes in size 2^^!

ECHO.

PAUSE

GOTO :Usage

and change one of the the two lines to point to :ERROR2 instead of :ERROR1, let's see which one creates the exception.

Post the output of:

DIR noname.bs

Try replacing:

FOR /F "tokens=3" %%A IN ('DIR "%~nx1"^|FIND /I "%~nx1"') DO IF NOT %%A==512 GOTO :ERROR1

with:

IF NOT "%~z1."=="512." GOTO :ERROR1

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

Strange. :w00t:

It works here. :yes:

I tried in both a FAT32 and a NTFS volume (in case the issue is due to the fact that the file is stored directly in the $MFT) but it still does work.

Try replacing:

IF NOT EXIST %1 GOTO :ERROR1

FOR /F "tokens=3" %%A IN ('DIR "%~1"^|FIND /I "%~1"') DO IF NOT %%A==512 GOTO :ERROR1

with:

IF NOT EXIST "%~dpnx1" GOTO :ERROR1

FOR /F "tokens=3" %%A IN ('DIR "%~nx1"^|FIND /I "%~nx1"') DO IF NOT %%A==512 GOTO :ERROR1

but it shouldn't make any difference :unsure:.

Yet it does:

N:\>nview_bs n:\noname.bs
n:\noname.bs
File "n:\noname.bs" does not exist or is not 512 bytes in size !

Press any key to continue . . .
Terminate batch job (Y/N)? y

N:\>nview_bs N:\noname.bs
N:\noname.bs
File "N:\noname.bs" does not exist or is not 512 bytes in size !

Press any key to continue . . .
Terminate batch job (Y/N)? y

N:\>nview_bs .\noname.bs
.\noname.bs
File "N:\noname.bs" does not exist or is not 512 bytes in size !

Press any key to continue . . .
Terminate batch job (Y/N)? y

N:\>nview_bs \noname.bs
\noname.bs
File "N:\noname.bs" does not exist or is not 512 bytes in size !

Press any key to continue . . .
Terminate batch job (Y/N)? y

N:\>nview_bs noname.bs
noname.bs
File "N:\noname.bs" does not exist or is not 512 bytes in size !

Press any key to continue . . .
Terminate batch job (Y/N)? y

Link to comment
Share on other sites

Now, using instead:

IF NOT EXIST %1 GOTO :ERROR1
FOR /F "tokens=3" %%A IN ('DIR "%~1"^|FIND /I "%~1"') DO IF NOT %%A==512 GOTO :ERROR2

I get:

N:\>eview_bs noname.bs
noname.bs
2 File "N:\noname.bs" does not exist or is not 512 bytes in size 2!

Press any key to continue . . .
Terminate batch job (Y/N)? y

All the other forms work, obviously, since they already did before...

N:\>DIR noname.bs
Volume in drive N is RamDisk
Volume Serial Number is 1234-5678

Directory of N:\

28/01/2012 04:49 PM 512 noname.bs
1 File(s) 512 bytes
0 Dir(s) 804,265,984 bytes free

Link to comment
Share on other sites

Try replacing:
FOR /F "tokens=3" %%A IN ('DIR "%~nx1"^|FIND /I "%~nx1"') DO IF NOT %%A==512 GOTO :ERROR1

with:

IF NOT "%~z1."=="512." GOTO :ERROR1

:D

N:\>oview_bs noname.bs
noname.bs
EB 27 90 03 01 14 00 00 00 00 00 00 02 02 01 00 Jump_Bytes: EB2790
02 70 00 80 02 FF 01 00 08 00 02 00 00 00 00 00 OEM_String: "........"
00 00 00 00 00 00 00 CD 19 FA 8C C8 8E D8 33 D2 Bytes_per_Sector: 512
8E D2 BC 00 7C FB B8 60 00 8E D8 8E C0 33 D2 8B Sectors_per_Cluster: 2
C2 CD 13 72 69 E8 85 00 72 DD 2E 83 3E 03 7C 08 Reserved_Sectors: 1
74 06 2E C6 06 64 7D 02 BB 00 00 2E 8B 0E 03 7C Number_of_FATs: 2
51 B0 09 2A C1 B4 00 8B F0 56 33 D2 33 C0 8A C5 Max_Root_Entries: 112
2E F6 36 64 7D 8A E8 8A F4 8B C6 B4 02 CD 13 72 Small_Type_Sectors: 640
2D 5E 59 2E 29 36 05 7C 74 1F 8B C6 2E F7 26 65 Media_Type: 255
7D 03 D8 FE C5 B1 01 51 BE 08 00 2E 3B 36 05 7C Sectors_per_Fat: 1
7C 05 2E 8B 36 05 7C EB C0 EA 00 00 60 00 BE 67 Sectors_per_Head: 8
7D E8 02 00 EB FE 32 FF 2E AC 24 7F 74 0B 56 B4 Sectors_Before: 0
0E BB 07 00 CD 10 5E EB EF C3 E9 33 FF BB 00 00 Large_Sectors: 0
B9 04 00 B8 01 02 CD 13 1E 72 33 8C C8 8E D8 BF Disk_Number: 0
00 00 B9 0B 00 26 80 0D 20 26 80 4D 20 20 47 E2 Current_head: 0
F4 BF 00 00 BE 8B 7D B9 0B 00 FC F3 A6 75 0F BF NT_Signature: 0
20 00 BE 97 7D B9 0B 00 F3 A6 75 02 1F C3 BE 1B Volume_Serial: CD19FA8C
7D E8 A2 FF B4 00 CD 16 1F F9 C3 0D 0A 4E 6F 6E Volume_Label: "3.|"
2D 53 79 73 74 65 6D 20 64 69 73 6B 20 6F 72 20 System_ID: "`.3"
64 69 73 6B 20 65 72 72 6F 72 0D 0A 52 65 70 6C Magic_bytes: 55AA
61 63 65 20 61 6E 64 20 73 74 72 69 6B 65 20 61
6E 79 20 6B 65 79 20 77 68 65 6E 20 72 65 61 64
79 0D 0A 00 01 00 02 0D 0A 44 69 73 6B 20 42 6F
6F 74 20 66 61 69 6C 75 72 65 0D 0A 00 4D 69 63
72 6F 73 6F 66 74 2C 49 6E 63 20 69 62 6D 62 69
6F 20 20 63 6F 6D 30 69 62 6D 64 6F 73 20 20 63
6F 6D 30 05 C6 06 77 2F FF 83 7E FC 00 75 0B 80
7E F7 3B 75 05 C6 06 76 2F FF 89 EC 5D CA 04 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA

All other forms also work, of course (but I tested them, all the same).

Here's noname.bs, just in case:

noname.7z

Link to comment
Share on other sites

All the other forms work, obviously, since they already did before...

N:\>DIR noname.bs
Volume in drive N is RamDisk
Volume Serial Number is 1234-5678

Directory of N:\

28/01/2012 04:49 PM 512 noname.bs
1 File(s) 512 bytes
0 Dir(s) 804,265,984 bytes free

Here it is :unsure::

28/01/2012 04:49 PM 512 noname.bs

With your settings size is 4th token (and not 3rd which happens when you have 24h time set).

But then why the other forms of filename work baffles me.

Attached version 002 with the %~z1 approach, please re-test, so that I can remove version 001.

jaclaz

Attachment removed, see below.

Edited by jaclaz
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...