Skip to contentSkip to conversation

kernel hcking

DISCUSSION Vikram Rangnekar 5 participants 7 messages Apr 11, 2003

lore
Share & tools
lore
#0 lore raw

I'm a kernel newbie and just wanted to know what do most kernel hackers do when working on the kernel say 2.5 when you make changes do u need to recompile the kernel and reboot the machine to test your small modification or do people use something like bochs. Also every time you makes changes in the kernel it must be hell to recompile the whole thing do kernel hackers just compile the specific file and link it into the kernel or something. Some of these will be stupid questions to most of you but I am curious since I've been working on the kernel lately and recompiling and rebooting is driving me nuts

Signature · 2 lines
regards
Vikram (http://www.vicramresearch.com)
#1 lore raw
Quoted 9 lines · Vikram Rangnekar

I'm a kernel newbie and just wanted to know what do most kernel hackers do when working on the kernel say 2.5 when you make changes do u need to recompile the kernel and reboot the machine to test your small modification or do people use something like bochs. Also every time you makes changes in the kernel it must be hell to recompile the whole thing do kernel hackers just compile the specific file and link it into the kernel or something. Some of these will be stupid questions to most of you but I am curious since I've been working on the kernel lately and recompiling and rebooting is driving me nuts

Try cc cache
http://ccache.samba.org

Con

#2 lore raw
In reply to Vikram Rangnekar
Quoted 4 lines

I'm a kernel newbie and just wanted to know what do most kernel hackers do when working on the kernel say 2.5 when you make changes do u need to recompile the kernel and reboot the machine to test your small modification or do people use something like bochs.

A lot of developers have multiple physical machines, which makes testing various different kernels a lot easier.

Quoted 2 lines

Also every time you makes changes in the kernel it must be hell to recompile the whole thing

If you are testing kernels on a separate machine to the one you are compiling on, and therefore not rebooting, it's not much of a problem
- with enough RAM, most or all of the kernel source will be cached, and you can compile a kernel in three to five minutes on a fast machine.

John.

#3 lore raw
Quoted 8 lines · John Bradford
Quoted 4 lines

I'm a kernel newbie and just wanted to know what do most kernel hackers do when working on the kernel say 2.5 when you make changes do u need to recompile the kernel and reboot the machine to test your small modification or do people use something like bochs.

A lot of developers have multiple physical machines, which makes testing various different kernels a lot easier.

Quoted 8 lines
Quoted 2 lines

Also every time you makes changes in the kernel it must be hell to recompile the whole thing

If you are testing kernels on a separate machine to the one you are compiling on, and therefore not rebooting, it's not much of a problem
- with enough RAM, most or all of the kernel source will be cached, and you can compile a kernel in three to five minutes on a fast machine.

John, you mean a "make clean && make bzImage" takes you only about 4 minutes??? I would like to know more details about .config, machine specs, compiler and so on :)

And no doubt having enough RAM to cache all the tree is really good :)

Greets, Antonio.

#4 lore raw
Quoted 2 lines

John, you mean a "make clean && make bzImage" takes you only about 4 minutes???

Yep.

Well, make distclean; cp /foo/bar/config .config; make oldconfig; make bzImage

Quoted 2 lines

I would like to know more details about .config, machine specs, compiler and so on :)

That's on an Athlon XP 2200, 512 MB RAM, 7200 RPM disk, with a fairly typical .config.

Quoted 1 line

And no doubt having enough RAM to cache all the tree is really good :)

Yep :-).

John.

#5 lore raw
In reply to Antonio Vargas

On Fri, 2003-04-11 17:37:11 +0200, Antonio Vargas <[email protected]> wrote in message <[email protected]>:

Quoted 10 lines · John Bradford
Quoted 8 lines
Quoted 2 lines

Also every time you makes changes in the kernel it must be hell to recompile the whole thing

If you are testing kernels on a separate machine to the one you are compiling on, and therefore not rebooting, it's not much of a problem
- with enough RAM, most or all of the kernel source will be cached, and you can compile a kernel in three to five minutes on a fast machine.

Quoted 3 lines

John, you mean a "make clean && make bzImage" takes you only about 4 minutes??? I would like to know more details about .config, machine specs, compiler and so on :)

Um, take 1.5GB RAM and one of those dual athlon boards and you'll even do a full compile in <5min...

MfG, JBG

Signature · 4 lines
   Jan-Benedict Glaw       [email protected]    . +49-172-7608481
   "Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg
    fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!
      ret = do_actions((curr | FREE_SPEECH) & ~(IRAQ_WAR_2 | DRM | TCPA));
#6 lore raw
In reply to Vikram Rangnekar
Quoted 10 lines · Vikram Rangnekar

I'm a kernel newbie and just wanted to know what do most kernel hackers do when working on the kernel say 2.5 when you make changes do u need to recompile the kernel and reboot the machine to test your small modification or do people use something like bochs. Also every time you makes changes in the kernel it must be hell to recompile the whole thing do kernel hackers just compile the specific file and link it into the kernel or something. Some of these will be stupid questions to most of you but I am curious since I've been working on the kernel lately and recompiling and rebooting is driving me nuts

I'm also newbie at actually coding on the kernel, and I've been using user-mode-linux to try my patches... it's easy and clean, just make a very small config so that the initial compile is also fast.

Then, when you are doing incremental compiling, just do a "make -j linux", this is very fast when you are not recompiling all .o files since the makefile checks the last-modified date for the .c files.

For maximum performance, also use ccache with (very important) the cache directory on the same filesystem than the compile directory. I keep a "compile" directory and a "ccache" directory at the same level.

When testing with user-mode-linux, you can simply type ./linux and the new kernel boots in your terminal. If you want to boot a real machine, I suggest you get a second computer and boot it by loading the kernel off the net, using tftp protocol.

Ping me if you want some more help at this last issue.

Greets and have fun!

Antonio.