Книга: Embedded Linux Primer: A Practical, Real-World Approach

6.2.1. First User Space Program

6.2.1. First User Space Program

On most Linux systems, /sbin/init is spawned by the kernel on boot. This is why it is attempted first from Listing 6-2. Effectively, this becomes the first user space program to run. To review, this is the sequence:

1. Mount the root file system

2. Spawn the first user space program, which, in this discussion, becomes init

In our example minimal root file system from Listing 6-2, the first three attempts at spawning a user space process would fail because we did not provide an executable file called init anywhere on the file system. Recall from Listing 6-1 that we had a soft link called sh that pointed back to busybox. You should now realize the purpose for that soft link: It causes busybox to be executed by the kernel as the initial process, while also satisfying the common requirement for a shell executable from userspace.[51]

Оглавление книги


Генерация: 1.398. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз