December 2010

Gentoo/MIPS O32: New builds

Recently, a new version of binutils was released.

I had reported earlier about some patches needed to work around errata bugs in the Loongson CPUs.  There were also some other big updates since.  GCC 4.5 and Perl 5.12 have both been unmasked, enough has changed to warrant a rebuild before things get too far out of date.

This release will come with binutils-2.21 which incorporates many fixes for linker issues on MIPS, as well as the Loongson errata.  I have successfully compiled KDE 4.5 using a CVS HEAD version of binutils snapshotted around the time that the 2.21 branch was created, and found that it has fixed quite a few issues.

If you haven’t upgraded just yet, hold on a few weeks and I’ll have new stages up for all to try out.  MIPS-I Little-Endian is building now as I type this, I’m in the process of building seed stages for big-endian builds.  MIPS-III and MIPS-IV little endian builds will begin very soon too (before noon AEST).

I expect I should have most of the little-endian builds up before new year, and the whole release out in early January 2011.

VMWare Server 2.0: How web-based fails and a work-around for the masses

Well, I’ve recently gained some employment where I’m making use of VMWare Server to run a Windows 2003 virtual machine.  This VM runs ION Enterprise, Schneider Electric’s energy management package.  The project I’m working on will involve communicating with this software package.

Now, I’m working from home, and luckily I had the foresight to upgrade my desktop (actually, my hand was forced, the old one died) and I settled on purchasing a new 64-bit system based around the AMD Phenom II X6 1090T, which amongst other things, features the AMD-V virtualisation feature.  I’ve used it with VirtualBox OSE and it runs rather well.  However, for this job, the image I had was for VMWare.

Yes, I could “convert” it over to running on VirtualBox, but what if the hardware was different?  Windows doesn’t like that sort of thing.  The CPU changing model would be bad enough, and there was nothing I could do to prevent that, but I wanted to keep as much identical as possible.  So I began by installing VMWare.  There were two options I considered; Server and Player.  I figured Server had some nice features, one of which being that I can access the VM remotely.  I often like to work on the front verandah at home where there’s a nice cool breeze, this would enable me to run client software on my laptop and access it via the network.  Sounds good.

Sounded good.

The web interface firstly, relies on SSL 2.0 as its means of security.  Ewww! SSL3 was out in 1996, why are we using a security protocol that’s so old, and fundamentally broken?  Well, I’m not sure whether SSL3 is absent, or broken with regards to Firefox, but Firefox sure doesn’t like it, and won’t talk to the web interface until you apply one small hack to about:config, which enables SSL 2.0.

Now, once that’s done, you can at least log in and do things with the server.  All well and good.  I had some fun and games getting the image to boot, it turned out the disk image set for one of the drives was in the wrong place.  Some symbolic linking fixed that, and I had Windows 2003 booting.  No worries, but where’s the screen? I’ll come back to this.

VMWare Server 2.0 abandons the remote console it appears in favour of a web interface.  They don’t mention this in the documentation however, and when I at first couldn’t get at the web interface, my first instinct was to just install app-emulation/vmware-server-console. At first it refused to start, I had to apply some patches and install libraries from here to get it to even come up, lest I got a message about undefined symbols. It’s times like this I really begin to despise closed-source software. The clincher though was when I tried to log in, I was confronted by this:

Unable to connect to the remote host: 501 Global command GLOBAL server-vmdb to non-host agent targets not supported.

No one seems to know exactly what that geek-speak gibberish is supposed to mean. Best I can ascertain is that current versions of VMWare Server Console are for VMWare Server 1.0, and not compatible with its more modern counterpart. Everyone’s solution was to “use the web interface”. Now prior to that SSL hack, all I’d get is the server slamming the door in my face. Firefox would refuse to connect remotely. I discovered I could log in when running a local Firefox instance on the machine running VMWare Server.

That’s fine, got the VM set up and booting, try to bring up the screen. At first it needed to install a plug-in for the VMWare console, that’s fine, I do this and restart Firefox (3.6.8), then try again. I click on the screen area. It sits there for what seems like 30 seconds doing nothing, no acknowledgement that I had clicked it, I clicked a few times before it finally informed me:

Cannot access virtual machine console. The request timed out.
The attempt to acquire a valid session ticket for "Windows 2003 Server" took longer than expected. If this problem persists, contact your system administrator.

I did exactly what it said. I conversed with myself at considerable length to the problem while I researched the problem. I drew blanks every time. F$#!% VMWare, what ever happened to a desktop client?! Heck, why not open a VNC port or something?

Further research seemed to suggest it was a glitch with Firefox 3.6. On a hunch, I fired up VirtualBox, and started up a Windows XP VM which had IE8 installed. Pointed that at VMWare, and voila, I was in. It seems extremely silly to require another VM (a competing VM no less) to access the first, but at least I had access. That got me thinking as to whether I could coax the plugin to work somehow.

This morning, I had another crack at it. Looking in the Mozilla extensions, I noticed the following directory structure:
stuartl@beast ~/.mozilla/firefox/new7diw5.default/extensions/VMwareVMRC@vmware.com $ find . -maxdepth 2
.
./install.rdf
./plugins
./plugins/vmware-vmrc
./plugins/bin
./plugins/np-vmware-vmrc-2.5.0-122581.so
./plugins/vmware-vmrc-daemon
./plugins/xkeymap
./plugins/vmware-desktop-entry-creator
./plugins/lib
./plugins/open_source_licenses.txt
./plugins/share
./plugins/vmware-vmrc-legacy
./plugins/libconf
./install.js
./components
./components/xpcom-vmware-vmrc-2.5.0-122581.xpt

Ohh, a bin and lib directory? Interesting. I had a peek inside.

