Public Syndication

Gentoo/MIPS: New mipsel stages coming soon

qube ~ # catalyst -f /home/catalyst/configs/stage1.spec 
Catalyst, version 2.0.6.906
Copyright 2003-2008 Gentoo Foundation
Copyright 2008-2009 various authors
Distributed under the GNU General Public License version 2.1

Using default Catalyst configuration file, /etc/catalyst/catalyst.conf
Setting sharedir to config file value "/usr/lib/catalyst"
Setting snapshot_cache to config file value "/home/catalyst/snapshot_cache"
Setting hash_function to config file value "crc32"
Setting storedir to config file value "/home/catalyst"
Setting portdir to config file value "/usr/portage"
Setting distdir to config file value "/hd/0/gentoo/distfiles"
Setting options to config file value "autoresume kerncache metadata_overlay pkgcache seedcache snapcache"
Autoresuming support enabled.
Kernel cache support enabled.
Package cache support enabled.
Seed cache support enabled.
Snapshot cache support enabled.
Use of metadata_overlay module for portage enabled.
Envscript support enabled.

        WARNING: No value set for key cxxflags...deleting

        WARNING: No value set for key distcc_hosts...deleting

        WARNING: No value set for key pkgcache_path...deleting

        WARNING: No value set for key portage_overlay...deleting

        WARNING: No value set for key ldflags...deleting

        WARNING: No value set for key portage_confdir...deleting
Using target: stage1
Building natively for mips
stage1 root path is /tmp/stage1root
Source path set to /home/catalyst/builds/seeds/seed-20100806.tar.bz2
Caching snapshot to /home/catalyst/snapshot_cache/20100806/
The autoresume path is /home/catalyst/tmp/default/.autoresume-stage1-mipsel1-20100806/
stage1 stage path is /home/catalyst/tmp/default/stage1-mipsel1-20100806/tmp/stage1root
Resume point detected, skipping target path setup operation...
Location of the package cache is /home/catalyst/packages/default/stage1-mipsel1-20100806/
Location of the kerncache is /home/catalyst/kerncache/default/stage1-mipsel1-20100806/
Checking for processes running in chroot and killing them.
--- Running action sequence: unpack
Referenced SEEDCACHE does not appear to be a directory, trying to untar...
No Valid Resume point detected, cleaning up...
Removing AutoResume Points: ...
Emptying directory /home/catalyst/tmp/default/.autoresume-stage1-mipsel1-20100806/
Emptying directory /home/catalyst/tmp/default/stage1-mipsel1-20100806/

Starting tar extract from /home/catalyst/builds/seeds/seed-20100806.tar.bz2
to /home/catalyst/tmp/default/stage1-mipsel1-20100806/ (This may take some time) ...

And with that… a new round of stagebuilds begins… I’ll do the initial stage builds on the Qube2 for now, so things will take some time, but I want to iron out all the issues I’ve been having and get something together that builds smoothly. I may even run it through Catalyst a second time just to make sure everything is clean. These should also include the newer tools, such as baselayout-2 and eselect.

This seed stage was mostly cross-compiled on my now dead Duron. I now have a 6-core AMD Phenom II which I also plan to set up QEMU on, for stage-building purposes… and soon will get distcc going on a few of the hosts here… so hopefully I’ll have stagebuilds going much more regularly.

VK4MSL/BM: Photos of the current setup

Well, I’ve been riding a lot between West End and The Gap, and I get a lot of questions from people on the band about my setup. I was doing some repairs… one of the wires to the PTT had disconnected, luckily there was a 0V return via other connections… and so while I had the bike outside fixing that (it was too dark in the garage) I took the opportunity to snap some photos.

The light was fading at the time, so the pictures aren’t particularly great… I’ve touched them up to make them brighter, hence there’s a bit of noise in the photo… The last two showing the HF setup, required a flash (which I was trying to avoid due to the aluminum and reflectors)… and of course I didn’t spend time putting the FT-897D in the back… maybe later when I get everything tuned up and actually do make a true bicycle-mobile contact on HF (this one was not made mobile).

VK4MSL/BM on 2m

