SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
"The first program to run under Slackware besides the Linux kernel is init(8)."
I haven't been able to find what calls this program. Is this called from /boot/vmlinuz?
In the man pages for init it says:
"Init is the parent of all processes."
So, I assume that vmlinuz is the first thing that happens after boot up, or as a part of boot up. And then init is called from there and the system setup branches out from that point. Or is init called from some other program that /boot/vmlinuz launches?
Uh.. Actually, I can't find 'init' either. I did find several 'init.c' files in /usr/src/linux-2.4.20/arch'. So, I am assuming (again) that vmlinuz (the actual kernel ??) calls, or runs, the 'init.c' in
'/usr/src/linux-2.4.20/arch/i386/mm'
on this Pentium III machine.
Thanks for any comments/input as I get into this 'guts' level investigation of linux.
Hmmmm... Now I don't know. I searched through init.c for the string 'inittab' and didn't get a hit. And, I read:
"The first program to run under Slackware besides the Linux kernel is init(8). This program reads the /etc/inittab(5) file to see how to run the system."
here's what I did:
[root@bsslack ~] $ find / -name 'init' -print
/usr/src/linux-2.4.20/init
/usr/src/linux-2.4.20/include/config/msndclas/init
/usr/src/linux-2.4.20/include/config/msndpin/init
/sbin/init
[root@bsslack ~] $
I just overlooked that tiny /sbin/init. (my eyeballs didn't do their customary carriage return/line feed!! ) The others are init directories.
So, anyway, I see it's a complicated process. Is my assumption correct that /sbin/init is called from /boot/vmlinuz ?
And, then, does the /sbin/init use the init.c in /usr/src/linux-2.4.20/arch/i386/mm ? I can't view init since it is a binary file, so I don't know what's in it.
Thanks for your patience and for bearing with me while I try to get a grasp of the initialization process.
I doubt that /sbin/init calls anything from /usr/src since on many distros (and even on slack) this directory is/can be empty. You don't have to have your kernel source available for booting up.
As for my guess on what it calls (since I have no real idea):
/sbin/init
calls
/etc/inittab
which in turns calls it's respective runlevel defined there with the default entry;
which then calls the appropriate /etc/rc.d scripts to get the system rolling.
This is of course after the kernel (/vmlinuz or /boot/vmlinuz depending on which release you are running) has done it's thing (everything before the runlevel).
Originally posted by MasterC As for my guess on what it calls (since I have no real idea):
/sbin/init
calls
/etc/inittab
which in turns calls it's respective runlevel defined there with the default entry;
which then calls the appropriate /etc/rc.d scripts to get the system rolling.
Cool
I got this from the info I was reading, but the initial question (which is not answered in the info I was reading) remains about my assumption.
"Is my assumption correct that /sbin/init is called from /boot/vmlinuz ?"
I'm just trying to be careful with my assumptions.
AH!!! I found it. I was just looking in the slackware documentation. I almost forgot I had this "Running Linux" book. (another d'oh!)
Anyway, it says quite clearly, " Once the device drivers are initialized, the kernel executes the program init , which is found in /etc, /bin, or /sbin (it's /sbin/init on most systems). init is a general-purpose program that spawns new processes.... etc."
So, RTFM applies! I was just shying away from "Running Linux" because my initial foray into it scrambled my brains as a rank newbie.
I guess I am starting to pass out of that phase.
regards...
Edit: This is in the boot prompt howto:
"Any remaining arguments that were not picked up by the kernel and were not interpreted as environment variables are then passed onto process one, which is usually the init program."
This, of course, pushed the question "where is process one called from?' onto the WTF stack. The statement didn't actaully say init was called from the kernel. It made it appear that the call to process one was after the kernel. Anyway, moot point now.
and looked up init in there. Of course, it says the last thing the kernel does involves the /sbin/init file.
Quote:
After the kernel has been unpacked into memory, it begins to execute, initializing hardware. The last thing it does is mount the root file system, which necessarily contains a program /sbin/init, which the kernel executes. init is one of the only programs the kernel ever executes explicitly; the onus is then on init to bring the UNIX system up. init always has the process ID 1.
So, last thing, first thing, who's counting?
I'm gonna understand this before I move on to runlevels!!
I think it's confusing the 2 terms:
Once the kernel is loaded the first thing it executes is init VS
The very last thing the kernel does during loading is execute init
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.