Gentoo Archives: gentoo-user

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

Replies

Subject Author
[gentoo-user] Re: Flashing hardware via WINE ? Kai Krakow <hurikhan77@×××××.com>