Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: 4-stroke on November 29, 2009, 12:32:38 PM

Title: Compiling the kernel
Post by: 4-stroke on November 29, 2009, 12:32:38 PM
I messed around a bit with Slackware recently and managed to compile my own kernel optimized for my processor and with low latency.

If I recompile the tc kernel with these features, can i still use the stock module extensions or do I have to make my own?
Title: Re: Compiling the kernel
Post by: Juanito on November 29, 2009, 01:43:43 PM
As long as you mostly followed the tc .config, it should work.

The extensions are compiled with "-march=i486 -mtune=i686" so they are probably not optimised for your processor, but I'm not sure if this will make a noticeable difference or not.
Title: Re: Compiling the kernel
Post by: Iguleder on December 01, 2009, 12:47:31 AM
Basically, each kernel has its own modules.

If you recompile the same kernel version as TC's (2.6.29), the modules are alright, you can keep them. However, if you change it with a newer/older kernel, make sure to remaster TC with the right modules, because the extensions won't work with a different kernel.

By the way, if you replace the kernel, you may face other problems, because the toolchain (the C library, specifically) is compiled against the kernel headers, and may be incompatible with the newer kernel. It depends on the way TC is built ... in my distro I compiled the C library for the latest (2.6.31.6) kernel headers without support for older kernels. If TC is built this way, you shouldn't replace the kernel, the maximum you can do is replacing the 2.6.29.x TC has with the latest 2.6.29.x release (each 2.6.Y has its own headers).

My suggestion: stick with defaults. TC does not stand for "Turbo Charged|, TC is not meant to be super-optimized or something ... that's why it's i486 with i686 optimizations and not just i686. If you really want TC to be like that, you can rebuild it with your own, manually compiled binaries.
Title: Re: Compiling the kernel
Post by: Juanito on December 01, 2009, 01:03:12 AM
glibc-2.9 in tinycore-2.x was compiled against the 2.6.29.1 kernel headers and with "--enable-kernel=2.6.16"
Title: Re: Compiling the kernel
Post by: 4-stroke on December 01, 2009, 02:05:51 AM
I was planning on messing with the stock kernel.

I'm aware that changing versions also means replacing the modules but I wasn't sure about how much one can change the default kernel before things get messy.

The reason I want to do it is really only to be able to say "I've done it..."  ;D

Edit: I've done it. Didn't work. Modules refused to load.  8)


Title: Re: Compiling the kernel
Post by: curaga on December 04, 2009, 03:00:16 PM
- don't change the name
- don't touch the module options (for example "forced module unloading")
- don't make the kernel uniprocessor (turn off SMP)

Check the enabled flags of any module with modinfo. The cpu optimization might be one of them.
Title: Re: Compiling the kernel
Post by: 4-stroke on December 04, 2009, 10:31:02 PM
The second time I tried it I made sure to only change the processor type and nothing else.

The funny thing is that the powernow-k8 module is optimized for a 486.  ::)