Jump to content











Photo
- - - - -

Strange behaviour in IMDISK with Floppy


  • Please log in to reply
11 replies to this topic

#1 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 13 February 2010 - 12:22 PM

There is something "fishy" in the behaviour of IMDISK with floppy images.

See here:
http://www.msfn.org/...howtopic=141833

A 1.44 (1474560) floppy cannot be extended to 2.88 2949120 ?
As well, a 2.88 (2949120) Floppy image cannot be formatted?

:cheers:

Wonko

#2 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 13 February 2010 - 12:38 PM

There is something "fishy" in the behaviour of IMDISK with floppy images.

See here:
http://www.msfn.org/...howtopic=141833

A 1.44 (1474560) floppy cannot be extended to 2.88 2949120 ?
As well, a 2.88 (2949120) Floppy image cannot be formatted?


That is unfortunately correct. Windows XP and later seem to be unable to format other floppy sizes than 1.44 MB. The help texts when typing format /? reflects this as well.

One solution is to keep a blank 2.88 MB image somewhere and raw copy that to the disk you want to format. Blank 2.88 MB images can be formatted in Linux, FreeBSD etc or if they need to get a Windows boot record earlier versions of Windows, for example Windows 2000, can be used.

Extending existing disks only works with NTFS. With FATxx filesystems the disk size is extended but the filesystem on it is left with the old size.

#3 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 13 February 2010 - 01:11 PM

One solution is to keep a blank 2.88 MB image somewhere and raw copy that to the disk you want to format. Blank 2.88 MB images can be formatted in Linux, FreeBSD etc or if they need to get a Windows boot record earlier versions of Windows, for example Windows 2000, can be used.

Yep ;) , or using mkbt/bfi as suggested in the referenced thread. :cheers:

I'll have a look around if I can find some other easier workaround. :cheers:

:cheers:

Wonko

P.S.:
Since the source code for Format144 is available:
http://www.denispetrov.com/?page_id=3
wouldn't it be an idea to "extend" it to other formats and "add" it to IMDISK?

#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 13 February 2010 - 01:20 PM

Small Update:
I now understand why I never noticed this behaviour before, as in many other things, 2K :cheers: is better than XP ;) :cheers: !:
http://chitchat.at.i...vmware/vfd.html


FAQ & known issues (including unconfirmed)
.....
Windows NT/2000 FORMAT.EXE can format the following media:
160K, 180K, 320K, 360K, 640K, 720K, 1.2M, 1.44M, 2.88M
Windows NT/2000 Explorer can format the following media:
360K, 640K, 720K, 1.2M, 1.44M, 2.88M
Windows XP FORMAT.EXE and Explorer can format 1.44M media only.
Use VFD.EXE or VFDWIN.EXE to format media with size not listed above.


Wonko

#5 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 13 February 2010 - 03:55 PM

I don't know a XP file format.exe.

Windows XP format.com format a ImDisk a 720kb, 1.44MB and 2.88MB floppy.

Explorer does format a 1.44M media, but not a 720kb and not a 2.88MB floppy.

#6 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 13 February 2010 - 04:07 PM

Windows XP format.com format a ImDisk a 720kb, 1.44MB and 2.88MB floppy.


I just tested that and was somewhat surprised that you are right. The help text with format /? states that it only formats 1.44 MB though and I am (pretty) sure I have tested this with no success before. Notes from other virtual disk driver forums and CD imaging tools also seem to mention that Windows XP format command does not format 2.88 MB floppies. I wonder if everyone just read the help texts or if it has actually changed with any Service Pack or so.

#7 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 13 February 2010 - 04:24 PM

@cdob
Confirmed :cheers: , it's just the GUI format that doesn't work.

On a newly created IMDISK sized 2949120 mounted as J: Type "Floppy"
FORMAT J: /FS:FAT
works allright, but you cannot make an MS-DOS bootable format with it.

@Olof
JFYI, here is a possibly interesting behaviour of Format.com:
http://www.winimage.....php?f=3&t=3117

;)

Wonko

#8 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 13 February 2010 - 06:44 PM

@Olof there is however something "wrong" in IMDISK.
Follow me:
Mount New
1474560
Floppy
Letter B:

