Feeds:
Posts
Comments

Archive for the ‘english’ Category

Connecting QEMU/KVM virtual machines via serial port

If for some weird reason you need to connect two QEMU/KVM instances via a virtual null modem cable, here’s how to do it:

$ mkfifo null-cable-1.{in,out}
$ ln null-cable-1.in null-cable-2.out
$ ln null-cable-1.out null-cable-2.in
$ qemu -m 512 -nographic -serial pty -serial pipe:null-cable-1 -hda image1.qcow2
$ qemu -m 512 -nographic -serial pty -serial pipe:null-cable-2 -hda image2.qcow2

For each instance, you’ll be dropped into a monitor prompt:

char device redirected to /dev/pts/9
QEMU 0.12.1 monitor - type 'help' for more information
(qemu)

The machine is running already, but in the background. To access its console, open the pty mentioned in the output:

$ screen /dev/pts/9
Advertisements

Read Full Post »

Since version 2.6, you can tell Amarok to convert (transcode) every music track to MP3 when copying it to a given device.

There’s a bug, however which causes MP3 files converted from Ogg Vorbis to lose all metadata (artist, album, title etc). This is a showstopper for me.

This happens because Amarok needs to pass an option to ffmpeg to tell it to get the metadata from the first stream found in the Ogg file as opposed to the default of getting it from global metadata. Unfortunately as far as I can tell there’s no way to configure the ffmpeg command line used by Amarok. The solution then is to replace the ffmpeg binary in the path with a script that will do that, like this one:

#!/usr/bin/python
import os
import sys

AVCONV_FFMPEG = '/usr/bin/ffmpeg.distrib'
os.execv(AVCONV_FFMPEG, sys.argv + ['-map_metadata', '0:0,s0'])

In Debian or Ubuntu, you can divert the real ffmpeg binary and install the script above as /usr/bin/ffmpeg:

$ sudo dpkg-divert --add /usr/bin/ffmpeg
$ sudo cp /tmp/fake-ffmpeg.py /usr/bin/ffmpeg
$ sudo chmod +x /usr/bin/ffmpeg

There’s another bug where Amarok needlessly converts even MP3 files when copying them to the device.

Read Full Post »

Building a kernel for the Dreamplug still requires using a set of out-of-tree patches, since Dreamplug support is still being merged upstream. There are a few versions of these patches adapted for different kernel versions floating around. I have adapted them to apply to 3.4.x. You can get them from my github repository. Follow the README instructions to apply them and build the kernel. I included a kernel config file too.

The Dreamplug support patches that are being merged upstream use a device tree to tell the kernel about board-specific configuration that it needs to run on a given machine. The boot loader is supposed to hand that device tree binary to the kernel, or if your boot loader doesn’t support that (the u-boot version which comes pre-installed with the Dreamplug doesn’t) then you need to append a device tree binary to your kernel image after building it, or flash a new u-boot version.

To avoid all that fuss, the first patch in my series has a small hack that hard-codes the kernel to boot only on the Dreamplug, avoiding the need for a device tree. It also makes the kernel expect the GuruPlug machine id (which is what the factory Dreamplug u-boot advertises) instead of the Dreamplug machine id (which is what newer versions of u-boot advertise). It’s easy to drop this part of the patch if you updated your Dreamplug or made the factory u-boot use the new machine id (apparently you can do that, I didn’t try).

Read Full Post »

isn’t it a pity?

Isn’t it a pity
Now, isn’t it a shame
How we break each other’s hearts
And cause each other pain
How we take each other’s love
Without thinking anymore
Forgetting to give back
Isn’t it a pity

Some things take so long
But how do I explain
When not too many people
Can see we’re all the same
And because of all their tears
Their eyes can’t hope to see
The beauty that surrounds them
Isn’t it a pity

Isn’t it a pity
Isn’t is a shame
How we break each other’s hearts
And cause each other pain
How we take each other’s love
Without thinking anymore
Forgetting to give back
Isn’t it a pity

Forgetting to give back
Isn’t it a pity
Forgetting to give back
Now, isn’t it a pity

George Harrison

Read Full Post »

beware of darkness

Watch out now, take care
Beware of falling swingers
Dropping all around you
The pain that often mingles
In your fingertips
Beware of darkness

Watch out now, take care
Beware of the thoughts that linger
Winding up inside your head
The hopelessness around you
In the dead of night