VK4MSL/BM on 2m: side view

Above, is the station in its entirety… fairly simple. The antenna is a plain 2m ground-plane, formed using a tunable mobile whip cut for 145.700MHz, the aluminum angle bracket makes up one counterpoise, and an additional counterpoise hangs out the back. Adjusting the angle has an influence on the SWR… in this arrangement, it works nicely.

VK4MSL/BM: Closeup of rear basket

VK4MSL/BM: Closeup of rear basket

Shown here is the rear basket where the FT-290R II (or FT-897D for HF) lurks… along with a 9Ah gel cell battery, which also powers the tail light. I haven’t been very neat about the cables. Two leads run from the front controls, the grey one (shielded) carries transmit/receive audio and the PTT, the blue one (Cat5e UTP) carries the four directional buttons — with spare wires connected to 0V. A DB15HD (“VGA”) connector terminates the cable at each end.

VK4MSL/BM: Radio controls

VK4MSL/BM: Radio controls

Remember how I mentioned the hand-mic in the last station was going to be temporary? Well… this is the arrangement here. Shown here is the PTT switch (red) and four directional buttons. Not all radios make use of all buttons … the FT-290R II uses only the up/down buttons, the FT-897D uses the right-hand button in addition for the “fast” button. Homebrew microcontroller-based radios I build will probably use all five shown for a menu interface. There’s no display in front of me, so don’t ask for an accurate signal report, I can tell you whether it’s a Q3 or a Q5, but any S-meter reading will be a wild guess. Future expansion of this may include a small potentiometer for a local volume control, and a small microcontroller-driven LCD that could be used to interface to the FT-897D’s CAT interface… but this is just early days.

Now… I did say I managed to mount a HF antenna on here and make a contact with it. The contact into VK5 that yielded this QSL card was made using a 6′ long CB whip… the station looked a lot like this:

VK4MSL/BM: HF Antenna

VK4MSL/BM: HF Antenna

The flash was needed here, took me a while to figure out where I had put the bracket (I don’t plan to ride with the HF antenna or bracket mounted very often). This is fortuitous in a way since you can now more visibly see the 2m antenna. The CB antenna mounts on a nearly identical bracket. I don’t bother with the radial out the back, as there’s no way I’ll make one long enough that would be practical. The antenna will need some work, in particular, either addition of a base-load coil, or modification, to make it resonant on the amateur bands.

VK4MSL/BM: Closeup of basket with HF mount

VK4MSL/BM: Closeup of basket with HF mount

With a small base-load coil, I should be able to make it a half-wave end-fed on 6m… some more and I should be able to make an end-fed quarter-wave on 10m. This will be the subject of future experiments. This tuning section will probably mount on top of the mounting itself, underneath the spring shown on the right.

And to answer the number one question I get from non-radio amateurs… no… I do not have a camera on my helmet (this is not a camera)… I am not broadcasting video. Kindly don’ t act like someone excited to be on television… you’re not. 😉

Gentoo/MIPS: Bootstrap of new stages

It has been a long time between drinks for Gentoo/MIPS… but at last, I’ve managed to get something rolling, and hopefully I should have some stages out by the end of the year.

What took me so long? A number of packages didn’t want to compile… particularly python-2.6 and gcc-4.4. The former exhibited various compiler errors… I think I’ve got that sussed now. The latter would compile xgcc, then that binary would promptly die with an Internal Compiler Error.

I couldn’t resolve the latter due to not having anything other than MIPS hardware at home for development. So when I managed to cobble together a Duron 900MHz, I was able to use that to cross-compile a minimal environment with a C-only gcc (it wouldn’t build without USE=nocxx) and supply a version of Python from my Yeeloong.

I now have the Qube2 busy running the bootstrap script, it has self-compiled its own python-2.6 now and is working through the other base-system packages. I found the Lemote boxes seemed to exhibit an odd lock-up at specific points of the build, but the Qube2 just keeps plodding along. Ahh well, they do say “slow and steady wins the race”.

