Friday, May 31, 2013

Linux system boot process

1.BIOS Start:
When the system is powered up, the computer will first from CMOS ( Complementary Metal Oxide Semiconductor ) chip load BIOS , and the detection system hardware basic information, such as memory, hard drives, processors, etc.. Then BIOS to find whether there is the system boot disk , and if not, the system will find the master boot MBR ( Main Boot Record ) and run record MBR on the program. Usually this program is the operating system of the Loader program (called embedded systems Bootloader ) , whose main function is to instruct the system to be loaded at start up and loading system. For example, in MBR running on Linux the Loader program ( GRUB and LILO ), you can load the Linux kernel. BIOS called firmware. In computer systems, BIOS program is stored in the motherboard chip, format the hard disk does not have any impact on this information; except with special tools can be erase, its content is always there.

2.GRUB Loading system:
GRUB is a system running Loader program, under normal circumstances, the installation of LINUX operating system, start the system when the first program that is GRUB . This program is used to load the operating system kernel (if there are multiple operating systems, this program is used to select the boot multiple operating systems).
In the LINUX operating system, and start the associated application is located in /boot folder. Run GRUB reads Applications for /boot/grub/grub.conf file, edit this file to load the operating system, you can set the startup waiting time (waiting time exceeded, the system will start the default boot operating system), start menu, default boot operating system and operating system kernel image filename and location.

3. System startup files:
In the system loads Linux kernel, the system kernel in order to run the following procedure. The first system is running a kernel file as an /sbin/init , this program will create a system of one of a process, and this process as a whole system after the application of the parent process, and then run /etc/rc.d/rc.sysinit initialize the system. /etc/inittab is the system running the first three major program, this program is mainly used to select the starting levels, different levels start to run different programs and commands, these files are in /etc/rcX.d folder read. After completion of the above content execution, the system loads the user specific information.

4. Initialize the user file:

  •  /etc/rc.d/rc.local is a script file, complete the above initialization, the user can load the file folder system startup program to run. Start automatically when the system starts a program that can be added in this file, the equivalent of a batch program startup.
  •  /etc/profile file. Reads the /etc/rc.d/rc.local , the system will set the environment variable, which is the system's main SHELL configuration files, but also the first to detect when the user logs system files. Including PATH , USER , LOGNAME , MAIL , HOSTNAME , etc.
  •  /home/$USERNAME/./bash_profile file. After reading /etc/profile file, each user will read the documents with their own unique, except for root users, all users will read /home/$USERNAME/.bash_profile file and set their own environment variables.

Execution might finish above documents, the user can log in Linux operating system 

No comments:

Post a Comment