Difference between revisions of "Boot process"
imported>ThorstenStaerk |
imported>ThorstenStaerk |
||
Line 13: | Line 13: | ||
[[File:Snapshot-bootmenu.png]] | [[File:Snapshot-bootmenu.png]] | ||
+ | |||
+ | = the Linux kernel is loaded = | ||
+ | |||
+ | = the initrd is loaded = | ||
= the Linux kernel is executed = | = the Linux kernel is executed = | ||
− | |||
− | |||
= the init program is started = | = the init program is started = | ||
Line 75: | Line 77: | ||
= See also = | = See also = | ||
+ | * [[scheduling_tAsks]] | ||
* http://wiki.linuxquestions.org/wiki/Boot_process | * http://wiki.linuxquestions.org/wiki/Boot_process | ||
+ | * http://unix.stackexchange.com/questions/106822/documentation-architecture-of-linux-session |
Revision as of 20:10, 11 January 2014
How Linux typically starts up on a PC
Contents
- 1 you switch on the computer
- 2 the master boot record is executed
- 3 the boot loader is executed
- 4 the Linux kernel is loaded
- 5 the initrd is loaded
- 6 the Linux kernel is executed
- 7 the init program is started
- 8 the init script are executed
- 9 Virtual Terminals are started
- 10 X Windowing system is started
- 11 login manager is started
- 12 user session incl. Desktop environment is started
- 13 See also
you switch on the computer
BIOS is shown and the devices are checked.
the master boot record is executed
The BIOS will then load the first sector of the first hard disk and execute it. The first sector is part of the bootloader and loads more sectors, for the grub bootloader this looks like this:
the boot loader is executed
The boot loader is typically grub, and there is an older and smaller called lilo. The grub bootloader displaying the boot menu can look like this:
the Linux kernel is loaded
the initrd is loaded
the Linux kernel is executed
the init program is started
The Linux kernel starts the init program. Nothing else. If the init process quits, the Linux kernel panics. Init is responsible for all further services and programs that are started.
the init script are executed
This can be SysV init scripts or upstart or systemd. These init scripts typically start services. Services are grouped into runlevels. Find out your current runlevel with the command
runlevel
Change your runlevel, in this case to 3, with the command
init 3
E.g. in SUSE the runlevels are defines as
- 0: reboot
- 1: rescue system, single user
- 2: all services that run in (1) plus services needed for multi-user login
- 3: all services that run in (2) plus network services
- 4: undefined
- 5: all services that run in (3) plus graphical display
Some notable services are:
- alsasound
- Used for the alsa sound system
- cups
- Used for printing, it is the common Unix printing system
- dbus
- Used to call public functions in running programs. Should be abstracted to users.
- esound
- Used for enlightenment sound system
- ntp
- Network Time Protocol to keep your clock in sync with the real time via the network
- autofs
- To automount devices as soon as they are plugged in, e.g. USB disks and CD ROMs
- udev
- The udev services have a lot of names, e.g. boot.udev under SUSE. They create the device handles in the /dev folder, e.g. when you plug in a USB disk or attach a web cam
- xdm
- The x display manager shows a graphical login screen and starts a session when you log in. It keeps running during the session so when you end your session, you will be able to log in again.
- cifs
- mounts all cifs network drives
- xfs
- manages X fonts
- cron
- Cron executes jobs in given time intervals according to /etc/crontab
- ypbind
- provides information like login names, home directories and so on over the network
- powerd
- Makes sure to throttle down your computer's speed if there is nothing to do, it can save power and it is configured to do so.
- network
- The network service makes sure you have an IP address and your network card is active.
- sshd
- Service that allows to control a computer via the network