Speaking of slow and steady, the Duron 900MHz decided to keel over this morning… so I’m not sure if I’ll be able to put together a similar environment to bootstrap the big-endian port, but we’ll see. There’s money in the budget for a new 6-core AMD Phenom II system in the near future though, so by the time I get Gentoo/MIPS little-endian up and running, I should have new hardware to tackle the big-endian port with.

On other news… it seems the next Linux.conf.au is going to be here in Brisbane… shock horror I might be able to attend this one. 😉

Open firmware

I was just reading back through the posts on Gentoo Universe… and Diego’s post regarding Free Software Washing Machines caught my eye.

There are many benefits for why free software firmware would be good… However, you’ve got to convince the marketeers and management of such companies that this is a good idea. This is not so simple. In extreme cases, you’ve also got to convince government… more on this later.

Take my current project at my workplace. We’re developing a new video intercom system. The devices are based on the Freescale i.MX27, and incorporate an 800×480 LCD, resistive touchscreen, USB port, ethernet (with PoE), mono internal speaker/microphone, handset interface and a small software-controlled relay. The audio interfaces are mono, but capable of sample rate up to 192kHz (limited to 96kHz by ALSA) and it wouldn’t be difficult to get stereo out of them. I wouldn’t mind buying one later on to play with at home … maybe one of the early ones with psychodelic colours (the first revisions didn’t have the LCD lines routed quite right) since we’ll want to sell the others. My role was with the audio CODEC, the TLV320AIC3204, some code for this is already on the ALSA-devel mailing list (the continued development of this driver is the mainly the reason why I want one for home).

They’re a fun little device to play with… and there may be some who might be interested in hacking such devices. They already run Linux… a few of them at my workplace run Gentoo even — mostly the test modules. However, the firmware for these, particularly at the higher levels will remain proprietary. I’ve released the CODEC driver as GPLed software … and ideally I’d like to see the rest of the kernel changes released openly. I’ll play this by ear first however. The good news is that if someone wanted to port Linux over from scratch, it’s real easy to get Linux booting on these things (tip: start with the Freescale MX27ADS support, I ported kernel 2.6.34 this way).

The CODEC driver I’m mostly happy with… the machine/fabric driver I use for ASoC on this thing however … let’s just say, it’s a hack. The CODEC’s clock is generated from a pin on the MCU, and so I have to use some rather “creative” methods to configure that clock and make it available to the CODEC. There’s no way it would be accepted into mainline… and we’ve since found that clock drifts the moment you look at the chip funny. Ahh well, live and learn.

There’s also a GPIO module that allows us to use the keypad controller (which is not routed via IOMUX AFAIK) as a GPIO chip… similarly, it was a monkey-see-monkey-do hack… but I might be able to make that more acceptable to upstream.

So there’s the issue that such code is considered a bit of an embarrasment to its author. (I don’t speak of other code on these things, just the parts I have written!)

Secondly, there’s the thorny issue of intellectual property. The firmware on these VoIP stations incorporate a proprietary protocol for VoIP. Why not go with SIP? Basically this protocol was designed to run on their earlier products… which were all based on small 8-bit microcontrollers. SIP was just too much for a ~40MHz 8-bit micro like the Rabbit 3000. Thus a simpler protocol was developed. I have no idea about the specifics, other than the fact that it was developed to suit the lower-end microcontrollers in use at the time. I think in future the newer units may wind up moving over to SIP, but for now, deadlines are on top of us, we’ll go with what we know works for now. Given how much of Jacques’ business relies on this protocol, I don’t see them opening it up to their competitors anytime soon.

Finally, there’s one of support. The modules we use were purchsed from Ka-Ro Electronics, and the kernel we use was supplied by them directly… based on kernel 2.6.28. To my knowledge, there’s no openly-available patches that allow a user to run the latest Linux kernels on the Ka-Ro modules — you more or less either have to forward port the patches that Ka-Ro provide, or try to hack up a patch of your own (this is what I did). Now, Ka-Ro clearly have their reasons for not openly releasing a patch for their hardware, I haven’t enquired as to why this is… I have a patch that gets their TX27 module working under kernel 2.6.34 (theoretically newer kernels too) but I’ll probably run it by Ka-Ro themselves before I release it.

