Archive for the 'Life' Category

Mounting RAW virtual machine images

Friday, June 18th, 2010

So you got some virtual machines for the your development, tests. Need to extract some files, do a backup, without messing with the other messy OS?

For one thing there is some qemu fuse code patch (or so), floating around. However, the simple, robust and straight forward way is to simply loop-back mount the partition on a RAW file at the given offset. You can determine the offset with your favorite partition editor, or disktype. Once you know the sector offset you simply multiply it with 512 (usual sector size) as the offset like so:

mount -o loop,offset=$((123456* 512)) img.raw /mnt/tmp

Update: and for qcow et al images:

odprobe nbd
qemu-nbd -c /dev/nbd0 image.img
mount /dev/nbd0p2 /mnt

qemu-nbd –disconnect /dev/nbd0

LLVM family is growing, adds debugger!

Wednesday, June 9th, 2010

The team around Chris Lattner appears to be spinning at a pretty remarkable high pace, they just added a debugger to their growing family of LLVM sub-projects. Wow!

x86 64bit performance increase

Tuesday, June 8th, 2010

Normally the performance gain going from 32bit (i386, aka i686 etc.) code to 64bit amd64 (aka x86-64, EM64T, or the likely to mismatch x64, …) is not soo huge. However, unlike classic RISC CPUs -which usually loose performance when comparing their 32 and 64-bit- code due to bigger instructions and thus data bus saturation. For amd64 AMD did a great job defining the ISA (Instruction Set Architecture) in a way that 32 and 64bit operations can be freely mixed. Thus normal programs that do not benefit from 64bit operations remain compact, while single instruction can freely utilize 64bit by adding a REX prefix (similar to the 0×66 prefix introduced with the 386). So normally data moving loops benefit from going 64bit, e.g. multi media codecs, encryption and such.

Doing some performance analysis on a new AMD board I spotted an rather extreme case: openssl’s RSA 2048 bit encryption shows an over 300% boost while going 64bit:

From:

rsa 2048 bits 0.007128s 0.000212s 140.3 4722.2

To:

rsa 2048 bits 0.002380s 0.000068s 420.1 14716.7

Yes, that the same machine (AMD Phenom II), exactly same software stack and such, a whooping 312% increase!!!

Better read the small print of an PC BIOS update!

Monday, June 7th, 2010

So we got some new PC server mainboard, and the latest greatest AMD Phenom II X6 CPU. Of course the BIOS would not recognized the CPU, just list an “unknown” CPU, and let it run at a bare 800MHz. Apparently no real OS wanted to boot in protected mode either. So I thought it’d be a good idea to update the BIOS to the latest, greatest. However, turned out that wasn’t so much of an good idea: after the update the board would not boot up anymore. No sign of the BIOS at all, …

The board vendor, however, was so nice to handle our support inquiry nicely and sent out a new 8-pin, serial EEPROM last Friday, and it even arrived the following day, that is Saturday!

So with the new EPROM in the board it actually booted again (puh!), and re-reading the BIOS Release Notes I found that it indicates running the DOS flash EXE with some special arguments, that I obviously did not include when I just run it intuitively the fist time:

PFUDOS.EXE FILENAME /p /b /c

How nice. If I would author some BIOS flash utility, I would rather write it in a way that a run with default, that is without fancy parameters would produce a reasonable, good outcome, …

Anyway, another note: After booting I removed the second, new, good ROM and injected the old, bad flash, and then used above run with fancy parameters to flash it again, and voila: I finally had an BIOS ROM with the latest version that worked :-)!

And yet another note: Flashing from an bootable USB stick with FreeDOS worked just fine.

AMD Netbooks, finally, but …

Sunday, June 6th, 2010

Sooo, with the latest AMD V105, Nile platform come the AMD Netbooks. 64bit, and such, nice, finally! If, well, if the manufactures would just learn that 1024×600 (or even worse x560) doesn’t really cut it, anymore. Never did. Heck, even the iPad got more pixels real estate! Without Intel’s silly Atom screen resolution restriction at least 1024×768 should be in order (while even that is so last millennium). There is so much screen bezel to cut down.

Personally, though, I find the Nokia Booket’s 1280×720 pretty usable abroad. Wouldn’t want to miss a single pixel of it. It’s Just it’s (Intel Z-series Atom) CPU could be a little more performant, …

The first SpaceX Falcon 9 Rocket Flight

Sunday, June 6th, 2010

The problem of the Apple’s fancy UI frontends

Friday, June 4th, 2010

