Jump to content
43oh

your thoughts, building your own kernel


Recommended Posts

Recently I have been on a mission to install, optimize, and customize my own kernel for ubuntu11.10. also maybe find a fix for the TI usb drivers. does any one else customize there kernel and why? or why do you use just the stock one?

 

I'm just curious, because I haven't found to many people that like to make there distro there own.

Link to post
Share on other sites

Linux user since 1998 here. I always used to compile my own kernel out of necessity. However, with loadable device drivers it really isn't necessary any more. Unless you are trying to get some oddball hardware working or you are tuning some specific application it's best to just go with the stock kernel.

 

However, if you want to compile a kernel just to see how its done, there is nothing at all wrong with that! In fact, I'm a firm believer in going whole hog and building an entire Linux system from scratch: http://www.linuxfromscratch.org/ Not that you would want to use said machine, but it is a *great* way to see how Unix systems really work.

Link to post
Share on other sites

It's a good experience to understand some of the kernel components.

 

I've been a Linux user for about 15 years. I used Slackware for more than a decade and often rebuilt my kernel as new version were released and hardware and features were added. I also was involved in building a desktop environment from scratch for many years.

 

Nowadays, it's not so necessary. I've been spoiled with Ubuntu's ease of use, and there are a number of factors that have changed that have taken away most of my time to geek-out on Linux and other hobbies. I find that stock Ubuntu works well for most of what I want it to do. And I just do a clean install about once per year when new versions are released.

 

That said, if you want to build a new kernel, keep an escape plan. Make sure that you can boot your old kernel or a failsafe if the new kernel fails. It will seem daunting the first time you do it, but later it will seem like second nature. You might want to use your distribution's stock kernel configuration file as a reference. Then use the menu configurator to modify from there. That is, assuming the process is still the same. I haven't done it for a few years now.

 

Regarding the TI USB drivers. I've read a few things here about people having problems. I am assuming that you are referring to the terminal issues when using it to communicate to the device over a TTY, rather than just simply programming it with mspdebug. I was under the impression that it's more of a problem with the Launchpad than Linux, but maybe I am wrong. I haven't investigated it.

Link to post
Share on other sites

I built an LFS system about a 3 years ago and it was a long but interesting build and I am planning on doing again soon possibly as a vm. Its a great way to learn linux.

 

As for the stock kernel, I have always disliked them since they usually just build them to run on anything, and leave out some options for specific proccesors. Also I like certain features built in and not some module to load (e.g serial, ata, console, usb...etc.) . another thing I noticed was there is a lot of laptop options that I will never need. I have a desktop that needs a workhorse kernel and not these power sipping ponys. lol

 

I have always been in the mind set of making linux mine, since I started using linux in ~03ish.

Link to post
Share on other sites

the escape plan is a must have, and I had to use it a few times since.nvidia drivers can be a pain. the procces is even easier then before since the make install now copies and create the vmlinuz intrid and sysmap and then copies.them to /boot and updates grub. it so easy now anyone can do it lol the hard part is still the cofiguration

 

as for the driver issue I an talking about it it flaking out when nothing is listening to it. It can be a pain if you have a data logging program loaded on it, you plug it in and it starts sending data and the driver stops (not sure if it stops.or freezes) then you have to reset it or unplug it.

I know a few work arounds like removing the jumpers or dont send data till a special character is recieved.

 

it is really tough to say if its the launchpad firmware or just kludging together a working TI driver. with more research I hope to figure it out and submit a patch or bug report to make it better and more stable at least in my eyes.

Link to post
Share on other sites

This is a must for learning the core of an operating system, and I used to think that customizing one is crucial in optimization in terms of performance. But now I am not so sure this is still true nowadays because processor power keep going up, and OS design and practice in software engineering might have improved to a point where the performance improvement for a custom build (like specific compile switch, removal of superflous drivers etc) over a general purpose one is less significant.

 

But apart from learning, there is also cases where building custom kernel is very important, for example system requiring high level of security.

Link to post
Share on other sites

pine you are right that it is less significant to build a custom kernel or optimized for a general.purpose systems. modular kernels make monolithic kernels a thing of the past, but they still have there place in servers and scientific systems.

Also when security in mind a.custom build is a must have but you also have to consider embedded systems need highly optimized kernel due to memory contraints and special architectures. I think this skill could be very useful going into arm/linux development. Options like gpio i2c spi 1 wire or nand and memory interfaces are essential for embedded systems but not always enabled in a general purpose build.

Link to post
Share on other sites
I think this skill could be very useful going into arm/linux development. Options like gpio i2c spi 1 wire or nand and memory interfaces are essential for embedded systems but not always enabled in a general purpose build.

 

I haven't looked but I'm guessing access to gpio, i2c, spi, and 1 wire are probably all loadable modules.

 

I started with linux when you downloaded 19 floppy disks. The only way to add devices was to recompile the kernel. When my computer only had 32Mb of memory getting rid of the extra fluff was essential. However, todays fast computers and the modular kernel make most of that unneccessary. I think what you want to do is to be able to rebuild the cdc-acm.c module. I think others have already offered patches to deal with the buffer overflow problem, although at the moment I can't put my finger on those patches.

 

This link explains how to build a module without doing a full kernel rebuild:

 

http://www.cyberciti.biz/tips/build-linux-kernel-module-against-installed-kernel-source-tree.html

 

This link talks about the problems with cdc-acm driver and a possible fix:

 

http://e2e.ti.com/support/low_power_rf/f/156/p/53610/580354.aspx#580354

 

And finally you can abandon all hope of it working and just use the libusb code to talk to it. It is part of the test suite of msp430-gcc in the test directory. Peter has posted info about it here before.

 

-rick

Link to post
Share on other sites

I may have to try that fix in the cdc_acm file since I dont see any changes in the 3.4.2 kernel release. Also I will look into libusb too. thanks Rick for the info.

those are loadable modules but my goal is for a monolithic kernel, with no fluff, and make math intensive procceses faster also there are some server options I want enabled because I occasionally use my pc for server applications. I do have my goals in mind and I wouldn't be recompiling if I didnt think I could make it faster and better on my system.

Link to post
Share on other sites

Building custom kernels is part of my job... ;)

 

When you are building embedded hardware running Linux, a custom kernel is essential, because you will never find one that has all the right drivers enabled. Some of the drivers you need are most likely not even in the mainline kernel, you have to extract them from somewhere else or write them from scratch.

 

However, when it comes to my desktop, I prefer standard distro kernels. I'm still running Ubuntu 10.04 LTS (the LTS part was crucial for my decision to use this distro) and have never touched the kernel. But then again I only run it inside VirtualBox and do the actual development on Windows, but you can't host and compile the kernel sources on a Windows system...

 

Cheers

TomKraut

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...