Running native applications on the Linux Kernel

2

When the Linux kernel has loaded it loads the distro or OS to take over, how can I make the kernel load some native application (written in c) instead? I don't need a GUI or anything, Instead I want to (gradually) build on this application to make it a full blown OS, that's why I don't want an OS, I want Just the kernel to execute my application.

DividedByZero

Posted 2014-09-27T12:28:00.527

Reputation: 280

Answers

3

It requires to understand the linux booting mechanism a little bit better.

After booting, the kernel initializes the device drivers, and after that it starts the first process on the system. By default, it is /sbin/init. From this point, the kernel doesn't do anything by own, only executes the requests of the processes.

You can override this default setting by an init=/path/to/your/binary in the kernel boot parameters. These parameters you have to give to your bootloader (which is probably grub).

If you want a simple command prompt with a shell, you can give init=/bin/bash to your boot loader.

peterh - Reinstate Monica

Posted 2014-09-27T12:28:00.527

Reputation: 2 043