0
votes

I am new to Linux Kernel Development. I have got the linux source code and added a Hello World system call just to get started. But now I am not able to figure out how to go about testing this code. How can I run the changed kernel?

I think I can use VirtualBox to check, but would not I have to make a new iso everytime I make a change and compile the kernel?

Sorry for asking such a naive question, but I am very confused here

1
"and added a Hello World system call just to get started". What? - eepp
I meant I added a system call which will just print Hello World. Sorry for not being clear - Poojan
Yes, that was clear, but why did you add a system call? We don't do that. - eepp
Look at this blog. sample system call is added and tested in QEMU environment. linuxseekernel.blogspot.com/2014/07/… - Jeyaram

1 Answers

0
votes

You can launch a qemu virtual machine with an external kernel, so you don't need to keep modifying a disk image to test your kernel. For example:

qemu-kvm -kernel arch/x86/boot/bzImage -initrd initramfs.gz -append "console=ttyS0" -nographic

That example comes from this article which contains a lot of information on how to set up a development environment.