Archive for August, 2006

New Hardware

After four years of the same old Athlon 1 GHz, I finally have some new hardware. It’s quite fun not to have to wait for anything to load. I’m not going to a big nerd and go on about the specs, however, I do want to write a bit about what works and what does not work with Linux, since it’s quite a different set-up than I’ve had previously.

RAID: my motherboard has on-board “fakeraid” which is poorly supported by the Linux kernel. I wanted RAID 1 (mirroring) and the current kernel (without crazy patches, which I hate doing) doesn’t do any redundancy checking when reading/writing from the RAID array, which basically makes the array useless. So I’m doing software RAID with Linux, which seems to be working well.

SMP kernel: I have a 64 bit dual core cpu. Installed linux-image-k7 worked great — it automatically is running with both cores, no configuring. Didn’t even require a special SMP kernel — it’s all one in. Very convenient.

(Why am I running a 32 bit kernel? Because, quite frankly, 64 bit sounds like a bit of a pain with drivers and the like. It’s just easier to stick with 32 bit for now.)

NVIDIA TwinView: I’m running binary NVidia drivers on my box, with two monitors — my existing ViewSonic widescreen and a regular 4:3 square Dell that I bought from a friend. TwinView is nice becaue I don’t have to worry about annoyances from some of the other lame ways of running dual-head with X. However, one of its major limitations is the inability to run a different DPI on each monitor. So far, I think it’s okay and my fonts aren’t screwy. But I’m kind of paranoid about it since the KDE login screen is quite badly distorted.

Google Earth: I can run Google Earth now, which seems incredibly cool. Except it doesn’t render correctly and I have no idea why.

Multimedia keys: It was surprisingly easy to set-up my multimedia keys on my Microsoft (gasp!) natural keyboard.

That is all for now.

Comments off

LSB gcc

I have spent a lot of time in the last few days arguing with the Linux Standards Base compiler, which is an altered version of GCC that links against LSB-standardised libraries and such. It should act exactly the same as regular GCC, at least in terms of functionality and command-line argument parsing.

The main issue I ran into was exporting symbols on a shared library that are being exported from a static library. What am I talking about? Well, if you speak gcc…

g++ -shared mylib.a mylib2.a -o mysuperlib.so

(Notice I’m using static libraries as filenames, not with the -l library option. It doesn’t make a difference which you use.)

So imagine mylib.a exports some symbols that I want my mysuperlib.so (shared library) to also export. By default, these symbols aren’t needed, so they won’t be exported. This is intended behaviour of the linker since it doesn’t have any knowledge that it should export the symbols, since the linker will only pull out symbols from the static library that it thinks it needs. This is why if you did the same above with object files, it will work as you would probably want. The linker knows you want to link against the entire object file when you link against one — but when you link against a library archive (a static, .a file), it only knows the parts it should “pull into” the linking by what you’re linking against.

The solution to this is to tell the linker to include the whole library (archive).

g++ -shared -Wl,--whole-archive,mylib.a -Wl,--no-whole-archive,mylib2.a -o mysuperlib.so

The -Wl switch passes instructions to the linker. We only want to include the entire library of mylib.a, not mylib2.a — which is why we use –no-whole-archive afterward.

The above code works great. As does the following variation:

g++ -shared -Wl,--whole-archive mylib.a -Wl,--no-whole-archive mylib2.a -o mysuperlib.so

Notice the space instead of the comma after the –whole-archive switch. g++ deals with this fine.

Would you believe lsbc++ (the LSB c++ compiler) does not work with the altered version? It’s true. There seems to be a difference in the way it parses command-line options, even though they are both based on the same code-base. Any guesses as to how long it took me to figure that out?

Comments off

The Flight of my Bike

It all started in June. I decided I would buy a bike and start cycling to work. Over a hill, and over a bridge, the trip takes only about 20 minutes — which is usually a little bit faster than taking transit. It’s good exercise, and cheaper than transit (bike not included).

Off I went to Sport Chek to buy the cheapest bike I could find.

$109 + tax later, I had a cheap bike.

Within a few weeks, my front tire came loose. Something in the axel went funny, and the wheel rotated on its axis ever so slightly. That’s not good. So I took it back and had them fix it. Warantee service #1. The friendly bike mechanic at the store gladly fixed it, but said that it would likely happen again because it’s a cheap bike, with cheap parts.

Granted, when you pay $100 for a bike, you don’t expect it to last for ever. Daily use was not what was intended for this bake, apparently. But that’s like saying that if you buy a cheap car and the transmission falls out four weeks later, it wasn’t intended for daily use.

So my cheap bike was nicknamed Adam, after Adam Sandler and my altered version of one of his dumb songs: Piece of Shit Bike.

Skip ahead about 6 weeks. I was riding home, just about to go over the Burrard Bridge, when my gears went all funny. My chain didn’t fall off (although that has happened countless times), but it went all funny, and I could no longer shift into 6th gear. I managed to climb over the bridge, and even up all the hills. But as soon as I got to the top, the gear sproket thingy on the rear tire came all loose. When I peddled, the chain turned through the sproket thingy, but the tire didn’t turn. Nice. Good thing I made it to the top of the hill first.

Warantee service #2.

Today, I took my bike back and had a chat with the same friendly bike mechanic. First, I asked for my money back. No dice. Then, I asked if there was anything else that could be done (trying to avoid having the bike serviced a second time in as many months). The manager became involved and offered me an exchange for another bike. I was able to talk him down a little bit lower on this bike.

Another $180 + tax later, and I now have a bigger and lighter frame, a better bike, and a larger bill. Or at least I will when I pick it up tomorrow after work.

So much for the flight of my cheap bike. Intending to spend under $200, I’ve now spent nearly $300. How did that happen?

Let’s hope the new, yet to be named, bike works out better.

Comments