Ka-Ro presumably will only provide support for the kernels and board-support packages that they provide, which is reasonable. They started with a known stable kernel, and started their development on that (it was a year old before they touched it), and released it knowing it would be reliable. Obviously they cannot provide the same guarantee to newer kernels… because they won’t necessarily know what might have changed — you could encounter severe bugs that were not their doing and thus, a lot of time and effort is spent trying to fix a problem that was not their doing. Similarly, at Jacques, we don’t have the resources to answer questions from inquisitive geeks wanting to turn the monitor station in their apartment into a music player or web server. At best, we’d be able to put some of it online, but we’d have to say “Sorry, can’t answer questions, you’ll just have to work it out yourself.”

In the Amateur Radio world… homebrewing, and home-modification of equipment is common. In fact, once upon a time, it was the only way to get on air unless you had a lot of money! Thankfully, one can now purchase a radio station for far less money than it would cost to design, build, and debug, and the build quality in general will be much higher. Of course if you do go the homebrew route, you’ll at least be wiser and richer for the experience.

The difficulty with homebrewing radios these days, is getting parts, and working with them. Back in the day, things were valves, and discrete components… maybe the odd DIP-packaged IC… and no more than double-layer PCBs. The two Yaesu FT-897Ds I have, incorporate multi-layer boards (4 I think) and SMD devices. One got cooked in a storm, frying the microphone preamp and a DDS chip (although the finals appear to be okay, and it makes a good shortwave receiver). The complexity of this radio made it impossible to repair, and so I had to buy a second one (or rather, insurance did). Now, I’m mostly very happy with this radio, but there are one or two niggles I have with regards to its interface… and a few features I’d like to implement.

Yaesu do provide a block diagram of their transceiver, but they don’t provide the code to the Hitachi H8300 microcontrollers that reside inside the unit… and there are several of them. Suppose I get the microphone circuitry fixed in the cooked one… I might be able to get FM functionality back. The DDS chip was responsible for the carrier sidetone generation with SSB, and for generating the carrier in AM and CW. It’s no longer manufactured… and the chances of a different chip being compatible with the existing firmware are next to zilch. I’ve still got it… I intend to build my own radio out of the bits that are left over (the Phoenix897 project) … it’ll be here that I’ll be able to explore the possibilities in terms of implemented features.

However, one challenge will be designing and producing PCBs that will be suitable for use with today’s devices. The construction methods of the past such as wire-wrap and dead-bug, work fine for discrete components, work okay for DIPs, SOICs, TSSOPs and QFPs… but I’m afraid you can forget it on a BGA or LCC. So you have to build a proper PCB, and the track work has to be very fine. Then there’s the actual fitting of components onto the board.

The boards I was building for the electric harvester project I was involved in at Laidley didn’t involve anything smaller than TSSOP ICs, or discrete SMD capacitors/resistors smaller than 0603 (most were 0805) … easily hand-soldered. At Jacques we’re dealing with components even smaller… they don’t get soldered by hand — instead they’re oven baked. It takes a few hours to lay out a board, and the slightest bump will scatter all those carefully placed components. The smaller components are not marked… with no means of identifying them, they get tossed. (And yes, I did accidentally bump some one Friday evening… not proud of that at all.) I can see me going through a lot of components because a PCB gets knocked for six.

So the modern components are much harder to work with. An ideal solution to my dillema would be a pre-built radio that I can customise the firmware on. Alas, the closest I’ll get to this, is SDR kits such as the Softrock… even they have to be supplied in “kit” form. FCC rules basically forbid manufacturers from producing off-the-shelf transceivers with customisable firmware… or at least that’s how I understand it. Not sure whether the EU works the same… and the ACMA’s EMC directives are more or less based on the FCC’s… so I suspect that’s the issue here.

More or less the worry is that you might hack the firmware to circumvent the bandplan restrictions that may exist in your area (i.e. modifying a transceiver to broadcast WFM on the 88-108MHz band for example). I’m not sure how this is different to homebrewing a set, or modifying a set yourself … but being able to just hack the firmware yourself is not something the various spectrum management organisations want us to do.

