Xathrya Sabertooth |
Posted: 26 Aug 2013 04:24 AM PDT In Unix-based OS, init (short for initialization) is the first process started during booting of the computer system. Init is a daemon process that continues running until the system is shutdown. It performs many things and also served as the ‘mother’ of processes. Once init starts, “swapper” part on kernel goes into the sleep state, into an idle loop and rest of the bootup process is taken up by init process. The old init systems such as SysV-style and BSD-style is based on a single process which load the application serially using script. A newer system such as system and upstart can init system in parallel to speed up the process. SysV-styleSystem V init is one of init system used by major Linux distribution. SysV init examines the /etc/inittab file for an :initdefault: entry, which defines any default runlevel. If there is no default runlevel, then init dumps the user to a system console for manual entry of a runlevel. RunlevelsStates in which system is running at. It describe certain states of a machine, characterized by the processes run. There are generally eight runlevels, three of which are standard:
Aside from these, every Unix and Unix-like system treats runlevels a little differently. The commond denominator, the /etc/inittab file, defines what each runlevel does in a given system. For example, there are runlevels such as:
BSD-StyleBSD init runs the initialization shell script located in Unlike System V’s script ordering, which is derived from the filename of each script, this system uses explicit dependency tags placed within each script. The order in which scripts are executed is determined by the rcorder script based on the requirements stated in these tags. Slackware use this. systemdSystem management daemon designed exclusively for the Linux kernel. Like init, systemd is a daemon that manages other daemons. UpstartEvent-based replacement for traditional init daemon. OtherThese are alternatives used to replace Sys-V and BSD-style init:
|
Posted: 26 Aug 2013 03:57 AM PDT In order for a computer to successfully boot into device we know, a computer should pass some process which we refer as boot process. The BIOS, operating system, and harware components must all be working properly. Failure of any of these three elemens will likely result in a failed boot sequence. After a boot loader does it jobs (load the kernel) it will terminate itself and the control will be passed to the kernel. When a Linux kernel is loaded and ran, it is actually running two process for completely load kernel to memory. First one is bootstrapping, and second one is the process in the kernel itself. In earlier phase kernel will use a bootstrap which is assembly code added to the image. When bzImge is loaded , the code of bootstrap starts executing. The tasks of bootstrap are,
When bootstrapping done, the kernel take the process. Kernel does:
Kernel has loaded, but the booting process has not stopped yet. |
Linux Boot Process – Boot Loader Posted: 26 Aug 2013 03:40 AM PDT In order for a computer to successfully boot into device we know, a computer should pass some process which we refer as boot process. The BIOS, operating system, and harware components must all be working properly. Failure of any of these three elemens will likely result in a failed boot sequence. The first sector of a boot device is called as sector '0′ or the Master Boot Record (MBR) . BIOS can read only sector '0', it can’t read any other sector. The size of the MBR is only 512 bytes. It has three components: primary boot loader info in first 446 bytes, partition table in next 64 bytes, MBR validation check in last 2 bytes. To load Operating System, a special program called boot loader written here. Boot loader even helps us to boot more than one operating systems on the machine (called chaining). The infamous boot loaders for Linux are GRUB and LILO. GRUB (Grand Unified Boot loader) is used by default on majority of Linux distributions. GRUB is capable of booting DOS, Windows, Linux, and BSD operating system. The LILO (Linux Loader) is an old boot loader, used by several distribution. When BIOS finished initialized the system, it will jump to Master Boot Record and loads the boot loader from there. Boot loader does:
Boot loaders can be divided into some categorizes by the design: single stage boot loader, two stage boot loader, and mixed stage boot loader. A single stage boot loader is a boot loader which consists of a single file that is loaded entirely by the BIOS. This image performs the steps described above to start the kernel. However, on x86 the boot loader is limited to the 512 bytes. A two stage boot loader actually consists of two boot loaders after each other. The first being small which then load the seconf one. The second one can then contain all the code needed for loading kernel. GRUB uses two. Mixed boot loader is a boot loader similar to two stage boot loader. it splits the bootloader in two parts, where the first half (512 bytes) can load the rest. This can be achieved by inserting a ’512-bytes’ break in the ASM code, making sure the rest of the loader is put after the bootsector. In Linux, after boot loader is loaded into memory it looks into /boot directory and loads the kernel image. Note here, that it is boot loader that expects all the files and kernel image needed for booting under /boot directory. This is the reason why kernel image and all boot related files are kept under /boot directory. Once boot loader loads kernel image to memory , the control is passed to kernel image . |
You are subscribed to email updates from Xathrya Sabertooth To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
Tidak ada komentar:
Posting Komentar