Jump to content











Photo
- - - - -

ImDisk - How to compile


  • Please log in to reply
11 replies to this topic

#1 freesoft00

freesoft00

    Member

  • Members
  • 34 posts
  •  
    China

Posted 30 July 2015 - 01:38 PM

imdisk how to compile



#2 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

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

Posted 30 July 2015 - 02:33 PM

(I split this question into a separate topic.)

 

Short step-by-step how-to for building ImDisk from source.

  1. Download ImDisk source code: http://ltr-data.se/f...mdisk_source.7zand extract it to a local directory.
  2. Download and install Windows Driver Kit 7.1.0. https://www.microsof...s.aspx?id=11800
  3. Setup will create some shortcuts for various machine architecture/OS version combinations in a folder on your start menu. Open the one that is relevant for you.
  4. Change to the directory where you extracted ImDisk source files.
  5. Type nmake in this directory if you would like to build all components. Otherwise, if you want to build the driver only for instance, change to sys subdirectory and type build there.


#3 freesoft00

freesoft00

    Member

  • Members
  • 34 posts
  •  
    China

Posted 31 July 2015 - 03:33 AM

thank you



#4 freesoft00

freesoft00

    Member

  • Members
  • 34 posts
  •  
    China

Posted 31 July 2015 - 04:58 AM

Success.But Cpl x86 compiler is not successful, do not know why?
Screenshot:
http://bbs.wuyou.net...I=&noupdate=yes

#5 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

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

Posted 31 July 2015 - 08:21 AM

Ah, yes sorry! This is caused by an attempt to make the build configuration compatible with Windows 2000. You could edit the "sources" files and remove the line _NT_TARGET_VERSION=0x0500 (or comment out with a # first on that line).

 

You can also download and extract imdisk_source.7z again, I have changed the sources files there now.



#6 freesoft00

freesoft00

    Member

  • Members
  • 34 posts
  •  
    China

Posted 01 August 2015 - 06:17 AM

Ah, yes sorry! This is caused by an attempt to make the build configuration compatible with Windows 2000. You could edit the "sources" files and remove the line _NT_TARGET_VERSION=0x0500 (or comment out with a # first on that line).
 
You can also download and extract imdisk_source.7z again, I have changed the sources files there now.

Compilation is OK, but can not point to save, a bit on the crash
http://bbs.wuyou.net...I=&noupdate=yes

Another feedback:
sys\imdisk.c
                        if (IMDISK_READONLY(CreateData->Flags) ||
                                (IMDISK_TYPE(CreateData->Flags) == IMDISK_TYPE_VM))
                                share_access |= FILE_SHARE_WRITE;  
Change
                        //if (IMDISK_READONLY(CreateData->Flags) ||
                        //        (IMDISK_TYPE(CreateData->Flags) == IMDISK_TYPE_VM))
                                share_access |= FILE_SHARE_WRITE; 
Changed to support: a disk writable mount multiple partitions. On the XP has been tested through (win7 does not have a certificate, not tested)

imdisk -a -f \\.\PhysicalDrive0 -b 13216K -s 2048000K -o par -m Z:
imdisk -a -f \\.\PhysicalDrive0 -b 2061216K -s 2048000K -o par -m Y:
http://bbs.wuyou.net...I=&noupdate=yes

#7 freesoft00

freesoft00

    Member

  • Members
  • 34 posts
  •  
    China

Posted 01 August 2015 - 02:07 PM

Modified source code by mdyblog
download link:
http://pan.baidu.com/s/1dDycScL
http://bbs.wuyou.net...c=&noupdate=yes

#8 freesoft00

freesoft00

    Member

  • Members
  • 34 posts
  •  
    China

Posted 01 August 2015 - 02:11 PM

ol@ltr-data.se
Is this your mailbox?, if a file with the right key to send you, in the forum I won't upload attachments, do not know whether you can download from the Chinese network disk?

#9 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

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

Posted 01 August 2015 - 03:57 PM

Yes, that's my e-mail address.

 

I have found the reason why that problem happens when you try to save as image file. I will correct that and publish a new version soon. Thanks for finding it!

 

Anyway, I like your idea to solve the problem where you want to mount several virtual devices out of one single image file or physical drive. I can definitely include that in the official version too. I will do this in a little bit different way though. You will need to use a special option with the -o switch for this to work. Otherwise, if the driver always open in shared write mode, one could accidentally mount the same image file as different writable virtual disks and that way corrupt the filesystem on it. With a command line option, it will at least be the user's choice to take this risk or to know that correct parameters are used so that virtual devices do not overlap.


  • v77 likes this

#10 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 02 August 2015 - 12:48 PM

Released new version:

http://reboot.pro/to...-news/?p=194151

 

@Olof can you post a couple examples of the use of the -o? 

How would these be changed to? (or they remain valid?)

 

 

Changed to support: a disk writable mount multiple partitions. On the XP has been tested through (win7 does not have a certificate, not tested)


imdisk -a -f \\.\PhysicalDrive0 -b 13216K -s 2048000K -o par -m Z:
imdisk -a -f \\.\PhysicalDrive0 -b 2061216K -s 2048000K -o par -m Y:

 

:duff:

Wonko



#11 Olof Lagerkvist

Olof Lagerkvist

    Gold Member

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

Posted 02 August 2015 - 04:22 PM

You would need to add -o shared to the command line.
 

imdisk -a -f \\.\PhysicalDrive0 -b 13216K -s 2048000K -o par -o shared -m Z:
imdisk -a -f \\.\PhysicalDrive0 -b 2061216K -s 2048000K -o par -o shared -m Y:

 
Or, since multiple options separated by commas can be specified with one single -o switch:
 

imdisk -a -f \\.\PhysicalDrive0 -b 13216K -s 2048000K -o par,shared -m Z:
imdisk -a -f \\.\PhysicalDrive0 -b 2061216K -s 2048000K -o par,shared -m Y:


#12 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 02 August 2015 - 05:10 PM

Thank you. :)

 

Besides the usual reminder :whistling::

http://reboot.pro/to...sk-20/?p=192694

Which I have personally resolved by running (so that also the version is shown):

imdisk --version >imdisk.txt&imdisk 2>>imdisk.txt

An idea may be that of re-ordering switches (and parameters) alphabetically. :unsure:

(on a next release, of course)

 

:duff:

Wonko






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users