You are not logged in.

#1 2012-02-09 14:16:33

kdar
Member
From: Sweet home Alabama!
Registered: 2009-06-27
Posts: 356

Best environment to do Kernel Hacking?

What is best environment to mess around with kernel? Which distro or, if virtually, on which virtual emulator?

I tried to build a 3.2.5 on Arch installed in virtualbox (since I didn't want to mess up my installed arch on computer) and it is taking forever to compile...

I was reading somewhere that some people are able to compile kernel in few minutes. I am wonder how they did it, just because of good computer specs?

Last edited by kdar (2012-02-09 14:30:11)

Offline

#2 2012-02-09 14:31:01

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,592
Website

Re: Best environment to do Kernel Hacking?

I compile my kernel on Arch, in a "real" installation (e.g. not a virtual machine). You should probably compile in a clean chroot, but I've never bothered for kernel compilation.

Kernel compilation can take a relatively long time, depending on the number of config options you've got set, but it can be speeded up by adding in a -j3 (or whatever number suits your processor best) to the make parameters.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2012-02-09 16:35:38

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Best environment to do Kernel Hacking?

If you strip the kernel of some stuff that you don't need, you can compile it much faster (because it's smaller).

Offline

#4 2012-02-09 16:51:22

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: Best environment to do Kernel Hacking?

ccache is what you're searching for.

Offline

#5 2012-02-09 17:02:39

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Best environment to do Kernel Hacking?

TheLemonMan wrote:

ccache is what you're searching for.

IIRC that works if you repeatedly recompile the same thing. The first compile won't be faster.

Offline

#6 2012-02-09 18:33:05

anta40
Member
From: Jakarta, Indonesia
Registered: 2010-03-01
Posts: 79

Re: Best environment to do Kernel Hacking?

Nowadays I'm kinda interested in ARM Linux kernel hacking. I use this guide as the starting point:
http://balau82.wordpress.com/2010/03/22 … -emulator/

No fancy stuffs needed, so I can built the kernel in less that 10 minutes.

Offline

#7 2012-02-09 19:47:09

vwyodajl
Member
Registered: 2012-01-21
Posts: 183

Re: Best environment to do Kernel Hacking?

@anta40
Thanks for posting that link, I am in the process of starting some ArchArm Kernel tweaking, and trying to figure out how to build a full arm compiler on my x86 machine for my many ArchArm devices.

Offline

#8 2012-02-09 20:12:35

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: Best environment to do Kernel Hacking?

karol wrote:
TheLemonMan wrote:

ccache is what you're searching for.

IIRC that works if you repeatedly recompile the same thing. The first compile won't be faster.

If you do some serious kernel hacking you'll recompile it once a minute heh

Offline

#9 2012-02-09 21:33:48

kdar
Member
From: Sweet home Alabama!
Registered: 2009-06-27
Posts: 356

Re: Best environment to do Kernel Hacking?

I will give ccache a try. I am pretty sure I will have to compile it a lot this semester.

@anta40
Thanks as well. I been tinkering with Pandaboard lately, while I am in school, but it would be nice to emulate it at home on regular desktop pc, I have heard of Qemu but haven't tried it yet.

Last edited by kdar (2012-02-09 21:34:12)

Offline

#10 2012-02-09 23:10:55

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: Best environment to do Kernel Hacking?

The distro you use doesn't matter, since you'll be doing it in a terminal anyway.  However, since most distros expect you to manually install a custom kernel, makepkg and PKGBUILDs seem pretty sweet.

Offline

#11 2012-02-10 05:48:59

kdar
Member
From: Sweet home Alabama!
Registered: 2009-06-27
Posts: 356

Re: Best environment to do Kernel Hacking?

ccache helped a lot. Now it takes 5-10 min to recompile if I make some little change.

Speak about kernel hacking and creating new system calls.. Does anyone know any good tutorials or examples? The only ones I see are the printk("Hello world").

Offline

#12 2012-02-10 12:00:59

anta40
Member
From: Jakarta, Indonesia
Registered: 2010-03-01
Posts: 79

Re: Best environment to do Kernel Hacking?

Try "Linux Kernel Development (Robert Love)". It's good.

Offline

#13 2012-02-10 15:39:46

kdar
Member
From: Sweet home Alabama!
Registered: 2009-06-27
Posts: 356

Re: Best environment to do Kernel Hacking?

That actually what I have. We use it for our class. But I find his writing a bit like overview, it isn't* bad... but he doesn't seem to go into deep detail.

Last edited by kdar (2012-02-10 20:45:44)

Offline

#14 2012-02-11 03:28:59

kdar
Member
From: Sweet home Alabama!
Registered: 2009-06-27
Posts: 356

Re: Best environment to do Kernel Hacking?

Why do I get this when I try to call _syscall1(long,mynewcall,int,i) in test C file (from user space) for my new system call:

In file included from testmynewcall.c:5:0:
testmynewcall.h:5:9: error: macro names must be identifiers
testmynewcall.h:8:16: error: unknown type name ‘mynewcall’
testmynewcall.h:8:30: error: unknown type name ‘i’

-- Got it working

Last edited by kdar (2012-02-13 16:14:33)

Offline

#15 2012-02-13 16:13:39

kdar
Member
From: Sweet home Alabama!
Registered: 2009-06-27
Posts: 356

Re: Best environment to do Kernel Hacking?

anta40 wrote:

Nowadays I'm kinda interested in ARM Linux kernel hacking. I use this guide as the starting point:
http://balau82.wordpress.com/2010/03/22 … -emulator/

No fancy stuffs needed, so I can built the kernel in less that 10 minutes.

For ARM with Qemu.

You had to create your own file-system somehow?

Last edited by kdar (2012-02-13 16:14:44)

Offline

Board footer

Powered by FluxBB