Is that they apparently are often only not so well integrated facades, with poor error handling. When they work, they are nice and pretty, but woe some system-call returns an error, or backend program quits unexpectedly. Then those shiny facades become annoying, hard to control monsters. Two cases in point:

As I write this I’m trying to sync my father’s in law iBook files to a brand new MacBook. Thanks to the dismiss of Firewire I may do so by the means of the Migration Assistant via Ethernet. So far so good. Until you hit the “an system call returns an error” condition: Turned out the assistant just did not want to run thru yesterday. Hanging at 99%, 1 minute remaining the whole afternoon. One could not even cancel or quit it (the “woe something goes wrong and your are lost” condition). I’d thought I give it a second run over the night, maybe it completes. Of course it didn’t, … The iBook system log revealed, i/o error, certainly some sectors gone bad. How nice. It certainly could have skipped some unreadable files. As resolution I unpacked my Unix skills and rsync‘ed the whole user’s home directory to our office file server. Turned out it where just 2 files (images in the photo library) rsync spotted with i/o errors and skipped over gracefully, warned about at the end. Actually rsync was coded with some extra intelligence, to re-try files with errors a second time at the end! Btw, from the system log it looked that the Migration Assitent uses Racoon/IPsec internally to encrypt the transfer internally, over the air or on the wire. I somehow get the feeling the errors handling in Apple’s assistant is not so well tested after all.

Which brings me to the second example. Actually also a bad hard disk: My brother recently got a brand new Mac mini. He unpacked it and wanted to apply his Time Machine backup from the sold MacBook (Pro I think). He tried all, again and again, but it just did not want to run thru. So without his files restored he started to work on the machine, which inhabited a pretty odd behavior, even I had not seen before: every now and then, like every few minutes, or just once an hour the whole machine would lock solid, with just the colorful mouse cursor ball spinning around, no audio playback, nothing, for a could of minutes. And then, suddenly, as if nothing happened, it would continue to operate normally. My brother was already totally perplex and mad on the just new Mac mini when I came over the other day (it’s 300km, IIRC it was around CeBIT 2010). I’d also not know what to make of it. Running too hot? Noisy PCB wires resulting in stray, random memory content? Though the later would shure rather result in kernel panics. Anyway, my first loved click on the Console to browse the famous system log an there it was: i/o errors every now and then, … (on a just onboxed Mac mini!). The world’s most advanced operating system, that just got even better really could have pop’ed up some nice information dialog, or put some yellow exclamation mark on the hard disk icon, or the top menu, whatever, ….

Somehow I see a repeating pattern here: disk quality issues paired with notorious bad habit not to check for, and handle system call error conditions gracefully.

Damnit, Zensursula goes for President

Thursday, June 3rd, 2010

As if we had not enough problems already, censorship maid Ursula von der Leyen talked to potentially become President of Germany, oh my! To improve her bad reputation in educated circles she now might even spent millions to improve her image. Hello? We should get a president that does not need millions for PR improvements!! And certainly could do better with some millions worth of EUR!!! Like saving starving kids in Africa, or the EUR itself!!!! (OK, wait, we already spent billions on that, …)

Anyway, year after year I get the impression those with a little brain get a decent job, the others either get unemployment benefit 2.0 or become politician :-(

Mac OS X Dashboard Web Clips

Wednesday, June 2nd, 2010

What the heck? How can it possibly be that broken???

For some time now I excessively used Mac OS X (Safari) Dashboard Web Clips, for most part to blend in various server loads. While in theory a nice thing: this stuff just does not work quite right!!! On one day or another (usually after the Mac slept the night) some stupid Web Clips just won’t refresh anymore, showing old, previous day content. While so far I usually just have removed and re-added it in this case, today I thought I’d rather reboot in the hope it would refresh and appear right. Wrong! Now all Web Clips in a row show a totally different spot of the statistics site from what I previously set it up to show?!?!

@Steve Jobs Instead of bashing Flash all day for being broken (which in contrast to OS X itself didn’t really ever crash on me under OS X) could your Apple developer please get some basic fancy UI stuff going right???

Previously the Web Clips covered about the area marked in red, and as I mentioned showed a totally different spot of the underlying website, …

Oh, and while at it, some snap to grid would also be awesome! That way the dashboard would not look as cluttered, though, well, maybe that is how Steve’s desk looks like, …

Computex 2010: VIA Nano Dual Core is coming

Wednesday, June 2nd, 2010

Finally. So it’s only about 1½ years until we “might” actually get our hands on them, …