Jump to content











Photo
- - - - -

fat12 img mount error


  • Please log in to reply
5 replies to this topic

#1 kolio

kolio
  • Members
  • 3 posts
  •  
    Ukraine

Posted 16 February 2018 - 10:09 AM

hi Olof

i have 1 problem with mounting FAT12 image file

 

when img file have 129 (0x81) sectors and more - all ok

but when 128 (0x80) and less - driver show error "invalid params"

this error happens in \sys\iodisp.cpp function IOCTL_IMDISK_CREATE_DEVICE

 

0x80 is 129 sectors with 512 bytes each

file size is 66048

but i was made minimalistic FAT12 img with 1 file (2048bytes) and this file mounting good in program "Gizmo Director/Gizmo Drive"

but ImDisk dont want mount :(

 

my IMG file: http://www37.zippysh...aRUzC/file.html

 

image contain 1 file and 1 FAT

img file only 3584 bytes :) only 7 sectors (1 boot, 1 fat, 1 root, 4 file)

 

maybe driver have some limits in src? can you helps to find this bug?


Edited by kolio, 16 February 2018 - 10:11 AM.


#2 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

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

Posted 16 February 2018 - 10:43 AM

Yes, there is a hard coded limit. The size of a virtual disk created by ImDisk needs to be more than 64 KB. This was introduced because there were lots of reports from people who had mistakenly typed a size in bytes when they actually meant KB or MB or something similar. Smaller sizes often caused filesystem drivers to crash with blue screens which of course was really bad in many cases. It might happen that this is not a problem anymore on modern Windows versions, but I doubt it would be a good idea to change it anyway.



#3 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 16 February 2018 - 10:45 AM

@kolio

As a side note (and  not connected with the issue you found):

Your image seems like a "hybrid" one, similar (but without the code) to the ones you can create with MakeBootFat.

Its first sector contains both a BPB (i.e. it is a FAT12 bootsector) and an entry in partition table (i.e. it is also a MBR), maybe this could additionally confuse the parser.

The data in the MBR (LBA) is 0/320, and the partition is active.

 

:duff:

Wpnko


  • Olof Lagerkvist likes this

#4 kolio

kolio
  • Members
  • 3 posts
  •  
    Ukraine

Posted 16 February 2018 - 11:00 AM

thanks Olof


  • Olof Lagerkvist likes this

#5 v77

v77

    Silver Member

  • Team Reboot
  • 602 posts
  •  
    France

Posted 16 February 2018 - 12:48 PM

Oops, I was not aware of this limit...
In ImDisk Toolkit, with MountImg, if the image file does not exists, the user is prompted to create a new one, with a minimal size of 20 KB. With this size, the file is created but the mounting fails.
I was sure to have tested this case... At least, the fix is easy.

#6 kolio

kolio
  • Members
  • 3 posts
  •  
    Ukraine

Posted 22 February 2018 - 01:39 PM

after exploring src and read some info we allocate 3 sectors to ROOT (minimum is 3 sectors) and after this driver never freeze

 

thanks Olof


Edited by kolio, 22 February 2018 - 01:40 PM.

  • Olof Lagerkvist likes this




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users