Ubuntu – Splash in PID =1

initprocessstartupUbuntu

I have just started learning about process in Linux.

I have come around this command called –

ps -ef (which will shows all the process running )

I get output like this

UID        PID  PPID   LWP  C NLWP STIME TTY          TIME CMD
root         1     0     1  0    1 Apr17 ?        00:00:18 /sbin/init splash

What does splash represent here?
I know init is the first process that runs when we start up the computer.
But what is splash ? What does it do ?

Also can anybody tell me init is called the first process to be run but it is the BIOS or UFEI program that first run when we start up the computer .
So why we called init as the first process not BIOS or UFEI?

Best Answer

What does splash represent here? I know init is the first process that runs when we start up the computer. But what is splash ? What does it do ?

First of all, you are runnning ubuntu which uses systemd, which allows you to display a splash screen during boot, this is why it has the splash argument. See the splash.c source code.

[EDIT] Your computer is running systemd because, afaik, systemd is the only init I know of that supports the splash parameter - there might be others, but since it is also the default on Ubuntu, I think it is a safe guess. On Ubuntu, by default, /sbin/init is a symbolic link to /usr/lib/systemd/systemd, the kernel loaded /sbin/init splash, ps here uses the command line of the process, which will be /sbin/init splash, and that is what you see.

Also can anybody tell me init is called the first process to be run but it is the BIOS or UFEI program that first run when we start up the computer . So why we called init as the first process not BIOS or UFEI?

Ok, to keep things simple, the BIOS/UEFI are programs that get loaded at boot, they contain config data for further booting the system. They will eventially locate the next program to boot, such as a boot manager (e.g. grub) which will in its turn allow you to launch a kernel. I am trying to keep it simple, here, but you can read it up. on linux and unix systems, init is the first program spawned by the kernel and thus gets PID 1.

You can read up more here, actually, that article is pretty old. I do not claim what follows is 100% accurate.

The first thing you do to bootstrap or boot a x86 computer is press the power button. Your powersupply powers up the motherboard and waits for a signal from the SMPS (Switching Mode Power Supply) that enough power can be provided. For example, it checks that your PCIe graphics card gets enough juice, that a CPU and RAM is there.

The Intel Management Engine (IME)/AMD Secure Technology start at this point, the IME is a separate Intel CPU with an obfuscated minix 3 operating system, the AMD equivalent uses an ARM core embedded on the central CPU; little more is known about these two.

Once the motherboard receives the SMPS it stops constantly resetting the CPU, the CPU now reads an address in the ROM, this is usually FFFF:0000h; it contains a jump (like a shortcut) to firmware code.

This firmware used to be one monolithic block of code that one called BIOS and could only be used with a keyboard. With UEFI, this has now become an entire OS with mini filesystem. Today, the jump points at some bootstrapping code (one could probably call BIOS) that decompresses the UEFI. The UEFI likes a mini operating system and may feature mouse support, network boot, SCSI, RAID, disk and/or memory checkers, and many other features.

The UEFI, once loaded, performs a Power on Self Test (POST) which checks if all the hardware is OK.

The full POST checks many devices such as CMOS, video ROM's, controllers, DMA (which allows devices direct access to RAM), CPU, memory and other devices. When you reset a PC, that is, you press the reset button or execute a reboot command, a simple POST is performed which will not notice if there is a problem with CMOS, for example. CMOS is a little chip on your motherboard of volatile memory (cut power and the memory is lost) and a clock, it is powered by a small battery and contains all the settings for the UEFI.

The UEFI reads these settings, makes any changes to the system required, and proceeds with bootstrapping the system further. The UEFI can either perform a legacy boot by looking for a boot record on a drive or use the more modern UEFI boot method. This requires a FAT32 formatted partition with UEFI bootstrapping code that can load Linux kernel, boot manager (Windows) or a bootloader such as grub.

The kernel on UNIX systems loads all needed device drivers and then an init process. Init can be systemd or any other program such as bash; you configure it in kernel parameters. Note that if you choose to load the kernel directly with UEFI, it is much harder to set kernel parameters. Once lodaed, init gets PID 1 and then loads the userland (the system shell and, optionnaly, a graphical user interface).

Related Question