Beware of sadness
It can hit you
It can hurt you
Make you sore and what is more
That is not what you are here for

Watch out now, take care
Beware of soft shoe shufflers
Dancing down the sidewalks
As each unconscious sufferer
Wanders aimlessly
Beware of maya

Watch out now, take care
Beware of greedy leaders
They take you where you should not go
While weeping atlas cedars
They just want to grow, grow and grow
Beware of darkness (beware of darkness)

George Harrison

Read Full Post »

king of pain

There’s a little black spot on the sun today
It’s the same old thing as yesterday
There’s a black hat caught in a high tree top
There’s a flag pole rag and the wind won’t stop

I have stood here before inside the pouring rain
With the world turning circles running round my brain
I guess I’m always hoping that you’ll end this reign
But it’s my destiny to be the king of pain

There’s a little black spot on the sun today
That’s my soul up there
It’s the same old thing as yesterday
That’s my soul up there
There’s a black hat caught in a high tree top
That’s my soul up there
There’s a flag pole rag and the wind wont stop
That’s my soul up there

I have stood here before inside the pouring rain
With the world turning circles running round my brain
I guess I’m always hoping that you’ll end this reign
But it’s my destiny to be the king of pain

There’s a fossil that’s trapped in a high cliff wall
That’s my soul up there
There’s a dead salmon frozen in a waterfall
That’s my soul up there
There’s a blue whale beached by a springtides ebb
That’s my soul up there
There’s a butterfly trapped in a spider’s web
That’s my soul up there

I have stood here before inside the pouring rain
With the world turning circles running round my brain
I guess I’m always hoping that you’ll end this reign
But it’s my destiny to be the king of pain

There’s a king on a throne with his eyes torn out
There’s a blind man looking for a shadow of doubt
There’s a rich man sleeping on a golden bed
There’s a skeleton choking on a crust of bread

King of pain

There’s a red fox thorn by a huntsman’s pack
That’s my soul up there
There’s a black winged gull with a broken back
That’s my soul up there
There’s a little black spot on the sun today
It’s the same old thing as yesterday

I have stood here before inside the pouring rain
With the world turning circles running round my brain
I guess I’m always hoping that you’ll end this reign
But it’s my destiny to be the king of pain

King of pain
King of pain
King of pain
I’ll always be king of pain
I’ll always be king of pain
I’ll always be king of pain…

Police

Read Full Post »

Ok, so this time I won’t talk about Python scripting support in GDB. I’m getting tired of it myself. 🙂 I’ll just comment that it’s amazing the number of problems people in IRC report with GDB that can be solved with the Python support that we’re adding to it. Sometimes they need stuff which is only on the branch, but sometimes even the few bits already in CVS HEAD are enough!

Er, I actually do have one more thing to say about the subject: GDB had one project accepted in the Google Summer of Code 2009. Oguz Kayral is the student working on it, and I am his mentor. He will add support for subscribing to inferior events (e.g., signals, process and thread stops, thread creation) from Python. One use case for which this is useful was given by an IRC user at the #gdb channel:

<LimCore> how to run gdb from command line, so that it will run ./foo.bin with arguments: foo bar baz and it will run it instantly without waiting for ‘r’; And if program segfaults then it will do ‘bt’ without waiting for the command. (and if program terminates normally then it will also just quit)

LimCore will be able to write a simple and short Python script using the events API to solve his problem.

Now, moving on to other items: my team has been asked to improve GDB support for the hardware debug facilities in embedded PowerPC processors (for more info about these facilities, see Chapter 10 of Book III-E of the Power ISA v2.06). I announced this work to the GDB mailing list back in early March, and got useful insight from Joel Brobecker.

Today I posted an update on where we are with this work. We have the following ready for both native GDB and gdbserver on Linux:

  • one additional hardware watchpoint (two in total),
  • four hardware breakpoints,
  • one ranged hardware watchpoint.

And we still have the following features ahead of us:

  • support for the two DVC (Data Value Compare) registers, which enable hardware-accelerated conditions for hardware watchpoints,
  • two ranged hardware breakpoints.

Last and least, I was thinking of posting monthly GDB updates on what happened in GDB in the previous month as I did back in February, but I got busy and didn’t get around to it. I still entertain the idea though, so if you think it’s worth it, I’d be glad to know.

Read Full Post »

Older Posts »