In GUI:
B: Virtual Memory 1,440Kb Read/write, Removable N/A
Save Image
Error: The contents of drive B: could not be saved. Check that the drive contains a supported filesystem (OK, fair enough)
Extend
1474560
Error: File extended but not the filesystem, etc (OK, there is NO filesystem as the drive is NOT formatted)
In GUI:
B: Virtual Memory 2,880Kb Read/write, Removable N/A
Save Image
Message: Succesfully saved the contents of drive B: to image file C:\bootfiles\288_1.img

Succesfully my sock! : B)
The saved image is 2,048 Kb (2,097,152 bytes)! ;)

Another test:
Mount New
2949120
Floppy
Letter B:
In GUI:
B: Virtual Memory 2,880Kb Read/write, Removable N/A
Save Image
Message: Succesfully saved the contents of drive B: to image file C:\bootfiles\288_2.img
The saved image is 2,048 Kb (2,097,152 bytes)! :cheers:

Roadkil's Disk Image:
Read Drive B: write to C:\bootfiles\288_3.img
Progress bar at 100,02% :cheers:
Saved image is 2,880 Kb (2,949,120 bytes) :cheers:

DSFO:
C:\bootfiles>dsfo \\.\B: 0 0 C:\bootfiles\288_3.img
OK, 2949120 bytes, 0.016s, MD5 = b2fd0a7671356c6e573214ddd312f17c
Saved image is 2,880 Kb (2,949,120 bytes) :cheers:

In GUI:
B: Virtual Memory 1,440Kb Read/write, Removable N/A
Format
OK
Save Image (OK, saved image is 1474560 bytes)
Extend
1474560
Error: File extended but not the filesystem, etc (OK, it's FAT)
In GUI:
B: Virtual Memory 2,880Kb Read/write, Removable FAT

Save Image
Message: Succesfully saved the contents of drive B: to image file C:\bootfiles\288_4.img
OK ;), saved image is 1474560 bytes

Roadkil's Disk Image:
Read Drive B: write to C:\bootfiles\288_5.img
Progress bar at 48,90% :)
Saved image is 1,440 Kb (1,474,560 bytes) Fair Enough

DSFO:
C:\bootfiles>dsfo \\.\B: 0 0 C:\bootfiles\288_6.img
OK, 1474560 bytes, 0.015s, MD5 = 1bdf3fc2e1fd91e55951868021fa6e00
Saved image is 1,440 Kb (1,474,560 bytes) Fair Enough

Roadkil's bootbuild:
Run it:
File->Read from Disk Select Disk B:
Sectors per cluster 1 2
Sectors per track 18 36
Total sectors 2880 5760
Max root entries 224 240
File->Write to disk Select Disk B:

In GUI (still):
B: Virtual Memory 2,880Kb Read/write, Removable FAT
Save Image
Message: Succesfully saved the contents of drive B: to image file C:\bootfiles\288_2.img
Saved image is 2,880 Kb (2,949,120 bytes) :rofl:

IMHO there should be an error instead of saving an arbitrary sized 2048 Kb OR (and I would personally prefer it) an option to save the size of the image as shown in the GUI instead of that coming from reading the bootsector.

:rofl:

Wonko

#9 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 13 February 2010 - 11:20 PM

IMHO there should be an error instead of saving an arbitrary sized 2048 Kb OR (and I would personally prefer it) an option to save the size of the image as shown in the GUI instead of that coming from reading the bootsector.


I agree. The only question is how to fix that. Saving disk contents to an image file is done through the filesystem driver. The filesystem driver does not necessarily use the whole disk (like you have seen here) and there is probably no way to ask the filesystem driver to save more of the disk than it is using... ;)

I have to think about a solution for this. But the result might be that it cannot be done from a user mode application so that a kernel mode driver would be needed.

#10 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 14 February 2010 - 11:24 AM

Well, if I may, the point is two-fold:
  • correct the "false" behaviour of the Save Image... i.e. giving NOT the "false" message saved succesfully
  • add a further msgbox with something like "The current size of the RAW image does not match the size it was created, the image was extended: Do you want to append additional xxx blank sectors as to have the saved image xxxx in size?"

