Compiling XEN Kernel on Ubuntu 9.04 32bit

I am compiling XEN Kernel on Ubuntu 9.04 32bit
GCC is 4.3.3 and some issues with new compiler’s optimization.

This is on-going memo… I have compiled the kernel but it seems not compatible with Ubuntu 9.04.
So, I switched the xen kernel version supported by debian team.




(1) undefined reference to `__udivdi3′
arch/x86/kernel/built-in.o: In function `timer_interrupt’:
/usr/src/linux- undefined reference to `__udivdi3′
make: *** [.tmp_vmlinux1] Error 1
root@ubunzzo:/usr/src/linux- vi /usr/src/linux-

My attempt after reading reference (2) was successful, I inserted the asm(“”:”+r”(delta)) to the timer_interrupt function at the while scope at line number around 500.

        /* System-wide jiffy work. */
        if (delta >= NS_PER_TICK) {
                do_div(delta, NS_PER_TICK);
                processed_system_time += delta * NS_PER_TICK;
                while (delta > HZ) {


                        delta -= HZ;

* This works because this asm fools gcc compiler not to use optimization.
I guess do_timer internally uses do_div macro?

I found the same kind of fix in linux kernel here

The AT&T assembly format still looks confusing…

3 Responses to “Compiling XEN Kernel on Ubuntu 9.04 32bit”

  1. tapas Says:

    Where do I need to edit this file as you are saying I am not clear on this part.

  2. tapas Says:

    Ok I got it

  3. Brittny Heidt Says:

    Hello, Nice publish. I desire everyone would pay such awareness of their organize just like you do. I came acros your blog on yahoo when you are evaluating a compartment. I’m sorry for my poor englisch, i’m throughout the netherlands. Best regards over the netherlands!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

%d bloggers like this: