1
votes

I have a project in mind and for that I require the kernel to boot up and bring me to a console window so that I can start working. [later I'll automate the process].

How do I accomplish it?

Well, I have downloaded the latest stable kernel source from kernel.org and I have tried editing the init/main.c file. But I have no idea what in the world was going on in that file [noob ^n].

Hence, I post this question for an answer.

2
You need compiled kernel, supported hardware and possibly rootfs. That is all - Alex Hoppus
"...and bring me to a console window" -- A minimal console, or a terminal window using X11? - sawdust
@sawdust a minimal console. I have no plans for a GUI [as of yet]. - Surya Teja Karra

2 Answers

3
votes

I require the kernel to boot up and bring me to a console window so that I can start working.

The kernel doesn't do much by itself. In fact, it's unlikely you want to alter "main" in the kernel.

If you want to "run" the kernel, you'll also need a root filesystem and some user-space programs. If you want a minimal userland, you can use "busybox". Even better, buildroot will help you create a minimal userland + kernel.

You can even combine your root filesystem plus the kernel into a single binary. At runtime, it will uncompress userland into a ramdisk and run entirely from RAM. See initramfs. This is super-helpful for embedded systems. A minimal kernel+root filesystem can be around 1MB.