Regarding #1 I am curious to understand WHY/HOW the image is actually saved with a size which is not the "original" one (1,440 Kb) nor the "extended" one (2,880 Kb) but an "average" 2,048 Kb. :cheers:

An idea :cheers: could be to add to the GUI a column, so that you have two "Size of the image":
  • Size "according to filesystem"
  • Size "actual size in RAM or on disk"

:rofl:

jaclaz

#11 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

  • Developer
  • 1448 posts
  • Location:Borås, Sweden
  •  
    Sweden

Posted 14 February 2010 - 12:27 PM

Well, if I may, the point is two-fold:

  • correct the "false" behaviour of the Save Image... i.e. giving NOT the "false" message saved succesfully
  • add a further msgbox with something like "The current size of the RAW image does not match the size it was created, the image was extended: Do you want to append additional xxx blank sectors as to have the saved image xxxx in size?"


Yes, I could compare the size saved with the size of the virtual disk. That would tell if the complete disk was saved or not and it would make it possible to bring up a warning dialog about this. Sounds good.

Regarding #1 I am curious to understand WHY/HOW the image is actually saved with a size which is not the "original" one (1,440 Kb) nor the "extended" one (2,880 Kb) but an "average" 2,048 Kb. :rofl:


That sounds strange. When I test exactly that I always get a 1,440 KB image file. Tested on different computers with different Windows versions as well... :cheers:

An idea :cheers: could be to add to the GUI a column, so that you have two "Size of the image":

  • Size "according to filesystem"
  • Size "actual size in RAM or on disk"

:cheers:

jaclaz


That sounds like a good idea. Think I will go for that. :cheers:

#12 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 14 February 2010 - 01:29 PM

Yep , it is strange:
XP SP2 IMDISK version 1.1.4

Test:
New image 1474560 Floppy->Save Image->Error (could not be saved)
Extend->1000 blocks->Save Image->Error (could not be saved)
Extend->1000 blocks->Save Image->OK image saved succesfully (resulting image 2,048 Kb or 2,097,152 bytes) :cheers:

Successive approximations lead to:
New image 2097151 Floppy->Save Image->Error (could not be saved)
Extend->1 byte ->Save Image->OK image saved succesfully (resulting image 2,048 Kb or 2,097,152 bytes) B)

New image 2097152 Floppy->Save Image->OK image saved succesfully (resulting image 2,048 Kb or 2,097,152 bytes) :cheers:

New image 2097153 Floppy->Save Image->OK image saved succesfully (resulting image 2,048 Kb or 2,097,152 bytes) :cheers:

New image 3145727 Floppy->Save Image->OK image saved succesfully (resulting image 2,048 Kb or 2,097,152 bytes) :cheers:

New image 3145728 Floppy->Save Image->OK image saved succesfully (resulting image 2,048 Kb or 2,097,152 bytes) :rofl:

New image 4194303 Floppy->Save Image->OK image saved succesfully (resulting image 2,048 Kb or 2,097,152 bytes) :cheers:

New image 4194304 Floppy->Save Image->OK image saved succesfully (resulting image 4,096 Kb or 4,194,304 bytes) :rofl:

I guess we are starting to see a pattern, jumping in 2 Mb leaps. :)

Another little puzzle for you:
with GUI:
J: Virtual Memory 2,880 KB Read/Write, Removable N/A
(derived by extending 1,440 to 2,880)
try extending another time of 10000 bytes:
J: Virtual Memory 2,822 Mb Read/Write, Removable N/A :cheers:

Another:
J: Virtual Memory 1,440 KB Read/Write, Removable N/A
(derived by creating a new image 1474560 bytes)
try extending of 1 block:
J: Virtual Memory 1,407 Mb Read/Write, Removable N/A :w00t:

I guess it should be possible somewhere to set/choose "preferences" for the unit of how the size is displayed, using the same "metrics" you have available:
Bytes/Blocks/KiloBytes/Megabytes/Gigabytes
this would also help when using the program, as users wouldn't have to do "on-the-fly-conversions" and would be able to operate with whatever units they are used to or see fit for the paritcular operation or image.


:rofl:

Wonko




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users