This is sad in a way… I think there would be a big market in having a radio that had completely opensource firmware.

One of my big niggles is that the transceiver I have won’t remember power limits by mode… I can do 100W PEP, but only 30W average, so for FM I find myself constantly winding the power back to 30W, but the moment I kick the radio into SSB, I’m winding back up to 100W. More than once I’ve accidentally called into a FM net on 2m using 50W because I had been using 2m SSB the previous night (my radio only does 50W on 2m)… or accidentally found myself transmitting 100W on a 10m FM repeater.

IRLP/Echolink functionality, and memory channel organisations are other improvements… remembering node numbers is a chore I could well do without… and I find there’s often not enough channels to cover all the repeaters in the country… or it’s difficult to organise them in a manner that allows quick retrieval. Modern storage, modern microcontrollers, I see no reason why this can’t be stuffed into a relational DB (something akin to SQLite) so that you just whistle up the repeater by location, callsign or frequency… and if it has IRLP or Echolink, be able to just choose a node, browsing by country/state or provence… put your callsign across then press a single button to dial it for you… then at the touch of a button, it dials “73” for you to close the link. (or maybe after a fixed period of inactivity, it can put your ident across, wait 10 seconds, then dial “73” for you).

My old TH-F7E could remember 10 DTMF code sequences and 400 channels, the memory channels just being sequentially accessed… so you really had to put careful thought into ordering or you were relying on cheat sheets to figure things out, in that case why even have the memory channels at all?

I’d also be nice if the set could do HF CB… I can receive it… I see no reason why the set can’t just automatically drop its power to the 12W and restrict its modes to USB/LSB and set the channel spacing accordingly as per the CBRS. I can make a radio with opensource firmware do that… then again, I could also make it do 100W on that same band, and violate the CBRS. One has to convince the government that we won’t try to do the latter (although there are plenty that already do).

All of the above I’ll probably look at implementing when I go and rebuild the old FT897D … and you can bet your bottom dollar I would have tackled some of them already had there been opensource firmware on these rigs. However, the red tape one would have to deal with in order to make such a radio available on the market, I can well understand why the firmware on these things is proprietary.

In a perfect world … if only such a utopia existed!

20m contact made on the bicycle mobile station

Well, I can’t call it a “bicycle mobile” contact per se… it was made using the bicycle mobile station however. This afternoon about 1:50PM UTC+10 I made contact with VK100WIA being operated by the South Coast Amateur Radio Club at a frequency of 14.188MHz USB.

The station was being powered by mains, and transmitting 100W (most of it probably rattling the tuner) on a 6′ long CB whip mounted on the back of the bicycle mobile station. The SWR without the tuner was very high, so I’m going to have to look at tuning this in a lot better than it currently is. I registered a S5 Q4 signal with the other station, who was a perfectly clear S8 Q5 copy at my end. I was also hearing New Zealand elsewhere on the band… very stong signal.

I will need to tune the antenna up quite a bit for it to work on 20m… I’m surprised it even worked at all! I tried a few other bands… 10m was dead quiet, couldn’t get any of the FM repeaters, no activity. 6m, I could trigger VK4RBX at Ipswich, but no one about it seems.

This is from my driveway at my home QTH … not in a high location. So a bit of peddling up the hill and I might get quite a distance with my rather limited antennas… but I’m going to see if I can tune the thing in a bit better. My observation of others’ is that one does better when the tuner is an integral part of the antenna, and this is what I’m going to have to do. If the tuner is going to have to do hard work, then let’s get it out into the open and helping the cause.

In the meantime, I’ll have to print a couple of QSL cards… I still need to send one to Mario OS8M from the Christmas evening contact I made on 20m… but it’s only just now that we’ve got a working printer again.

VK4MSL/BM Part 2: Upgrade of bike… upgrade of set… HF here I come

Well… just this afternoon, I made some steps towards getting HF going on the bicycle mobile station.

I’ve had the station going a while now… and with the new workplace being so close to home, I’m often heard on 2m, usually on three repeaters:

  • Bayside VK4RBS: 146.875MHz FM
  • Mt. Cotton VK4RAX: 147.075MHz FM
  • Mt. Glorious VK4RBN 147.000MHz FM

