2

as a school project I have to add a syscall to the latest stable linux kernel. I did and recompiled the kernel using make defconfig and make.

After going through several tutorials to boot the kernel (none of which worked), I finally found something here (adapting it to x86_64 version of the kernel). This tutorial makes me create a initramfs using mkinitramfs -o file.

The problem is, I need to test my syscall on this new kernel but once I boot it I get redirected to a (initramfs) prompt, and I have no idea how to install packages, or if it is even the right solution.

My question -> how would I get gcc on this virtual machine so I can compile a simple C test program, run it and make sure my syscall works ?

1 Answer 1

0

Well if anyone wants to know how to do that, here's how I did it -> I compiled on my machine, created my own initramfs (following the instructions here (don't gzip or qemu won't read it somehow)), put the executable in the initramfs before cpio it, then launched qemu and the executable, voila.

I know this is not the ideal solution, it only worked because both the kernel I was testing and my machine were linux x86_64, but I was out of options.

(If you want to pass gcc to your initramfs, don't, it segfaults when compiling).

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.