Tweaking linux kernel


问题 (Question)

I am new to linux programming & interested to tweak linux kernel(though I am not sure, what to tweak, I am planning to write drivers for particular device). To learn internal of kernel, I have started from historic kernel release (first release).

My problem is, how to test whatever changes I am doing for development, without disturbing my current os environment.(ubuntu 12, 64 bit). Is there any way like virtual box, sandbox?

Along with these, if anybody send some good approaches to learn these things, I would be really greatful.

Thank You.

我是新来的Linux Linux内核编程感兴趣的调整(尽管我不确定,什么办法,我计划写为特定的设备驱动程序)。学习的内部核心,我从历史的内核版本开始(第一版)。

我的问题是,如何测试的任何改变,我在发展,而不干扰我的当前操作系统的环境。(Ubuntu 12,64位)。有没有办法像虚拟盒,沙盒?



最佳答案 (Best Answer)

If you're new to linux programming then you really don't want to be tweaking the kernel. You really want to be an advanced programmer capable of programming drivers and complex software first.

But yes there is, you can can create a virtual machine using openbox or vmware. If you're really keen on tweaking the kernel you probably want to first just try compiling and configuring the kernel and seeing if that works.

Also make sure you're well acquainted with how the kernel works and advanced OS designs in general.




答案 (Answer) 2

Search in google fr "Kernel configuration" you u will get many links how to configure your own kernel. And one more thing do not use a outdated version of kernel ,always use latest stable release , because a lot of code and API is changed in new versions and no book in market is updated so ,, u have to read from kernel documentation. Thats the best way to learn the most updated information about linux kernel


答案 (Answer) 3

Yes, you can test your changes on any of the commonly available virtual machines (VMs); that way, whatever changes you make to the VM kernel won't affect native OS.

Personally, I prefer using CentOS 64 bit on VMWare Player. With this setup, I got away with minimal system maintenance while was able to focus on the actual job at hand. Once the VM is up & running, you can download and compile one of the latest stable releases from Instructions on compiling your downloaded version of kernel could be found here and here; however, this may require little tweaking based on your actual setup. Once the VM is running on your desired version of kernel, using a combination of cscope and ctags will help you immensely in kernel code browsing.

Finally, if you want to become a serious kernel programmer and write your own device drivers, you need to get familiar with it in the first place. Below are a few excellent references -

Going through these books is a tedious job and chances are that you may hit the roadblock from time to time. kernelnewbies mailing list and StackOverflow are some of the few reliable places where people would be happy to answer to your queries.

Good luck!


就我个人而言,我更喜欢使用CentOS 64点打开(放)VMware Player。此安装,我得到了最小的系统维护,能够专注于手头的工作实际。一旦虚拟机上运行,你可以下载和编译一个最新的稳定版本。在编译你的下载版内核指令可能被发现在这里在这里;然而,这可能需要做些调整,根据您的实际安装。一旦该虚拟机是在您想要的版本的内核上运行,使用相结合的cscope和标签将帮助你非常的内核代码浏览。