Usually, it’s VK4RBS in the centre of town unless there’s activity on VK4RAX.  VK4RAX as I get closer to home.  I’d listen to the latter all the way, but pagers clobber the receiver on the poor FT-290R II.  Hearing pagers is bad enough … try it through a headset!  Made worse by the fact that the headset is a semi-homebrew design, embedded inside a motorcycle helmet… so I can’t easily take it off.  Once I’m out of the city however, the pagers aren’t an issue.

Range is pretty good… I use a quarter-wave ground-plane antenna on 2m… actually, the antenna itself is the same as on my previous bicycle-mobile station… a tunable whip antenna.  The antenna is intended for mobile use on a car, so to give it a reasonable counterpoise, I cut a 500mm long piece of aluminium angle, and bolted the antenna mount to that.  I found that alone, wasn’t good enough, and since added a 500mm long piece of copper wire that hangs out the back.  That brings the SWR down nicely into the range where the FT-290R II is happy to work with it.

I have been able to open the squelch of the Toowoomba (VK4RDD) repeater, once waiting at lights at West Ashgrove, and another time, underneath the Goodwill Bridge at the Queensland Maritime Museum near South Bank in Brisbane.  I also can work the Ipswich repeater, VK4RAI while walking up the hill along Cooper’s Camp Road at Bardon… about a distance of 80km out to the repeater’s location (near Marburg).

This is using the FT-290RII with the 25W linear option, and the aforementioned antenna.

This afternoon, I figured out how to interface the electret microphone in the headset to the FT-897D.  The wiring standard I use for my headsets is a customised one… using DB15HD connectors (VGA-like).  A female DB15HD exists on the headset side, this is to prevent some goose trying to plug a headset into a VGA card on a computer.  The following is a rough schematic of a typical headset using this wiring scheme.

Typical headset wiring schematic... looking into female DB15HD connector.

There are three pins that are normally unused… On a couple of my interfaces, +5V and 0V are wired up… it was initally thought I’d use these for power rails … one supplied by the headset (one of my planned “headsets” was a former in-car hands-free kit for a Nokia 3310, and so you’d be able to charge the phone this way), the other supplied by the device (many radios supply a 3.3V or 5V rail).

For the FT-897D, the microphone used is normally the dynamic type… that is, uses a balanced (differential) audio feed.  On the FT-290R II, I tie Mic – to 0V, and just use it single-ended, which works fine… but a better way is to actually convert the single-ended microphone signal to differential.  How does one do this?  Well, the answer came out of the TI TLV320AIC3204 datasheet which I’ve been reading quite a bit lately.

TLV320AIC3204 Typical Circuit Configuration, showing microphone wiring (Source & Copyright: Texas Instruments)

Typical electret microphone configuration (Source: Wikipedia)

I noticed something odd about the way they wired up an electret microphone.  Rather than wiring it up as shown on the left… they instead mirror the positive side; feeding through a resistor to 0V, but tapping off via a series capacitor to the CODEC input (see right; click image to enlarge).  Why were they doing this I wondered?  Then I found it.  Inside the electret capsule is a J-FET which amplifies the weak signal from the microphone itself.  By hooking a resistor on both sides, and using two capacitors, they were creating a phase splitter.  I stumbled across that article on Wikipedia, and it was then I knew what they were doing.

So I’ve done the same thing here… Rather than a single-ended design, I have interfaced the electret microphone to the radio using the phase-splitter technique.  The schematic I use (with DB15HD pinouts) is below:

FT-897D Headset interface

I’m yet to take the whole shebang for a ride… I have a 6′ long CB (27MHz) whip that, last time I tried, tuned up nicely on 10m and 6m… might work somewhat down on 20m. I have had a VK2 station come roaring in at S7 when listening on 80m via this antenna on the back of my fold-up bicycle, but unsurprisingly it’s pretty deaf there… I plan to get a second antenna mount and suitable spring (so the antenna doesn’t get snapped by a low branch), make up a new bracket, and mount that some time in the coming weeks… then we shall see what the bands are like around Brisbane.