stuartl@beast ~/.mozilla/firefox/new7diw5.default/extensions/VMwareVMRC@vmware.com/plugins $ ls -l
total 904
drwxr-xr-x 2 stuartl stuartl 4096 Dec 15 17:17 bin/
drwxr-xr-x 61 stuartl stuartl 4096 Dec 16 07:25 lib/
drwxr-xr-x 4 stuartl stuartl 4096 Dec 15 17:17 libconf/
-rw-r--r-- 1 stuartl stuartl 684016 Oct 10 2008 np-vmware-vmrc-2.5.0-122581.so
-rw-r--r-- 1 stuartl stuartl 201997 Oct 10 2008 open_source_licenses.txt
drwxr-xr-x 4 stuartl stuartl 4096 Dec 15 17:17 share/
-rwxr-xr-x 1 stuartl stuartl 738 Oct 10 2008 vmware-desktop-entry-creator
-rwxr-xr-x 1 stuartl stuartl 738 Oct 10 2008 vmware-vmrc
-rwxr-xr-x 1 stuartl stuartl 738 Oct 10 2008 vmware-vmrc-daemon
-rwxr-xr-x 1 stuartl stuartl 738 Oct 10 2008 vmware-vmrc-legacy
drwxr-xr-x 2 stuartl stuartl 4096 Dec 15 17:17 xkeymap/

There were no executable bits set at the time however. They are AMD64 binaries however. So I chmodded and tried running vmware-vmrc. It failed due to some other permission errors, particularly lib/wrapper-gtk24.sh, needed execute bits set too. After fixing that, and some permissions on ~/.vmware which wound up being owned by root, I was looking at the VMWare Remote plugin … running stand-alone.

VMWare Remote Console plugin

VMWare Remote Console plugin, working stand-alone

This is about as close as I can get to a separate app. It took a bit of experimentation to get this to work, but in the Hostname field, you need to include the port number; so in my case it was localhost:8333. The rest is fairly self explanatory. I still can’t log in via the web interface, but at least now I can get in without a second VM.

Ohh, another rant, they forgot CTRL-ALT-DEL. Luckily, there’s this. Use the numeric keypad dot (also “del”), that seems to work here.

New toy

I picked up a few new toys recently.  I’ve been looking around for a small microcontroller based device to act as a combined remote face / DTMF generator for my FT897D.  The idea is that this device could interface with the FT897D via its CAT port, and allow me to adjust the frequency and mode, recalling the information from internal flash or an SD card.

The remote face would then be mounted on the front of the bicycle, and connect to the radio at the rear to allow easy bicycle mobile operation.  An extension of this would be control of a separate 2m radio, and a GPS to allow APRS from the bicycle.

The idea was to have the memory work like a relational database.  Rather than just recalling memory channels, and having a big long list, I could scroll through the repeaters by callsign, location (service area), or combined with GPS, proximity.  Modern flash technology would make this easily doable.

Likewise, for DTMF, rather than having to carry around a cheat sheet or remember IRLP node numbers, wouldn’t it be nice to just be able to scroll through a node list by country/region/callsign, select one, hit the “Call” button, put your callsign across and have it automatically dial the moment you raised the PTT?

I don’t have the ability to manufacture PCBs of the standard required for ICs such as most 32-bit microcontrollers.  SOIC is about as fine as I can muster, and prototyping services are expensive.  Thus I was looking for a stamp module or premade board.

Luminary Micro (now TI) make a few nice ones, and during my work at Laidley, I got to use the LM3S8962 Ethernet/CAN evaluation board.  One nice feature was that it had the JTAG built-in via a FTDI USB-serial chip.  However, the licensing for the board support package irks me — despite their code being useless on anything other than one of their chips, they still see it necessary to modify the BSD license adding a clause that prohibits its use on non-TI microcontrollers.  I had a crack at writing my own “free-software” Stellaris library, but haven’t gotten that far with it.

I happened to stumble on this board based around the STM32F103VET.  They were being sold on eBay for about $60 at the time, so I decided at that price I’d buy three.  ST’s driver library appears to be very liberal in its licensing (in fact they claim there is “no license”, I don’t know if this means “public domain”, or whether I treat it like BSD).

The LCD panel uses the Ilitek ILI9320 display controller with internal graphics RAM, and is capable of 18-bit colour.  The board also features a RTC backup battery, Texas Instruments TSC2046 touchscreen controller and on-board RS232 level converter.  The STM32 also functions as a USB peripheral, and can be programmed using the stm32loader bootloader script via RS232.

Interestingly, the LCD controller documentation states that no part of that documentation may be reproduced without written permission.  I’m not sure if writing an open-source driver classes as “reproducing” the documentation (as I’d be making documented #define statements in C).

The devices come with example source and have a pre-loaded µC-GUI demonstration on them.  So far I’ve managed to distill enough out of these sources to get working touchscreen, LCD and UART.  I’ll probably start looking at FreeRTOS next and seeing if I can get a workable device going.

STM32F103 board

STM32F103 board running a simple "Hello World" app

Hello world application for STM32

Hello world application for STM32

Guess now I had better start planning my application. 🙂

Gentoo/MIPS O32: New binutils == new builds

Well, binutils-2.21 has been released. Amongst the changes were some fixes for Loongson 2E and 2F systems, and a whole host of MIPS related commits.

I tried experimenting with one of the binutils CVS releases, and had good success building Qt and the KDE desktop on the Yeeloong. I still have issues with JavaScript in Konqueror, and some other apps are glitchy, but the desktop is usable on MIPS, and is reasonably responsive.

It is my plan to fire up the MIPS systems for a new round of stagebuilds for the O32 port of Gentoo/MIPS. These will hopefully include the latest binutils release, latest Perl and gcc.