Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

MetaDataProcessor.exe WINE notes


  • Please log in to reply
15 replies to this topic

#1 Brian Jepson

Brian Jepson

    Member

  • Members
  • PipPip
  • 15 posts
  • LocationKingston, RI

Posted 16 January 2011 - 11:44 PM

Here are some preliminary notes on running MetaDataProcessor.exe on WINE. This will let Linux and Mac users run the version of MetaDataProcessor.exe that comes with the .NET Micro Framework. Eventually we'll want to port MetaDataProcessor to portable C, but this will work in the meantime.

This takes the compiled assembly from the C# compiler (Linux instructions; Mac instructions), minimizes it to fit on the CPU, and gives you a PE file that can load dynamically or bundle into a hex file for MFDeploy. It is not a complete solution for compiling or deploying to Netduino on Mac and Linux, but is one of a few steps in that direction.

  • Install Wine
  • Configure wine by running winecfg at the command line.
  • Download the winetricks utility (http://wiki.winehq.org/winetricks)
  • Use winetricks to install the following libraries/packages: vcrun2010, vcrun2008, dotnet30
  • Copy the "le" versions of mscorlib.dll and Microsoft.SPOT.Native.dll into your working directory (where you plan to invoke MetaDataProcessor.exe from).

For your convenience, I have attached a zip file containing these DLLs (as well as some that are needed by the Mono compiler, including a couple of Netduino-specific DLLs) and MetaDataProcessor.exe from NETMF, which is an open source project distributed under the Apache 2.0 license.

Now you can run MetaDataProcessor.exe like this (all on one line):

wine MetaDataProcessor.exe -loadHints mscorlib mscorlib.dll -parse ASM.dll -minimize -endian le -compile ASM.pe

If MetaDataProcessor.exe is somewhere else, change Tools/ to point to its location. Also, replace ASM.dll with the DLL you want to process and ASM.pe with the name of the desired PE output file.

Attached Files


  • Claiskessed , kekzenevito , aredrateliarm and 3 others like this

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 16 January 2011 - 11:54 PM

Thanks, Brian!

Now that you've tracked down the WINE dependencies, we have a working post-processor and deployment tool working on Mac/Linux. Next step: getting the Mono C# compiler (dmcs.exe) to output DLLs using the .NET MF mscorlib.dll instead of the desktop's version.

BTW, I put the .pe file you sent me onto an SD card and loaded it onto my Netduino Plus using Fabien Royer's assembly loading sample code. The PE file from your Mac matches the PE file I made on Windows exactly, and the assembly loads without a hitch under .NET MF. Fantastic!

Chris

#3 Kristof De Buysere

Kristof De Buysere

    New Member

  • Members
  • Pip
  • 2 posts

Posted 08 April 2011 - 10:17 PM

I installed winetricks via Macports ($ sudo port install winetricks), but that doesn't seem to be entirely up-to-date. There's an error when winetricks tries to install vcrun2010. If you also have such an error, this is what I did: change w_download msxml3 http://download.micr...33dd/msxml3.msi d4c2178dfb807e1a0267fce0fd06b8d51106d913 to w_download msxml3 ftp://ftp.uni-rostock.de/pub/tools/microsoft/XML/US/msxml3.msi in the winetricks file (in the executable Unix file). msxml3.msi doesn't seem to be available any more from that initial location. I found this solution on http://www.zonalivre...ling-vcrun2010/ Possibly, you will have to delete or rename a file with the name "msxml3.msi" somewhere in a hidden folder (.cache) before you can retry to install vcrun2010.

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 09 April 2011 - 04:55 AM

Thanks for helping test this out (and contributing your notes), Kristof. Chris

#5 magarcan

magarcan

    Advanced Member

  • Members
  • PipPipPip
  • 43 posts

Posted 04 October 2011 - 11:13 AM

I tried with 3 different libraries and no one is working for me:
jae@newton:~/Desktop/netmfbins$ wine MetaDataProcessor.exe -loadHints mscorlib mscorlib.dll -parse MicroHTTP.dll -minimize -endian le -compile cosa.pe
fixme:heap:HeapSetInformation (nil) 1 (nil) 0
Cannot open 'MicroHTTP.dll'!
MMP: error MMP0000: 0x80070002
jae@newton:~/Desktop/netmfbins$ wine MetaDataProcessor.exe -loadHints mscorlib mscorlib.dll -parse MicroIO.dll -minimize -endian le -compile cosa.pe
fixme:heap:HeapSetInformation (nil) 1 (nil) 0
MMP: error MMP0000: Cannot locate file for assembly 'System.IO'

MMP: error MMP0000: CLR_E_ENTRY_NOT_FOUND
jae@newton:~/Desktop/netmfbins$ wine MetaDataProcessor.exe -loadHints mscorlib mscorlib.dll -parse MicroXBee.dll -minimize -endian le -compile cosa.pe
fixme:heap:HeapSetInformation (nil) 1 (nil) 0
Cannot open 'MicroXBee.dll'!
MMP: error MMP0000: 0x80070002
I think I've installed everything properly.

#6 manderson

manderson

    New Member

  • Members
  • Pip
  • 1 posts

Posted 25 April 2012 - 02:28 AM

4. Use winetricks to install the following libraries/packages: vcrun2010, vcrun2008, dotnet30

I don't understand what to do with this step. Assuming I have installed winetricks and it's available in the path what commands should I run?

Sorry, but I've never used winetricks before.

Thanks, Mike

#7 Brian Jepson

Brian Jepson

    Member

  • Members
  • PipPip
  • 15 posts
  • LocationKingston, RI

Posted 29 April 2012 - 04:34 PM

I don't understand what to do with this step. Assuming I have installed winetricks and it's available in the path what commands should I run?

Sorry, but I've never used winetricks before.

Thanks, Mike


Hi Mike, you can find documentation on winetricks here: http://wiki.winehq.org/winetricks

But you would type winetricks vcrun2010 to run vcrun2010, for example.

#8 DrDz

DrDz

    New Member

  • Members
  • Pip
  • 1 posts

Posted 14 May 2012 - 07:49 AM

[quote name='Brian Jepson' timestamp='1295221476' post='7782']
Here are some preliminary notes on running MetaDataProcessor.exe on WINE. This will let Linux and Mac users run the version of MetaDataProcessor.exe that comes with the .NET Micro Framework. Eventually we'll want to port MetaDataProcessor to portable C, but this will work in the meantime. .... like this (all on one line):

wine MetaDataProcessor.exe -loadHints mscorlib mscorlib.dll -parse ASM.dll -minimize -endian le -compile ASM.pe
Hey Brian! I am coming in a little late (but better than never?) to the party, but I had a quick Q regarding this. Since I first did a full Win7+VS2010 VM install to do Netduino dev, and now I want to try Mono, I can use the MDP in Windows instead of (having to do the WINE thing,.. further, the mscorlib here should be from Mono or does it matter? (Haven't checked yet)

Thanks

#9 Brian Jepson

Brian Jepson

    Member

  • Members
  • PipPip
  • 15 posts
  • LocationKingston, RI

Posted 14 May 2012 - 01:00 PM

Hey Brian! I am coming in a little late (but better than never?) to the party, but I had a quick Q regarding this. Since I first did a full Win7+VS2010 VM install to do Netduino dev, and now I want to try Mono, I can use the MDP in Windows instead of (having to do the WINE thing,.. further, the mscorlib here should be from Mono or does it matter? (Haven't checked yet)


DrDz,

I'm not sure if that command-line would work to run MetaDataProcessor.exe on Windows. I haven't played around with running MetaDataProcessor.exe from the command line on Windows (I just let VS2010 deal with it).

- Brian

#10 Convide

Convide

    New Member

  • Members
  • Pip
  • 5 posts
  • LocationAustria

Posted 19 May 2012 - 03:23 PM

If i try to run the MetaDataProcessor.exe I get an error back:

max@ubuntu:~/netmfbins$ wine MetaDataProcessor.exe -loadHints mscorlib mscorlib.dll -parse ASM.dll -minimize -endian le -compile ASM.pe
fixme:heap:HeapSetInformation (nil) 1 (nil) 0
Cannot open 'ASM.dll'!
MMP: error MMP0000: 0x80070002


Where do I get the ASM.dll from and will this problem solve the mmp error?

#11 Brian Jepson

Brian Jepson

    Member

  • Members
  • PipPip
  • 15 posts
  • LocationKingston, RI

Posted 23 May 2012 - 01:33 PM

Where do I get the ASM.dll from and will this problem solve the mmp error?


Please refer to the original post:

replace ASM.dll with the DLL you want to process and ASM.pe with the name of the desired PE output file.



#12 Convide

Convide

    New Member

  • Members
  • Pip
  • 5 posts
  • LocationAustria

Posted 28 May 2012 - 08:51 PM

replace ASM.dll with the DLL you want to process and ASM.pe with the name of the desired PE output file.


Sorry, I still do not understand what to do with the dll, or the "asm.dll". Is it optional, to include the dll-file, or for what do I need the file?
Can you, or somebody give me an detailed explanation, to solve my problem, please?

#13 Brian Jepson

Brian Jepson

    Member

  • Members
  • PipPip
  • 15 posts
  • LocationKingston, RI

Posted 28 May 2012 - 09:35 PM

Sorry, I still do not understand what to do with the dll, or the "asm.dll". Is it optional, to include the dll-file, or for what do I need the file?
Can you, or somebody give me an detailed explanation, to solve my problem, please?


Convide,

Do you already have a compiled assembly? In order to use the instructions in this post, you need to have an assembly you've compiled with a C# compiler. The DLL file that you produce from the C# compiler is the compiled assembly (asm.dll). See the other stickied posts the Mono forum (http://forums.netdui.../forum/12-mono/) in particular, http://forums.netdui...duino-on-linux/ and http://forums.netdui...no-on-mac-os-x.

The first of those posts will tell you how to compile your code to an assembly on Linux, the second will tell you how to do it on Mac OS X.

When you have compiled your C# code to an assembly, you'll have a .dll file.

Specify that filename instead of asm.dll when you run MetaDataProcessor.

- Brian

#14 Convide

Convide

    New Member

  • Members
  • Pip
  • 5 posts
  • LocationAustria

Posted 28 May 2012 - 10:33 PM

Convide,

Do you already have a compiled assembly? In order to use the instructions in this post, you need to have an assembly you've compiled with a C# compiler. The DLL file that you produce from the C# compiler is the compiled assembly (asm.dll). See the other stickied posts the Mono forum (http://forums.netdui.../forum/12-mono/) in particular, http://forums.netdui...duino-on-linux/ and http://forums.netdui...no-on-mac-os-x.

The first of those posts will tell you how to compile your code to an assembly on Linux, the second will tell you how to do it on Mac OS X.

When you have compiled your C# code to an assembly, you'll have a .dll file.

Specify that filename instead of asm.dll when you run MetaDataProcessor.

- Brian



Thanks for the quick and detailed reply. Now I got you. I thought: I have to compile the assembly file first, that I'm able to compile my code. Now everything is clear.

#15 Dr Who

Dr Who

    Advanced Member

  • Members
  • PipPipPip
  • 261 posts
  • LocationNYC

Posted 30 October 2013 - 03:42 AM

Hi Mike, you can find documentation on winetricks here: http://wiki.winehq.org/winetricks But you would type winetricks vcrun2010 to run vcrun2010, for example.

 

Hello!

Sorry Brian Jepson, not quite correct. Running the script on my Slackware 13.37 with an earlier release of WIne installed allowed me to install the runtime directly. It was quite a kick watching the whole business work itself out on my Linux box, via VNC and on this laptop who's running Windows Seven. It worked well enough on a VM containing Slackware 14.0 caused it to run as expected. I'm presently (trying to) build a newer release of Wine on the 13.37 one to see if the problems surfaced trying to building things on 1.5.2 go away. 

 

Remember: Linux is Linux. The big differences are only the distributions and the hardware. Some of us are Slackware users, and a lot of people are using what you are....... Then there are Fedora users. 

 

Chris what is needed is a FAQ outlining what to do for Mono on Linux in general.



Doctor Who
"This signature does not exist!"

#16 Dr Who

Dr Who

    Advanced Member

  • Members
  • PipPipPip
  • 261 posts
  • LocationNYC

Posted 02 November 2013 - 03:02 AM

Hello!

Group, I examined the entry in the script which does to a location the one shown isn't the one indicated above. In fact our friend found a completely new location for the installer file. It, ah, isn't the one shown above, it is not even one shown in the linked blog.

 

At this point I'm completely baffled.



Doctor Who
"This signature does not exist!"




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.