English Turkish (tr_TR)
Part III. System Administration
Chapter 13. The FreeBSD Booting Process
The process of starting a computer and loading the operating system is referred to as "the bootstrap process", or "booting". FreeBSD's boot process provides a great deal of flexibility in customizing what happens when the system starts, including the ability to select from different operating systems installed on the same computer, different versions of the same operating system, or a different installed kernel. Bir bilgisayarı çalıştırma ve işletim sistemini yükleme işlemi <quote>önyükleme işlemi</quote> veya <quote>başlatma</quote> olarak adlandırılır. Freebsd'nin önyükleme işlemi, aynı bilgisayarda yüklü farklı işletim sistemlerinden, aynı işletim sisteminin farklı sürümlerinden veya farklı bir yüklü çekirdekten seçim yapma yeteneği de dahil olmak üzere, sistem başladığında ne olacağını özelleştirmede büyük bir esneklik sağlar.
This chapter details the configuration options that can be set. It demonstrates how to customize the FreeBSD boot process, including everything that happens until the FreeBSD kernel has started, probed for devices, and started man:init[8]. This occurs when the text color of the boot messages changes from bright white to grey.
This problem parallels one in the book The Adventures of Baron Munchausen. A character had fallen part way down a manhole, and pulled himself out by grabbing his bootstraps and lifting. In the early days of computing, the term _bootstrap_ was applied to the mechanism used to load the operating system. It has since become shortened to "booting".
On x86 hardware, the Basic Input/Output System (BIOS) is responsible for loading the operating system. The BIOS looks on the hard disk for the Master Boot Record (MBR), which must be located in a specific place on the disk. The BIOS has enough knowledge to load and run the MBR, and assumes that the MBR can then carry out the rest of the tasks involved in loading the operating system, possibly with the help of the BIOS.
FreeBSD provides for booting from both the older MBR standard, and the newer GUID Partition Table (GPT). GPT partitioning is often found on computers with the Unified Extensible Firmware Interface (UEFI). However, FreeBSD can boot from GPT partitions even on machines with only a legacy BIOS with man:gptboot[8]. Work is under way to provide direct UEFI booting.
The code within the MBR is typically referred to as a _boot manager_, especially when it interacts with the user. The boot manager usually has more code in the first track of the disk or within the file system. Examples of boot managers include the standard FreeBSD boot manager boot0, also called Boot Easy, and Grub, which is used by many Linux(R) distributions.
If only one operating system is installed, the MBR searches for the first bootable (active) slice on the disk, and then runs the code on that slice to load the remainder of the operating system. When multiple operating systems are present, a different boot manager can be installed to display a list of operating systems so the user can select one to boot. Yalnızca bir işletim sistemi yüklüyse, <acronym>MBR</acronym> diskteki ilk önyüklenebilir (etkin) dilimini arar ve işletim sisteminin geri kalanını yüklemek için bu dilimdeki kodu çalıştırır. Birden çok işletim sistemi mevcut olduğunda, kullanıcı önyükleme için birini seçebilmesi adına işletim sistemlerinin bir listesini görüntülemek için farklı bir önyükleme yöneticisi yükleyebilir.
The remainder of the FreeBSD bootstrap system is divided into three stages. The first stage knows just enough to get the computer into a specific state and run the second stage. The second stage can do a little bit more, before running the third stage. The third stage finishes the task of loading the operating system. The work is split into three stages because the MBR puts limits on the size of the programs that can be run at stages one and two. Chaining the tasks together allows FreeBSD to provide a more flexible loader. FreeBSD önyükleme sisteminin geri kalanı üç aşamaya ayrılmıştır. İlk aşama, bilgisayarı belirli bir duruma getirmek ve ikinci aşamayı çalıştırmak için yeterli olduğunu belirler. İkinci aşama, üçüncü aşamayı çalıştırmadan önce biraz daha fazlasının yapılmasını sağlar. Üçüncü aşama, işletim sistemini yükleme görevini tamamlar. <acronym>MBR</acronym>, birinci ve ikinci aşamada çalıştırılabilen programların boyutuna sınırlar koyduğundan, çalışma üç aşamaya ayrılır. Görevleri birlikte zincirlemek Freebsd'nin daha esnek bir yükleyici desteği sağlamasına olanak tanır.
The kernel is then started and begins to probe for devices and initialize them for use. Once the kernel boot process is finished, the kernel passes control to the user process man:init[8], which makes sure the disks are in a usable state, starts the user-level resource configuration which mounts file systems, sets up network cards to communicate on the network, and starts the processes which have been configured to run at startup.
The boot manager code in the MBR is sometimes referred to as _stage zero_ of the boot process. By default, FreeBSD uses the boot0 boot manager.
The MBR installed by the FreeBSD installer is based on [.filename]#/boot/boot0#. The size and capability of boot0 is restricted to 446 bytes due to the slice table and `0x55AA` identifier at the end of the MBR. If boot0 and multiple operating systems are installed, a message similar to this example will be displayed at boot time:
[.filename]#boot0# Screenshot
F1 Win
F2 FreeBSD
Default: F2
Other operating systems will overwrite an existing MBR if they are installed after FreeBSD. If this happens, or to replace the existing MBR with the FreeBSD MBR, use the following command:
# fdisk -B -b /boot/boot0 device
where _device_ is the boot disk, such as [.filename]#ad0# for the first IDE disk, [.filename]#ad2# for the first IDE disk on a second IDE controller, or [.filename]#da0# for the first SCSI disk. To create a custom configuration of the MBR, refer to man:boot0cfg[8].