Getting back into Gentoo

Well, after a long hiatus that must have seemed like an eternity for some, I’m starting to dust off my old MIPS boxes and getting things back up and running again.

I’ve shifted positions, and now work at West End as a subcontractor for Jacques Electronics, and so instead of my journey starting from The Gap at 4:30AM to arrive at Laidley at 7:30AM, I jump on the bike and pedal 1.5 hours to West End. The work involves some embedded Linux development on Freescale i.MX27… and for some of my work, I’ve been using a cross-compiled Gentoo environment as a NFS-root, and on the device’s NAND flash.

This means I have a lot more time to do things. Amongst other things, this includes getting Gentoo stagebuilds back on track. One blocker to this progress has been issues compiling gcc 4.4. In short, I get an ICE (internal compiler error) whenever I try, and others have reported the same thing on their systems too. I couldn’t get around it using the compiler on the machines I have available, and my desktop computer was down with dead HDDs, so I couldn’t use that to cross-compile anything either. So the project was stuck at that point.

Fast forward to now… I had some money streaming in from the last project at Laidley. As far as I knew at the time, all that was wrong with my desktop was dead HDDs (it had 4 SCSI HDDs on an Adaptec controller). SATA had improved a great deal since I moved the machine to SCSI (at the time I was fed up with IDE drives dying), so I decided time to move to that. I also decided to upgrade my netbook computer, and my laptop. So about $350 got spent on 3 new HDDs (1 3.5″ 1TB SATA, 1 2.5″ 500GB SATA and 1 2.5″ 250GB IDE) and one PCI SATA controller (Silicon Image SiI3114-based).

The Yeeloong has an odd quirk with the new 500GB HDD I put in it, but luckily, easy enough to work around — in short the PROM doesn’t see the HDD, so I boot grub2-yeeloong off a USB flash drive, and that loads the kernel. Once the kernel is loaded, the system runs fine off the internal HDD, so it’s a minor inconvenience… and could be seen like an “ignition” key required to start the computer.

My other laptop, a P4M 2GHz took to its new HDD no problems, expanding the disk from 40GB to 250GB, the biggest I could get. My desktop however, it turned out there was more dramas to be had. The motherboard (an ASUS CUV4X-D) appears to have developed other faults, and now the machine is unworkable. Scratching around, I managed to scrounge an old Duron 900MHz CPU and motherboard, with 512MB DDR RAM… so into the case that went, along with the new PCI SATA controller and the HDD. Had all sorts of fun and games getting Windows 2000 to install onto the HDD, getting the machine to boot from the HDD, and other issues.

The booting issue was solved when I used the RAID utilities (from a Win2k install on an IDE HDD) to update the firmware. I put together a Windows 2000 Pro CD with SP4 and the RAID drivers and since then, the machine has been happily dual-booting Gentoo and Windows 2000. I also had FreeBSD on there too, but I’ve taken that off for now, might put it back later. The only issue I have is with the video card (which was from the now dead desktop), a HIS Radeon 9200SE. It works fine in 2D only, no 3D acceleration on Linux, and no acceleration at all on Win2K… I did have acceleration going there, so not sure what happened… but 2D is enough for what I do anyway.

As I type this I have successfully built a toolchain for mipsel-unknown-linux-gnu. I have a mips-unknown-linux-gnu toolchain being built, and currently I am cross-compiling (canadian-cross) a version of gcc-4.4.4 for mipsel-unknown-linux-gnu which I intend to install on my Yeeloong to get me past this blocker. I’ll do the same for mips-unknown-linux-gnu once that is done.

With new o32 stages on their way, I can then take another look at n32, and possibly n64 in the more distant future. None of the SGI machines boot properly at present, although 3 out of the 4 turn on, so that’s a start. The fourth (my Octane) I’ll have to have a closer look at, but last time I tried turning it on several months ago, it was dead as a door nail.

