Gentoo Archives: gentoo-user

From: Kai Krakow <hurikhan77@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Flashing hardware via WINE ?
Date: Sun, 19 Mar 2017 10:21:05
Message-Id: 20170319112035.067c4f20@jupiter.sol.kaishome.de
In Reply to: Re: [gentoo-user] Re: Flashing hardware via WINE ? by tuxic@posteo.de
1 Am Sun, 19 Mar 2017 09:57:22 +0100
2 schrieb tuxic@××××××.de:
3
4 > On 03/19 09:37, Kai Krakow wrote:
5 > > Am Sun, 19 Mar 2017 09:09:51 +0100
6 > > schrieb tuxic@××××××.de:
7 > >
8 > > > Hi,
9 > > >
10 > > > I have a smart NiMH-charger with serial port (normally used to
11 > > > dump chargeing curves to the PC).
12 > > > The chargers firmware can bei flashed with a flashtool provided
13 > > > by the vendor. The communication is via serial port. I have
14 > > > a PCI=>serial.ports-card installed in my PC.
15 > > >
16 > > > The command
17 > > >
18 > > > file <flashing tool>
19 > > >
20 > > > results in this information
21 > > >
22 > > > PE32 executable (GUI) Intel 80386, for MS Windows
23 > > >
24 > > > . As Linux user by heart I have no Windows.
25 > > >
26 > > > May the attempt to install wine and use it for this purpose
27 > > > a thinkable way or are the precoditions that way, that it
28 > > > is due to those a NO-NO...?
29 > >
30 > > Flashing via serial port should be no problem from within Wine. It
31 > > requires no special driver implementation.
32 > >
33 > > However, if the hardware implements its own driver behind the serial
34 > > port, it won't work anyways because on the Wine side there will be
35 > > no such driver.
36 > >
37 > > So I think, it should either work or fail early without doing
38 > > damage.
39 > >
40 > >
41 > > > Does anyone have experience with such an attempt?
42 > >
43 > > I'm usually doing such things from VirtualBox by passing through the
44 > > hardware (usually USB, that's easily done from within the GUI).
45 > >
46 > > VirtualBox can also pass COM ports to the VM. You may want to try
47 > > that as a second chance.
48 > >
49 > >
50 > > --
51 > > Regards,
52 > > Kai
53 > >
54 > > Replies to list-only preferred.
55 >
56 > Hi Kai (that's a rhyme! :)
57
58 Yeah, I know that one... If you are from Germany, you'll also get why
59 my former nick (some years ago) was "Shark" :-)
60
61 > I have installed Virtualbox already and use the Linux Image I
62 > installed there for banking purposes only. Feels more secure.
63
64 So something like application virtualization... You could maybe run in
65 an isolated container, only exposing the xserver or run inside a nested
66 xserver. It would probably greatly reduce startup times and not waste a
67 complete image.
68
69 > I would prefer the WIndows-in-a-(virtual)box-solution) as you
70 > do -- if I would own a Windows installation disc. But do not.
71
72 Well, you can easily get an image from MS using a Linux browser. Just
73 go to the Windows 10 download page. It will show a selection form to
74 choose the ISO instead of the nasty downloader they present to Windows
75 browsers. Then install this inside the VM. Even if not activated, it
76 runs for 1-2 hours before shutting down which should be enough for most
77 purposes you'll need it for.
78
79 If you already activated a Windows installation with your MS account,
80 with some luck your Win10 VM may even become digitally activated (this
81 happened to me). No cracks involved. Should be legal enough. ;-)
82
83 > But it is good to know, that the wine-workaround would either
84 > work or fail too early to damage anything.
85
86 I tried some, and all failed because they didn't even find the device.
87 The ones that worked where either network based (flashing via IP
88 protocol) or using other simple interfaces (COM or LPT).
89
90 > Is there anything important to know before doing an emerge
91 > of wine (need I more than app-emulation/wine?) -- I have
92 > literally no experience with this emulator - the flashing
93 > tool is a 32bit gui application...) ???
94
95 Wine = wine is no emulater ;-)
96
97 Actually, it's the Windows API implemented as .so files plus an EXE
98 loader to enable the kernel to run PE binaries (instead of ELF). So
99 nothing is emulated, it's running native. There's also a thin layer of
100 drivers implemented to transform API calls to native kernel interfaces,
101 like HID (for input devices). So everything connecting to simple
102 HID-USB should also work (some custom USB hardware just implement a HID
103 interface, it's simple and cheap).
104
105 If your applications work depends on if the required parts of the API
106 had been implemented (including the bugs that exists between different
107 versions of Windows).
108
109 So, with this knowledge, you simply emerge wine with the useflags that
110 look useful to you. If you don't need graphics (DirectX) or don't want
111 to apply your linux GUI theme to Windows apps, you can ignore the
112 staging useflag. Wine can be compiled with both 64bit and 32bit support.
113
114 After installation, get familiar with the winecfg utility. It allows
115 mapping unix path to Windows drive letters. And it allows to set
116 Windows version per EXE you run (to expose different API bugs and
117 behavior to your application). Also, you can set DDL overrides (which
118 is what Windows itself uses when you run applications in compatibility
119 mode, or when you put DLL overrides manually in the registry). Tho,
120 here you can decide between native (native DLL on filesystem) or builtin
121 (*.dll.so file from Wine), and the order in which they are tried.
122
123 You may also run with different WINEDEBUG settings if you want to work
124 out problems. There are fixme lines which usually show stub
125 implementations of API calls (functions that do nothing, and are there
126 just to return success or fail). You can use it like this:
127
128 # WINEDEBUG=-all wine your-exe-file.exe
129
130 If you'd like to easily manage different Wine prefixes, I'd recommend
131 using PlayOnLinux - it's not only useful to games. It also has a long
132 list of scripted installers for installing popular Windows extensions
133 that you may need (fonts, VB runtimes, C runtimes) in different
134 versions.
135
136 And then, maybe you want to use winetricks, tho it may be a bit tricky
137 to run this with PlayOnLinux because it will default to the
138 non-PlayOnLinux wine prefix. Easy work-around: Launch a commandline
139 shell from within PlayOnLinux and run winetricks there.
140
141 With PlayOnLinux you can easily reset or discard wine prefixes if you
142 messed up. Also, you can see each prefix as some sort of compatibility
143 profile you individually crafted per Windows application you are
144 running.
145
146 --
147 Regards,
148 Kai
149
150 Replies to list-only preferred.

Replies

Subject Author
Re: [gentoo-user] Re: Flashing hardware via WINE ? tuxic@××××××.de
Re: [gentoo-user] Re: Flashing hardware via WINE ? Marc Joliet <marcec@×××.de>