Thursday, October 25, 2007

UML on linux 2.4 kernel

Finally i was able to compile a 2.4 uml kernel on a 2.4 machine ( but it wasnt as easy as it sounds ). Picking up the right kernel version was a tough nut to crack . I had no earlier info on right gcc/kernel combination plays an important role while compling the kernel. Older gcc for older kernels would work fine but fail on newer kernels and vice versa. I always thought gcc was backward compatible , the code that compiled on older version of gcc wud still work on newer gcc.

I was on gcc 3.3 trying to build a 2.4.17 kernel with uml-patch-2.4.17.x which would compile fine but would fail eventually when trying to link the linux binary. After lot of trying, testing and reading at forums i finally landed on 2.4.24 kernel with uml-patch-2.4.24.1 which seemed to be the right combination and would complile flawlessly on gcc 3.3 , glibc-2.3.2-95.50 , binutils-2.14.90.0.4-42 i had on my CentOS 3 box . But If you really want to build an older kernel like 2.4.17 make sure your using gcc 2.9 or something older , i learnt that the hard way.

So everything worked well at the end , even the CentOS apm problem i was facing got resolved after tweaking a few things in the bios.