jaclaz Posted January 14, 2012 Share Posted January 14, 2012 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. jaclaz Link to comment Share on other sites More sharing options...
rloew Posted January 14, 2012 Share Posted January 14, 2012 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. jaclazI 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 More sharing options...
jaclaz Posted January 15, 2012 Share Posted January 15, 2012 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 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) The probabilities field is a highly slippery one , 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. See the attached spreadsheet.....Happy F9ing ....jaclazVolchances.zip Link to comment Share on other sites More sharing options...
dencorso Posted January 24, 2012 Author Share Posted January 24, 2012 @jaclaz: I just found some minor mistakes in Known_floppies.xls: 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. Link to comment Share on other sites More sharing options...
jaclaz Posted January 25, 2012 Share Posted January 25, 2012 @jaclaz: I just found some minor mistakes in Known_floppies.xls: 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. jaclaz Link to comment Share on other sites More sharing options...
dencorso Posted January 27, 2012 Author Share Posted January 27, 2012 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 More sharing options...
rloew Posted January 27, 2012 Share Posted January 27, 2012 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 More sharing options...
jaclaz Posted January 27, 2012 Share Posted January 27, 2012 (edited) 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 #111For NO apparent reason attached is also a small batch to view bootsector contents and make BPB data "human redable".Clever parts:it uses built-in FC.EXE to do the binary reading, no need for external tools the output (left part - hex text) can be copied and pasted directly in Tiny Hexer or similarall variables are defined in the batch as seen on screen (useful for derivative work) and the FULL variable contains the hex textvery handy to quickly show contents of a FAT1x bootsectorLimits:only XP and laterNOT (yet) duly tested with "strange" characters in text fields like OEM_String, Volume_Label or System_IDExperimental (release 0.01 ALPHA)Have fun. jaclazAttachment view_bs_001.zip removed, see below.Known_floppies2.zip Edited January 29, 2012 by jaclaz Link to comment Share on other sites More sharing options...
dencorso Posted January 28, 2012 Author Share Posted January 28, 2012 Great! Thanks! 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.bsFile "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 bootsectorsby jaclaz - version 0.01 ALPHAUsage:view_bs.cmd <FAT1x bootsector file>Examples:view_bs.cmd test_01.bsview_bs.cmd C:\BS_tests\test_01.bsview_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 ramdiskOS: Win XP SP3Now, just in case:C:\>view_bs noname.bsnoname.bsFile "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 More sharing options...
jaclaz Posted January 28, 2012 Share Posted January 28, 2012 (edited) Strange. It works here. 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 :ERROR1FOR /F "tokens=3" %%A IN ('DIR "%~1"^|FIND /I "%~1"') DO IF NOT %%A==512 GOTO :ERROR1with:IF NOT EXIST "%~dpnx1" GOTO :ERROR1FOR /F "tokens=3" %%A IN ('DIR "%~nx1"^|FIND /I "%~nx1"') DO IF NOT %%A==512 GOTO :ERROR1but it shouldn't make any difference .Create an :ERROR2 at the end:Error2ECHO 2 File "%~dpnx1" does not exist or is not 512 bytes in size 2^^!ECHO.PAUSEGOTO :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.bsTry replacing:FOR /F "tokens=3" %%A IN ('DIR "%~nx1"^|FIND /I "%~nx1"') DO IF NOT %%A==512 GOTO :ERROR1with:IF NOT "%~z1."=="512." GOTO :ERROR1jaclaz Edited January 28, 2012 by jaclaz Link to comment Share on other sites More sharing options...
dencorso Posted January 28, 2012 Author Share Posted January 28, 2012 Strange. It works here. 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 :ERROR1FOR /F "tokens=3" %%A IN ('DIR "%~1"^|FIND /I "%~1"') DO IF NOT %%A==512 GOTO :ERROR1with:IF NOT EXIST "%~dpnx1" GOTO :ERROR1FOR /F "tokens=3" %%A IN ('DIR "%~nx1"^|FIND /I "%~nx1"') DO IF NOT %%A==512 GOTO :ERROR1but it shouldn't make any difference .Yet it does:N:\>nview_bs n:\noname.bsn:\noname.bsFile "n:\noname.bs" does not exist or is not 512 bytes in size !Press any key to continue . . .Terminate batch job (Y/N)? yN:\>nview_bs N:\noname.bsN:\noname.bsFile "N:\noname.bs" does not exist or is not 512 bytes in size !Press any key to continue . . .Terminate batch job (Y/N)? yN:\>nview_bs .\noname.bs.\noname.bsFile "N:\noname.bs" does not exist or is not 512 bytes in size !Press any key to continue . . .Terminate batch job (Y/N)? yN:\>nview_bs \noname.bs\noname.bsFile "N:\noname.bs" does not exist or is not 512 bytes in size !Press any key to continue . . .Terminate batch job (Y/N)? yN:\>nview_bs noname.bsnoname.bsFile "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 More sharing options...
dencorso Posted January 28, 2012 Author Share Posted January 28, 2012 Now, using instead:IF NOT EXIST %1 GOTO :ERROR1FOR /F "tokens=3" %%A IN ('DIR "%~1"^|FIND /I "%~1"') DO IF NOT %%A==512 GOTO :ERROR2I get:N:\>eview_bs noname.bsnoname.bs2 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)? yAll 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 More sharing options...
dencorso Posted January 28, 2012 Author Share Posted January 28, 2012 Try replacing:FOR /F "tokens=3" %%A IN ('DIR "%~nx1"^|FIND /I "%~nx1"') DO IF NOT %%A==512 GOTO :ERROR1with:IF NOT "%~z1."=="512." GOTO :ERROR1N:\>oview_bs noname.bsnoname.bsEB 27 90 03 01 14 00 00 00 00 00 00 02 02 01 00 Jump_Bytes: EB279002 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: 5128E D2 BC 00 7C FB B8 60 00 8E D8 8E C0 33 D2 8B Sectors_per_Cluster: 2C2 CD 13 72 69 E8 85 00 72 DD 2E 83 3E 03 7C 08 Reserved_Sectors: 174 06 2E C6 06 64 7D 02 BB 00 00 2E 8B 0E 03 7C Number_of_FATs: 251 B0 09 2A C1 B4 00 8B F0 56 33 D2 33 C0 8A C5 Max_Root_Entries: 1122E F6 36 64 7D 8A E8 8A F4 8B C6 B4 02 CD 13 72 Small_Type_Sectors: 6402D 5E 59 2E 29 36 05 7C 74 1F 8B C6 2E F7 26 65 Media_Type: 2557D 03 D8 FE C5 B1 01 51 BE 08 00 2E 3B 36 05 7C Sectors_per_Fat: 17C 05 2E 8B 36 05 7C EB C0 EA 00 00 60 00 BE 67 Sectors_per_Head: 87D E8 02 00 EB FE 32 FF 2E AC 24 7F 74 0B 56 B4 Sectors_Before: 00E BB 07 00 CD 10 5E EB EF C3 E9 33 FF BB 00 00 Large_Sectors: 0B9 04 00 B8 01 02 CD 13 1E 72 33 8C C8 8E D8 BF Disk_Number: 000 00 B9 0B 00 26 80 0D 20 26 80 4D 20 20 47 E2 Current_head: 0F4 BF 00 00 BE 8B 7D B9 0B 00 FC F3 A6 75 0F BF NT_Signature: 020 00 BE 97 7D B9 0B 00 F3 A6 75 02 1F C3 BE 1B Volume_Serial: CD19FA8C7D 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: 55AA61 63 65 20 61 6E 64 20 73 74 72 69 6B 65 20 616E 79 20 6B 65 79 20 77 68 65 6E 20 72 65 61 6479 0D 0A 00 01 00 02 0D 0A 44 69 73 6B 20 42 6F6F 74 20 66 61 69 6C 75 72 65 0D 0A 00 4D 69 6372 6F 73 6F 66 74 2C 49 6E 63 20 69 62 6D 62 696F 20 20 63 6F 6D 30 69 62 6D 64 6F 73 20 20 636F 6D 30 05 C6 06 77 2F FF 83 7E FC 00 75 0B 807E F7 3B 75 05 C6 06 76 2F FF 89 EC 5D CA 04 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AAAll 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 More sharing options...
jaclaz Posted January 28, 2012 Share Posted January 28, 2012 (edited) 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 freeHere it is :28/01/2012 04:49 PM 512 noname.bsWith 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.jaclazAttachment removed, see below. Edited January 29, 2012 by jaclaz Link to comment Share on other sites More sharing options...
dencorso Posted January 29, 2012 Author Share Posted January 29, 2012 Yes. The new version works beautifully! You may remove the previous one. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now