Re: [gentoo-user] Re: Flashing hardware via WINE ?
On Sonntag, 19. März 2017 11:20:35 CET Kai Krakow wrote: > > Hi Kai (that's a rhyme! > > Yeah, I know that one... If you are from Germany, you'll also get why > my former nick (some years ago) was "Shark" Hah! That reminds me: there's a Gentoo developer by the name of David Seifert. His nick? "Soap". (I grew up bilingual, what with an American mother and a German father, and am from, and currently live in, Germany.) Greetings -- Marc Joliet -- "People who think they know everything really annoy those of us who know we don't" - Bjarne Stroustrup signature.asc Description: This is a digitally signed message part.
[gentoo-user] Re: Flashing hardware via WINE ?
On 2017-03-19, tu...@posteo.dewrote: > yes...no chance. > Linux is insecure...you know. > It makes it possible to spy the firmware and decrypt it on > the way to the charger. > > Windows is much more secure. Wow. It's actually much easier to grab serial data on Windows (using sysinternals 'portmon') than it is on Linux (you can do it with strace, but it's not easy). > Earth is flat and there was no landing on the moon. > > I believe in Santa Claus. -- Grant
[gentoo-user] Re: Flashing hardware via WINE ?
Am Sun, 19 Mar 2017 11:38:56 +0100 schrieb tu...@posteo.de: > On 03/19 10:27, Neil Bothwick wrote: > > On Sun, 19 Mar 2017 09:09:51 +0100, tu...@posteo.de wrote: > > > > > I have a smart NiMH-charger with serial port (normally used to > > > dump chargeing curves to the PC). > > > The chargers firmware can bei flashed with a flashtool provided > > > by the vendor. The communication is via serial port. I have > > > a PCI=>serial.ports-card installed in my PC. > > > > > > The command > > > > > > file > > > > > > results in this information > > > > > > PE32 executable (GUI) Intel 80386, for MS Windows > > > > > > . As Linux user by heart I have no Windows. > > > > Have you tried contacting the manufacturer to see if flashing from > > Linux is possible? > > > > > > -- > > Neil Bothwick > > > > I am MODERATOR of BORG. Follow the rules or be assimilated. > > Hi Neil, > > yes...no chance. > Linux is insecure...you know. > It makes it possible to spy the firmware and decrypt it on > the way to the charger. > > Windows is much more secyre. > > Earth is flat and there was no landing on the moon. > > I believe in Santa Claus. And then there is Wireshark in Windows, with libpcap for USB... It can easily decode and record all USB frames. I successfully used it some time ago to debug a custom made USB board and found bugs in the firmware, which I had access to that way. In the end, there was a bug in the interrupt handler: a race condition overwriting the USB communication buffer too early and thus sending back wrong data in the USB HID frames back to the PC (part old data, part new data). The bug was uncovered by our implementation using a highly optimized threaded implementation to use the maximum bandwidth the device could provide. It wasn't possible to convince the firmware programmer about the bug (which was really expensive for our customer) and the project was eventually stopped. Strangely, they later provided a firmware without this failing behavior, much later. Project still paused. But the preliminary implementation now runs and show very high time resolution of measurement data (it's an electrochemical spectrometer, just if you're curious). Just that in Linux tools are available more easily doesn't mean that Windows is more "secure". ;-) Choose your partners wisely. -- Regards, Kai Replies to list-only preferred.
[gentoo-user] Re: Flashing hardware via WINE ?
Am Sun, 19 Mar 2017 11:35:44 +0100 schrieb tu...@posteo.de: > On 03/19 11:20, Kai Krakow wrote: > > Am Sun, 19 Mar 2017 09:57:22 +0100 > > schrieb tu...@posteo.de: > > > > > On 03/19 09:37, Kai Krakow wrote: > [...] > [...] > [...] > [...] > [...] > > > > > > Hi Kai (that's a rhyme! :) > > > > Yeah, I know that one... If you are from Germany, you'll also get > > why my former nick (some years ago) was "Shark" :-) > > > > > I have installed Virtualbox already and use the Linux Image I > > > installed there for banking purposes only. Feels more secure. > > > > So something like application virtualization... You could maybe run > > in an isolated container, only exposing the xserver or run inside a > > nested xserver. It would probably greatly reduce startup times and > > not waste a complete image. > > > > > I would prefer the WIndows-in-a-(virtual)box-solution) as you > > > do -- if I would own a Windows installation disc. But do not. > > > > Well, you can easily get an image from MS using a Linux browser. > > Just go to the Windows 10 download page. It will show a selection > > form to choose the ISO instead of the nasty downloader they present > > to Windows browsers. Then install this inside the VM. Even if not > > activated, it runs for 1-2 hours before shutting down which should > > be enough for most purposes you'll need it for. > > > > If you already activated a Windows installation with your MS > > account, with some luck your Win10 VM may even become digitally > > activated (this happened to me). No cracks involved. Should be > > legal enough. ;-) > > > But it is good to know, that the wine-workaround would either > > > work or fail too early to damage anything. > > > > I tried some, and all failed because they didn't even find the > > device. The ones that worked where either network based (flashing > > via IP protocol) or using other simple interfaces (COM or LPT). > > > > > Is there anything important to know before doing an emerge > > > of wine (need I more than app-emulation/wine?) -- I have > > > literally no experience with this emulator - the flashing > > > tool is a 32bit gui application...) ??? > > > > Wine = wine is no emulater ;-) > > > > Actually, it's the Windows API implemented as .so files plus an EXE > > loader to enable the kernel to run PE binaries (instead of ELF). So > > nothing is emulated, it's running native. There's also a thin layer > > of drivers implemented to transform API calls to native kernel > > interfaces, like HID (for input devices). So everything connecting > > to simple HID-USB should also work (some custom USB hardware just > > implement a HID interface, it's simple and cheap). > > > > If your applications work depends on if the required parts of the > > API had been implemented (including the bugs that exists between > > different versions of Windows). > > > > So, with this knowledge, you simply emerge wine with the useflags > > that look useful to you. If you don't need graphics (DirectX) or > > don't want to apply your linux GUI theme to Windows apps, you can > > ignore the staging useflag. Wine can be compiled with both 64bit > > and 32bit support. > > > > After installation, get familiar with the winecfg utility. It allows > > mapping unix path to Windows drive letters. And it allows to set > > Windows version per EXE you run (to expose different API bugs and > > behavior to your application). Also, you can set DDL overrides > > (which is what Windows itself uses when you run applications in > > compatibility mode, or when you put DLL overrides manually in the > > registry). Tho, here you can decide between native (native DLL on > > filesystem) or builtin (*.dll.so file from Wine), and the order in > > which they are tried. > > > > You may also run with different WINEDEBUG settings if you want to > > work out problems. There are fixme lines which usually show stub > > implementations of API calls (functions that do nothing, and are > > there just to return success or fail). You can use it like this: > > > > # WINEDEBUG=-all wine your-exe-file.exe > > > > If you'd like to easily manage different Wine prefixes, I'd > > recommend using PlayOnLinux - it's not only useful to games. It > > also has a long list of scripted installers for installing popular > > Windows extensions that you may need (fonts, VB runtimes, C > > runtimes) in different versions. > > > > And then, maybe you want to use winetricks, tho it may be a bit > > tricky to run this with PlayOnLinux because it will default to the > > non-PlayOnLinux wine prefix. Easy work-around: Launch a commandline > > shell from within PlayOnLinux and run winetricks there. > > > > With PlayOnLinux you can easily reset or discard wine prefixes if > > you messed up. Also, you can see each prefix as some sort of > > compatibility profile you individually crafted per Windows > > application you are running. > > > > -- > > Regards, > > Kai > > > > Replies
Re: [gentoo-user] Re: Flashing hardware via WINE ?
On 03/19 11:20, Kai Krakow wrote: > Am Sun, 19 Mar 2017 09:57:22 +0100 > schrieb tu...@posteo.de: > > > On 03/19 09:37, Kai Krakow wrote: > > > Am Sun, 19 Mar 2017 09:09:51 +0100 > > > schrieb tu...@posteo.de: > > > > > > > Hi, > > > > > > > > I have a smart NiMH-charger with serial port (normally used to > > > > dump chargeing curves to the PC). > > > > The chargers firmware can bei flashed with a flashtool provided > > > > by the vendor. The communication is via serial port. I have > > > > a PCI=>serial.ports-card installed in my PC. > > > > > > > > The command > > > > > > > > file > > > > > > > > results in this information > > > > > > > > PE32 executable (GUI) Intel 80386, for MS Windows > > > > > > > > . As Linux user by heart I have no Windows. > > > > > > > > May the attempt to install wine and use it for this purpose > > > > a thinkable way or are the precoditions that way, that it > > > > is due to those a NO-NO...? > > > > > > Flashing via serial port should be no problem from within Wine. It > > > requires no special driver implementation. > > > > > > However, if the hardware implements its own driver behind the serial > > > port, it won't work anyways because on the Wine side there will be > > > no such driver. > > > > > > So I think, it should either work or fail early without doing > > > damage. > > > > > > > > > > Does anyone have experience with such an attempt? > > > > > > I'm usually doing such things from VirtualBox by passing through the > > > hardware (usually USB, that's easily done from within the GUI). > > > > > > VirtualBox can also pass COM ports to the VM. You may want to try > > > that as a second chance. > > > > > > > > > -- > > > Regards, > > > Kai > > > > > > Replies to list-only preferred. > > > > Hi Kai (that's a rhyme! :) > > Yeah, I know that one... If you are from Germany, you'll also get why > my former nick (some years ago) was "Shark" :-) > > > I have installed Virtualbox already and use the Linux Image I > > installed there for banking purposes only. Feels more secure. > > So something like application virtualization... You could maybe run in > an isolated container, only exposing the xserver or run inside a nested > xserver. It would probably greatly reduce startup times and not waste a > complete image. > > > I would prefer the WIndows-in-a-(virtual)box-solution) as you > > do -- if I would own a Windows installation disc. But do not. > > Well, you can easily get an image from MS using a Linux browser. Just > go to the Windows 10 download page. It will show a selection form to > choose the ISO instead of the nasty downloader they present to Windows > browsers. Then install this inside the VM. Even if not activated, it > runs for 1-2 hours before shutting down which should be enough for most > purposes you'll need it for. > > If you already activated a Windows installation with your MS account, > with some luck your Win10 VM may even become digitally activated (this > happened to me). No cracks involved. Should be legal enough. ;-) > > > But it is good to know, that the wine-workaround would either > > work or fail too early to damage anything. > > I tried some, and all failed because they didn't even find the device. > The ones that worked where either network based (flashing via IP > protocol) or using other simple interfaces (COM or LPT). > > > Is there anything important to know before doing an emerge > > of wine (need I more than app-emulation/wine?) -- I have > > literally no experience with this emulator - the flashing > > tool is a 32bit gui application...) ??? > > Wine = wine is no emulater ;-) > > Actually, it's the Windows API implemented as .so files plus an EXE > loader to enable the kernel to run PE binaries (instead of ELF). So > nothing is emulated, it's running native. There's also a thin layer of > drivers implemented to transform API calls to native kernel interfaces, > like HID (for input devices). So everything connecting to simple > HID-USB should also work (some custom USB hardware just implement a HID > interface, it's simple and cheap). > > If your applications work depends on if the required parts of the API > had been implemented (including the bugs that exists between different > versions of Windows). > > So, with this knowledge, you simply emerge wine with the useflags that > look useful to you. If you don't need graphics (DirectX) or don't want > to apply your linux GUI theme to Windows apps, you can ignore the > staging useflag. Wine can be compiled with both 64bit and 32bit support. > > After installation, get familiar with the winecfg utility. It allows > mapping unix path to Windows drive letters. And it allows to set > Windows version per EXE you run (to expose different API bugs and > behavior to your application). Also, you can set DDL overrides (which > is what Windows itself uses when you run applications in compatibility > mode, or when you put DLL overrides manually
[gentoo-user] Re: Flashing hardware via WINE ?
Am Sun, 19 Mar 2017 09:57:22 +0100 schrieb tu...@posteo.de: > On 03/19 09:37, Kai Krakow wrote: > > Am Sun, 19 Mar 2017 09:09:51 +0100 > > schrieb tu...@posteo.de: > > > > > Hi, > > > > > > I have a smart NiMH-charger with serial port (normally used to > > > dump chargeing curves to the PC). > > > The chargers firmware can bei flashed with a flashtool provided > > > by the vendor. The communication is via serial port. I have > > > a PCI=>serial.ports-card installed in my PC. > > > > > > The command > > > > > > file > > > > > > results in this information > > > > > > PE32 executable (GUI) Intel 80386, for MS Windows > > > > > > . As Linux user by heart I have no Windows. > > > > > > May the attempt to install wine and use it for this purpose > > > a thinkable way or are the precoditions that way, that it > > > is due to those a NO-NO...? > > > > Flashing via serial port should be no problem from within Wine. It > > requires no special driver implementation. > > > > However, if the hardware implements its own driver behind the serial > > port, it won't work anyways because on the Wine side there will be > > no such driver. > > > > So I think, it should either work or fail early without doing > > damage. > > > > > > > Does anyone have experience with such an attempt? > > > > I'm usually doing such things from VirtualBox by passing through the > > hardware (usually USB, that's easily done from within the GUI). > > > > VirtualBox can also pass COM ports to the VM. You may want to try > > that as a second chance. > > > > > > -- > > Regards, > > Kai > > > > Replies to list-only preferred. > > Hi Kai (that's a rhyme! :) Yeah, I know that one... If you are from Germany, you'll also get why my former nick (some years ago) was "Shark" :-) > I have installed Virtualbox already and use the Linux Image I > installed there for banking purposes only. Feels more secure. So something like application virtualization... You could maybe run in an isolated container, only exposing the xserver or run inside a nested xserver. It would probably greatly reduce startup times and not waste a complete image. > I would prefer the WIndows-in-a-(virtual)box-solution) as you > do -- if I would own a Windows installation disc. But do not. Well, you can easily get an image from MS using a Linux browser. Just go to the Windows 10 download page. It will show a selection form to choose the ISO instead of the nasty downloader they present to Windows browsers. Then install this inside the VM. Even if not activated, it runs for 1-2 hours before shutting down which should be enough for most purposes you'll need it for. If you already activated a Windows installation with your MS account, with some luck your Win10 VM may even become digitally activated (this happened to me). No cracks involved. Should be legal enough. ;-) > But it is good to know, that the wine-workaround would either > work or fail too early to damage anything. I tried some, and all failed because they didn't even find the device. The ones that worked where either network based (flashing via IP protocol) or using other simple interfaces (COM or LPT). > Is there anything important to know before doing an emerge > of wine (need I more than app-emulation/wine?) -- I have > literally no experience with this emulator - the flashing > tool is a 32bit gui application...) ??? Wine = wine is no emulater ;-) Actually, it's the Windows API implemented as .so files plus an EXE loader to enable the kernel to run PE binaries (instead of ELF). So nothing is emulated, it's running native. There's also a thin layer of drivers implemented to transform API calls to native kernel interfaces, like HID (for input devices). So everything connecting to simple HID-USB should also work (some custom USB hardware just implement a HID interface, it's simple and cheap). If your applications work depends on if the required parts of the API had been implemented (including the bugs that exists between different versions of Windows). So, with this knowledge, you simply emerge wine with the useflags that look useful to you. If you don't need graphics (DirectX) or don't want to apply your linux GUI theme to Windows apps, you can ignore the staging useflag. Wine can be compiled with both 64bit and 32bit support. After installation, get familiar with the winecfg utility. It allows mapping unix path to Windows drive letters. And it allows to set Windows version per EXE you run (to expose different API bugs and behavior to your application). Also, you can set DDL overrides (which is what Windows itself uses when you run applications in compatibility mode, or when you put DLL overrides manually in the registry). Tho, here you can decide between native (native DLL on filesystem) or builtin (*.dll.so file from Wine), and the order in which they are tried. You may also run with different WINEDEBUG settings if you want to work out problems. There are fixme lines
Re: [gentoo-user] Re: Flashing hardware via WINE ?
On 03/19 09:37, Kai Krakow wrote: > Am Sun, 19 Mar 2017 09:09:51 +0100 > schrieb tu...@posteo.de: > > > Hi, > > > > I have a smart NiMH-charger with serial port (normally used to > > dump chargeing curves to the PC). > > The chargers firmware can bei flashed with a flashtool provided > > by the vendor. The communication is via serial port. I have > > a PCI=>serial.ports-card installed in my PC. > > > > The command > > > > file > > > > results in this information > > > > PE32 executable (GUI) Intel 80386, for MS Windows > > > > . As Linux user by heart I have no Windows. > > > > May the attempt to install wine and use it for this purpose > > a thinkable way or are the precoditions that way, that it > > is due to those a NO-NO...? > > Flashing via serial port should be no problem from within Wine. It > requires no special driver implementation. > > However, if the hardware implements its own driver behind the serial > port, it won't work anyways because on the Wine side there will be no > such driver. > > So I think, it should either work or fail early without doing damage. > > > > Does anyone have experience with such an attempt? > > I'm usually doing such things from VirtualBox by passing through the > hardware (usually USB, that's easily done from within the GUI). > > VirtualBox can also pass COM ports to the VM. You may want to try that > as a second chance. > > > -- > Regards, > Kai > > Replies to list-only preferred. Hi Kai (that's a rhyme! :) I have installed Virtualbox already and use the Linux Image I installed there for banking purposes only. Feels more secure. I would prefer the WIndows-in-a-(virtual)box-solution) as you do -- if I would own a Windows installation disc. But do not. But it is good to know, that the wine-workaround would either work or fail too early to damage anything. Is there anything important to know before doing an emerge of wine (need I more than app-emulation/wine?) -- I have literally no experience with this emulator - the flashing tool is a 32bit gui application...) ??? Cheers Meino
[gentoo-user] Re: Flashing hardware via WINE ?
Am Sun, 19 Mar 2017 09:09:51 +0100 schrieb tu...@posteo.de: > Hi, > > I have a smart NiMH-charger with serial port (normally used to > dump chargeing curves to the PC). > The chargers firmware can bei flashed with a flashtool provided > by the vendor. The communication is via serial port. I have > a PCI=>serial.ports-card installed in my PC. > > The command > > file > > results in this information > > PE32 executable (GUI) Intel 80386, for MS Windows > > . As Linux user by heart I have no Windows. > > May the attempt to install wine and use it for this purpose > a thinkable way or are the precoditions that way, that it > is due to those a NO-NO...? Flashing via serial port should be no problem from within Wine. It requires no special driver implementation. However, if the hardware implements its own driver behind the serial port, it won't work anyways because on the Wine side there will be no such driver. So I think, it should either work or fail early without doing damage. > Does anyone have experience with such an attempt? I'm usually doing such things from VirtualBox by passing through the hardware (usually USB, that's easily done from within the GUI). VirtualBox can also pass COM ports to the VM. You may want to try that as a second chance. -- Regards, Kai Replies to list-only preferred.