I have been working on building a linux kernel for qemu. I have been following the tutorial http://xecdesign.com/compiling-a-kernel/ As of now i have been able to boot the kernel until start of init process. But i have been getting the following error: "Kernel panic - not syncing: Attempted to kill init!" I tried debugging and found that executing /sbin/init in the function kernel_init() is resulting in the kernel panic.
... Freeing init memory: 120K Kernel panic - not syncing: Attempted to kill init! Backtrace: [<c0017348>] (dump_backtrace+0x0/0x10c) from [<c02fb118>] (dump_stack+0x18/0x1c) r6:cf815d60 r5:c03f179c r4:c0409738 [<c02fb100>] (dump_stack+0x0/0x1c) from [<c02fb25c>] (panic+0x64/0x188) [<c02fb1f8>] (panic+0x0/0x188) from [<c0029d24>] (do_exit+0x564/0x61c) r3:cf815d60 r2:cf81be54 r1:cf81be54 r0:c0376584 r7:cf81a000 [<c00297c0>] (do_exit+0x0/0x61c) from [<c002a03c>] (do_group_exit+0x44/0xa4) r7:cf81a000 [<c0029ff8>] (do_group_exit+0x0/0xa4) from [<c0033e34>] (get_signal_to_deliver+0x13c/0x478) r4:cf81a000 [<c0033cf8>] (get_signal_to_deliver+0x0/0x478) from [<c0016620>] (do_signal+0x6c/0x530) [<c00165b4>] (do_signal+0x0/0x530) from [<c0017070>] (do_notify_resume+0x50/0x5c) [<c0017020>] (do_notify_resume+0x0/0x5c) from [<c0014438>] (work_pending+0x24/0x28) r4:ffffffff Rebooting in 1 seconds..
I am using a custom root file system generated using buildroot. The same rootfs works fine with the "kernel-qemu" originally downloaded from https://xecdesign.com/downloads/linux-qemu/kernel-qemu
Can somebody help me with getting this right? Let me know if further info is required.