You are not logged in.

#1 2016-07-16 15:58:24

childerico
Member
From: Italy
Registered: 2015-11-18
Posts: 67

[SOLVED] Environment to start experimenting with kernel development

I am starting to study kernel code for both university and personal interest. I am going to write my first (simple) modules to experiment with kernel functions and mechanisms.

I am evaluating some alternatives for setting up an environment for development. E.g.:
(i) a Linux distro in dual boot (safe, but a lot of reboots...)
(ii) a virtual-machine
(iii) compiling a custom kernel directly on my Arch installation
(iv) ...

I'd like to receive some suggestions for what you consider the best for a beginner (maybe a different solution would fit better for a kernel developer!).

Thanks!

EDIT: I forgot to say that I am required to build kernel from source too and maybe to work on that sources.

Last edited by childerico (2016-07-17 08:11:08)

Offline

#2 2016-07-16 16:15:38

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [SOLVED] Environment to start experimenting with kernel development

I don't know how any of those options apply to your question.  What would you dual boot?  What would be in a VM?  Why would you compile your own kernel (you said you were working on kernel *modules*)?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2016-07-16 16:47:46

childerico
Member
From: Italy
Registered: 2015-11-18
Posts: 67

Re: [SOLVED] Environment to start experimenting with kernel development

@Trilby you are right, my question lacks a point.

I know I could write modules without a custom kernel and this would be the best way in "real life", but actually I am required to do something more.
Before writing modules, I have to practice with building kernel from sources and configuring it. And maybe I will experiment with the kernel source itself.

So I was looking for a solution to practice without the risk of damaging my Arch installation in any way.
I hope my question has got some sense now.

Offline

#4 2016-07-16 17:24:38

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [SOLVED] Environment to start experimenting with kernel development

That explains why #3 was an option, and it sounds now like #3 is required.  It still begs the question why you would dual boot or use a vm.  There's nothing wrong with either of those options, I just don't see that they have any relevance at all to your (currently) stated goals.

Perhaps there is some ambiguity about "dual boot".  Usually that means to have two separate OS's on the same machine - that is what I see as not relevant to the stated goals.  You can, however, very easily have multiple kernels for the same archlinux system and you'd just chose the one you want in your boot loader.  This is quite common even when people aren't tinkering with the kernel.

So just do a regular archlinux install.  Keep the default arch linux kernel where it is, and build your own custom kernel (you can even use ready-made PKGBUILDs for this) for experimentation.  You can boot into either kernel: yours to test it out, or the arch-default if there are any problems with yours.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2016-07-17 08:10:55

childerico
Member
From: Italy
Registered: 2015-11-18
Posts: 67

Re: [SOLVED] Environment to start experimenting with kernel development

Thanks for your answers! I will go with option #3, following the Wiki.

Just to explain - I was considering installing another Linux OS on a different partition or using a VM to remove risk of accidentally overwriting anything of my default kernel, during compilation/installation of my own kernel.
Reading your answer, I understand that probably this is almost impossible (without doing random things, maybe). So #3 is all I need, but having no experience in kernel compilation I was worrying about making damage.

Thank you again!

Offline

Board footer

Powered by FluxBB