Problem with mounting hdd since svn 4130

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

Problem with mounting hdd since svn 4130

Postby bruenor41 » 2019-1-01 @ 13:58

Hi,

version 4130 added sanity check in file drive_fat.cpp. I try load img file like a 2GB hdd, but it fails on this check. Maybe is problem in hdd definition, maybe a bug. I am not sure, definition looks fine to me, it works with older revisions.

Code: Select all
   if ((bootbuffer.sectorsperfat == 0) || // FAT32 not implemented yet
      (bootbuffer.bytespersector != 512) || // non-standard sector sizes not implemented
      (bootbuffer.sectorspercluster == 0) ||
      (bootbuffer.rootdirentries == 0) ||
      (bootbuffer.fatcopies == 0) ||
      (bootbuffer.headcount == 0) ||
      (bootbuffer.headcount > headscyl) ||
      (bootbuffer.sectorspertrack == 0) ||
      (bootbuffer.sectorspertrack > cylsector)) {
      created_successfully = false;
      return;
   }


Code: Select all
imgmount d /path/to/file.img -t hdd -fs fat -size 512,63,64,1023
bruenor41
Newbie
 
Posts: 25
Joined: 2013-4-22 @ 08:58

Re: Problem with mounting hdd since svn 4130

Postby ripsaw8080 » 2019-1-01 @ 18:38

It is almost always a discrepancy in the number of heads and/or sectors per track between the boot sector info and geometry parameters you specify when mounting, which DOSBox SVN doesn't ignore anymore. It is planned to add a log message for the sanity checks that includes the head and sector count from the boot sector, which should help in understanding why the mount fails.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 4405
Joined: 2006-4-25 @ 23:24

Re: Problem with mounting hdd since svn 4130

Postby bruenor41 » 2019-1-01 @ 19:33

Thank you very much, I though it. I always used these constants for imgmount :

32MB: 512,63,16,520
256MB: 512,63,16,520
512MB: 512,63,32,520
1GB: 512,63,64,520
2GB: 512,63,64,1023

I tested 512, it still works , 2GB fails. It's long time what I created these images, I can try create new 2GB hdd.

Edit : this is what I get from debugging for 2GB geometry, seems problem is here : headcount > headscyl (128 > 64)

sectorsperfat 250
bytespersector 512
sectorspercluster 64
rootdirentries 512
fatcopies 2
headcount 128
headscyl 64
sectorspertrack 32
cylsector 63
bruenor41
Newbie
 
Posts: 25
Joined: 2013-4-22 @ 08:58


Return to DOSBox Development

Who is online

Users browsing this forum: No registered users and 1 guest