Difference between revisions of "GhostBSD Boot Process"

From GhostBSD Wiki
Jump to: navigation, search
(GhostBSD Boot Process)
(Power On)
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Welcome}}
 
{{Welcome}}
{{maintenance}}
+
{{Navbar GhostBSD Boot Process}}
{{Navbar System}}
+
  
 
==Introduction==
 
==Introduction==
Line 7: Line 6:
 
The process of starting a computer and loading the operating system is referred to as “the bootstrap process”, or “booting”. The GhostBSD 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.
 
The process of starting a computer and loading the operating system is referred to as “the bootstrap process”, or “booting”. The GhostBSD 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.
  
The GhostBSD boot process differs from the FreeBSD boot process. On this page we will show you the similarities and differences.
+
The GhostBSD boot process differs from the FreeBSD boot process. The GhostBSD init process is connected to [[OpenRC]].
  
==GhostBSD Boot Process==
+
==Power On==
 +
After power on the computer the firmware on your motherboard has to interact with the your hard drive to find a special partition on it. The motherboard contains the Basic Input/Output System (BIOS). On the older hardware it was named only BIOS. On newer machines the BIOS is called: type UEFI, (Unified Extensible Firmware Interface). Both types of BIOS are the interfaces between the hardware and your operating system.
  
===Turning on a computer===
+
After power on your machine you have access to the BIOS setup by pressing a key like ''Delete'', F2 or any key your motherboard manufacturer describes in his man pages.
  
====On x86 hardware====
+
This special partition on your hard drive contains either the master boot record MBR or the newer GUID Partition Table (GPT).
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.
+
  
