Запуск собственных приложений на ядре Linux

285
DividedByZero

Когда ядро ​​Linux загружено, оно загружает дистрибутив или ОС, чтобы взять на себя управление, как я могу заставить ядро ​​загрузить некое родное приложение (написанное в c)? Мне не нужен графический интерфейс или что-то еще, вместо этого я хочу (постепенно) построить это приложение, чтобы сделать его полноценной ОС, поэтому я не хочу ОС, я хочу, чтобы только ядро выполняло мое приложение.

2

1 ответ на вопрос

3
peterh

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.

Похожие вопросы