I don’t see myself getting on IRC anytime soon… I’m not about when most people are available to talk to me, and for non-realtime discussion, email is a more efficient medium, so I might as well stick to that. At least I have some systems back online however, and some development work will resume once I figure out what the present status is. And next financial year, I think a new desktop computer is in order. 😉

Nailing two annoyances of Win32 gVim

Only just figured this out today… largely because one I didn’t notice until this afternoon, the other has bugged me for quite a while, but I didn’t notice the fix until this afternoon while fixing the first.

Both relate to the default configuration of gVim.

Annoyance 1: UTF-8 Encoding

On my system it defaulted to Latin1 encoding of text files.  Earlier I had written a file in UTF-8 on my netbook, transferred it to my laptop at work to continue editing… only to discover that some UTF-8 chars had been altered.

The fix

As per the suggestions here, stick the following two lines into your $VIM_DIR\_vimrc file (by default; $VIM_DIR = C:\Program Files\Vim):

set fileencoding=utf8
set fileencodings=ucs-bom,utf8,prc

Annoyance 2: Win32 gVim visual mode doesn’t behave like Unix gVim visual mode.

While you’re in the _vimrc file, have a look up the top, you’ll see behave mswin.

The fix

Change this to behave xterm.

… Now if only I could change the crappy keybindings Microsoft assigned to be more like my KDE desktop… *sigh*

ARM EABI Development on Linux

Hi all, this is mostly in response to steev’s query in my last post… been meaning to post this up for a while now.

CodeSourcery have done some excellent work maintaining the GNU toolchain for the ARM EABI target, among others. They make their money selling and supporting precompiled versions for Win32/i386 and Linux/i386, and do publish their sources for others to download.

That said, it is not easy to reproduce the toolchain using the supplied build script. I think the idea is one is meant to purchase a prebuilt toolchain, which certainly has its advantages… and one should consider doing so anyway even if they get a homebrew one to work — just as a thank-you for providing the patched sources (I would if I could)… but there are numerous reasons why the prebuilt toolchains may not be ideal. In my case, it happens to be that my host platform is Gentoo/MIPS running on my Yeeloong … I can run i386 code thanks to Bochs… very slowly. (I also plan to do bare-iron i386 coding on the same machine… and yes, I’ve installed a hand-built toolchain for that too.) Native code however is far more favourable.

Disclaimer: The methods and code presented here are in no way supported by myself, CodeSourcery, or Gentoo. Some assistance may be sought on the CodeSourcery GNU-ARM mailing list, but in essence there’s no warranty given whatsoever.

Okay, with that over with… the first thing to do is download CodeSourcery’s sources. Head over to the G++ Lite download page and select the latest release… then look for the source tarball. It’ll be big, in the order of 120MB.

Unpack this in a directory of your choice that’s got plenty of space. The sources are packaged Russian-doll style, that is compressed tarballs within an arm-RELEASE-arm-none-eabi directory. In my case, I used release 2009q3-68.

Now, in there is a build script… Have a squiz at that, as there may be changes needed. I’ve tried to distill these into a Makefile which I have attached here. Decompress it then drop it in the source build directory created when you unpacked the CodeSourcery source tarball.

Give it a quick check over, comparing it against the build script to ensure things haven’t changed too drastically… if parameters have changed in the build script, you’ll need to change them in the Makefile. In addition, the TARGET will need to match your desired toolchain target (I used arm-stellaris-eabi) and CS_VER, the version of CodeSourcery downloaded. Some of the embedded packages may have changed version numbers too — these may need tweaking.

When happy, run make. It should go ahead and build you a toolchain. It’ll get installed to whereever your PREFIX was set to.

Other tools of the trade:

The above gives you a working toolchain for compiling, and a command line debugger (gdb). Two additional tools that I find useful:

  • OpenOCD which is available in Gentoo as dev-util/openocd… will let you program and debug your application via JTAG.
  • Insight debugger… a frontend to gdb. The Gentoo ebuild is out of date, and it’s a pain to write an ebuild for, as evidently the Insight team have never heard of DESTDIR. (How do they write their RPM specs?)

The latter is pretty straightforward to do by hand… just remember to use the same target as your toolchain. Versions prior to 6.8-1 will fail to run on modern X.