The code within the MBR ('''[[/boot/]]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 GhostBSD/FreeBSD boot manager '''[[/boot/]]boot0''', also called Boot Easy, and ''Grub'', which is used by many Linux® distributions.
+
We will describe the starting process based on
 +
* [[MBR and GPT|Basic Input/Output System (BIOS) using Master Boot Record (MBR) and the newer GUID Partition Table (GPT)]] and
 +
* [[UEFI]] mashines
  
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.
+
As well  [[MBR and GPT]] as [[UEFI]] based BIOS types have the goal to bring your system to the GhostBSD/FreeBSD loader.
  
====GPT bootcode for UFS on BIOS-based computers====
+
==Bootstrap Process==
 
+
[https://www.freebsd.org/cgi/man.cgi?query=gptboot&sektion=8&manpath=freebsd-release-ports gptboot] is used on BIOS-based computers to boot from a UFS partition on a GPT-partitioned disk.  '''[[/boot/]]gptboot''' is installed in a Ghost/FreeBSD-boot partition with [https://www.freebsd.org/cgi/man.cgi?query=gpart&sektion=8&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports gpart(8)].
+
 
+
When it starts, gptboot first reads the GPT and determines which drive and partition to boot from.  If it  does not find an eligible partition, or if the user hits a key within    three seconds, gptboot switches from auto-boot to interactive mode.  Interactive mode allows manual selection of the disk, partition, filename,  and boot option flags, as described in [https://www.freebsd.org/cgi/man.cgi?query=boot&sektion=8&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports boot(8)].
+
 
+
The GPT standard allows a variable number of partitions, but ''gptboot'' only    boots from tables with 128 partitions or less.
+
 
+
For normal usage, the user does not have to set or manage any of the partition attributes. ''gptboot'' will boot from the first UFS partition found.
+
 
+
''gptboot'' first reads the partition table.  All freebsd-ufs partitions with  only the ''bootonce'' attribute set, indicating a failed boot, are set to bootfailed.  ''gptboot'' then scans through all of the freebsd-ufs partitions.  Boot behavior depends on the combination of ''bootme'' and ''bootonce''    attributes set on those partitions.
+
 
+
If neither ''bootonce'' nor ''bootme'' attributes are found on any partitions,  booting is attempted from the first Ghost/FreeBSD-ufs partition on the disk.
+
 
+
====Bootstrap Process====
+
  
 
By default, a three-stage bootstrap is employed, and control is automatically passed from the boot blocks (bootstrap stages one and two) to a  separate third-stage bootstrap program, [https://www.freebsd.org/cgi/man.cgi?query=loader&sektion=8&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports loader(8)]. This third stage provides more sophisticated control over the booting process than it is possible to achieve in the boot blocks, which are constrained by occupying  limited fixed space on a given disk or slice.
 
By default, a three-stage bootstrap is employed, and control is automatically passed from the boot blocks (bootstrap stages one and two) to a  separate third-stage bootstrap program, [https://www.freebsd.org/cgi/man.cgi?query=loader&sektion=8&apropos=0&manpath=FreeBSD+12.1-RELEASE+and+Ports loader(8)]. This third stage provides more sophisticated control over the booting process than it is possible to achieve in the boot blocks, which are constrained by occupying  limited fixed space on a given disk or slice.
Line 43: Line 30:
 
* [[/boot/]]loader  third stage bootstrap
 
* [[/boot/]]loader  third stage bootstrap
  
The automatic boot will attempt to load '''[[/boot/]]loader''' from partition `a'    of either the floppy or the hard disk. This is the final stage of Ghost/FreeBSD's kernel bootstrapping process.  
+
The BIOS/GPT will attempt to load [[/boot/]]loader from partition `a'    of either the floppy or the hard disk. This is the final stage of Ghost/FreeBSD's kernel bootstrapping process.
 +
 
 +
On the screen you will get:
 +
* FreeBSD/x86 bootstrap loader, Revision 1.1
 +
* Loading [[/boot/defaults/loader.conf]]
 +
* Loading /boot/device.hints
 +
* Loading [[/boot/loader.conf]]
 +
* Loading /boot/loader.conf.local
 +
 
 +
After this you will greeted with: Welcome to GhostBSD
 +
The loader program offers a menu with the following options:<br/>
 +
1. Boot Multi user [Enter]<br/>
 +
2. Boot single user<br/>
 +
3. Escape to loader prompt<br/>
 +
4. Reboot<br/>
 +
Options<br/>
 +
5. Kernel default/kernel (1 of 1)<br/>
 +
6. Boot Options<br/>
 +
Autoboot in 2 seconds, hit [Enter] to boot or any other key to stop.<br/>
  
During initialization, loader will probe for a console and set the console variable. <br/>
+
Loading kernel...<br/>
Next, FICL is initialized, the    builtin words are added to its vocabulary, and '''[[/boot/]]boot.4th''' is processed.<br/>
+
/boot/kernel/[[Kernel|kernel]]<br/>
After that, '''[[/boot/]]loader.rc''' is processed.
+
Loading configured modules...<br/>
 +
/boot/kernel/snd_driver.co<br/>
 +
and so on <br/>
 +
until you get the boot splash: GhostBSD
  
 +
Once the kernel boot process is finished, the kernel passes control to the user process [https://www.freebsd.org/cgi/man.cgi?query=init&sektion=8&manpath=freebsd-release-ports init(8)], which is located at ''/sbin/init''.  The [[/boot/defaults/loader.conf]] states as GhostBSD defaults: ''rc_system="[[OpenRC|openrc]]".''
  
 +
[[OpenRC]] is starting<br/>
 +
with
 +
* Catching service dependencies
 +
* Starting System clock
 +
* Checking local file systems
 +
* Activating swap devices
 +
* Mounting local file systems
 +
* Remounting Root file systems
 +
* Configure kernel parameters
 +
* Clearing /temp
 +
* Setting up Idconfig path......
  
 +
* Starting ZFS
 +
* Starting network
 +
*
 +
* and so on
 +
* Starting lightdm
 +
* Starting webcamd
 +
* Mounting network file systems
 +
* Setting data via ntp
  
 +
And now you will be greeted with the confirmation screen to login.
  
  

Revision as of 04:10, 4 April 2020

Welcome to Icon Disti GhostBSD.png GhostBSD Boot Process.
GhostBSD Boot Process
MBR and GPT UEFI OpenRC /boot/
Back to the Icon Disti GhostBSD.pngSystem

Introduction

The process of starting a computer and loading the operating system is referred to as “the bootstrap process”, or “booting”. The GhostBSD 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.

The GhostBSD boot process differs from the FreeBSD boot process. The GhostBSD init process is connected to OpenRC.

Power On

After power on the computer the firmware on your motherboard has to interact with the your hard drive to find a special partition on it. The motherboard contains the Basic Input/Output System (BIOS). On the older hardware it was named only BIOS. On newer machines the BIOS is called: type UEFI, (Unified Extensible Firmware Interface). Both types of BIOS are the interfaces between the hardware and your operating system.

After power on your machine you have access to the BIOS setup by pressing a key like Delete, F2 or any key your motherboard manufacturer describes in his man pages.

This special partition on your hard drive contains either the master boot record MBR or the newer GUID Partition Table (GPT).

We will describe the starting process based on

As well MBR and GPT as UEFI based BIOS types have the goal to bring your system to the GhostBSD/FreeBSD loader.

Bootstrap Process

By default, a three-stage bootstrap is employed, and control is automatically passed from the boot blocks (bootstrap stages one and two) to a separate third-stage bootstrap program, loader(8). This third stage provides more sophisticated control over the booting process than it is possible to achieve in the boot blocks, which are constrained by occupying limited fixed space on a given disk or slice.

FILES

The BIOS/GPT will attempt to load /boot/loader from partition `a' of either the floppy or the hard disk. This is the final stage of Ghost/FreeBSD's kernel bootstrapping process.

On the screen you will get:

After this you will greeted with: Welcome to GhostBSD The loader program offers a menu with the following options:
1. Boot Multi user [Enter]
2. Boot single user
3. Escape to loader prompt
4. Reboot
Options
5. Kernel default/kernel (1 of 1)
6. Boot Options
Autoboot in 2 seconds, hit [Enter] to boot or any other key to stop.

Loading kernel...
/boot/kernel/kernel
Loading configured modules...
/boot/kernel/snd_driver.co
and so on
until you get the boot splash: GhostBSD

Once the kernel boot process is finished, the kernel passes control to the user process init(8), which is located at /sbin/init. The /boot/defaults/loader.conf states as GhostBSD defaults: rc_system="openrc".

OpenRC is starting
with

  • Catching service dependencies
  • Starting System clock
  • Checking local file systems
  • Activating swap devices
  • Mounting local file systems
  • Remounting Root file systems
  • Configure kernel parameters
  • Clearing /temp
  • Setting up Idconfig path......
  • Starting ZFS
  • Starting network
  • and so on
  • Starting lightdm
  • Starting webcamd
  • Mounting network file systems
  • Setting data via ntp

And now you will be greeted with the confirmation screen to login.