On 4/19/21 2:31 PM, Brian Hagen wrote:
Hello, all:
I am satisfied with the stability of the 9.1. 10.0, and 10.1 LFS
releases that I have built. Even so, I would like to take some time to
get very familiar with the bootup sequences they have. Ideally, it could
be possible to trace the program execution (at some level) from the
handoff of the BIOS to GRUB, then to the handoff to the kernel, all the
way to the login prompt.
From what I have read, the first code executed once the kernel has
been loaded into memory is the code compiled from init.c. (However, I
could be off-track on this). I realize that an atomic trace-level
analysis is not realistic, since the code is translated (as usual) into
object code. Thus, unless someone were to have a full-fledged IDE
development environment with real-time debugging, that C-code to
object-code translation with single-stepping, breakpoints, etc. would be
all but impossible.
Even so, I would like to get to know a good overview how the LFS
system does its initialization all the way up to the presentation of the
login prompt. If there are any system documents available, that might be
a really good resource.
The first program that the kernel runs is init. The code is in the
kernel init/main.c:
if (!try_to_run_init_process("/sbin/init") ||
!try_to_run_init_process("/etc/init") ||
!try_to_run_init_process("/bin/init") ||
!try_to_run_init_process("/bin/sh"))
return 0;
What that program is depends on the version of the book. It will come
from sysvinit or systemd. systemd is very complex. sysvinit is a lot
simpler. For that check 'man inittab' From there follow the programs
that it runs, primarily /etc/rc.d/init.d/rc and /sbin/agetty.
-- Bruce
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Do not top post on this list.
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
http://en.wikipedia.org/wiki/Posting_style