haiku/docs/userguide/en/installation/install-boot-process.html
Joachim Seemer b43891053d * Documented "type ahead" and the new function to Close All in Workspace (ALT+Q)
in tracker.html
* Documented PoorMan.
* Added yasm to the required packages when building Haiku under Linux
* changed every /boot/beos/ to /boot/system/


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30247 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-18 19:05:57 +00:00

72 lines
6.5 KiB
HTML

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"../html-dtd/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<!--
*
* Copyright 2009, Haiku. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Socapex_2K <philippe_groarke@yahoo.ca>
*
-->
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="robots" content="all" />
<title>The basic boot process</title>
<link rel="stylesheet" type="text/css" href="../../../Haiku-doc.css" />
</head>
<body>
<div class="logo">
<img src="../../images/logo.png" alt="logo" width="372" height="86" />
<div class="title">The basic boot process</div>
</div>
<div class="topnav">
<p>
<a href="../contents.html">Contents</a>
&#160;&#160;&#160;
Back to <a href="../installation.html">Installing Haiku</a>
</p>
</div>
<div class="content">
<h1>The BIOS</h1>
<p>When you turn on a <acronym title="Basic Input Output System">BIOS</acronym> based (as opposed to firmware based) system, which is still the most common today, the first thing loaded will be the BIOS. It is like a small operating system of its own and has the purpose of configuring the system hardware and provide an environment that a more high level operating system can work with. For example it configures PCI devices, harddrive controllers, USB, the processor itself and sets up ACPI tables in main memory.<br />
Current BIOSes are quite a bit more advanced than they were in the past, commonly having support for USB keyboards and USB mass storage to allow operating in so called legacy free configurations (i.e. without the old PS/2 input and maybe without some of the more traditional PC architecture components).<br />
OK, not going into more detail as that's not essential here.</p>
<p>So when the BIOS has done its job, it will try to find a <acronym title="Master Boot Record">MBR</acronym> on any of the harddisk-like medias or other boot method specific block on other media (El-Torito on CDs/DVDs for example). Something like a USB memory stick is regarded as being harddisk-like, because it really is emulating a SCSI harddisk to the system. When it finds a boot record, it then loads that into memory and instructs the CPU to start execution of the instructions present.</p>
<h1>The Master Boot Record</h1>
<p>Generally this is just the first block of any harddisk-like medium, usually 512 bytes in length. It contains boot code in the first part and the partition table at the end of the block. What you have there as boot code depends on what boot manager you have installed. You have either installed a boot manager explicitly, for example GRUB or BeOS' bootman, or it was implicitly installed for you when partitioning the device (during Windows setup for example).<br />
Boot managers range from totally simple ones that are just enough to find the partition marked active and jump to the partition boot code of said partition, to almost complete operating systems with editing capabilities and other fancy features.</p>
<h1>The Partition Boot Record</h1>
<p>Additionally to the Master Boot Record, there can also be a partition boot record. It's located at the start of a partition and contains further boot code. Depending on the boot manager you are using and how you configured it, this boot code will be executed or not. In the case of Haiku the partition boot code does locate the <span class="path">/boot/system/system/zbeos</span>" file which then starts the operating system boot process.<br /> Additionally it contains the partition offset needed to access this partition during boot. A wrong value for that offset is probably one of the most common reason why a Haiku installation doesn't start to boot.</p>
<p>As mentioned, whether or not the partition boot code is used depends on the boot manager and boot manager configuration. If you take GRUB installed as boot manager in the MBR and booting Linux. GRUB knows how to handle most Linux filesystems and it does know how to load and start a Linux kernel off of it. Therefore it can directly load Linux without the need for any additional boot code.<br />
However GRUB does neither know how to handle BFS and find the zbeos boot loader, nor would it really know how to execute it. Therefore you cannot use GRUB to directly boot Haiku.<br />
Instead you need to chainload the partition boot code of the BFS partition, as it knows how to handle both the BFS and zbeos.</p>
<h1>The Boot Loader</h1>
<p>After the boot loader (zbeos in case of BeOS/Haiku) has been found and loaded into memory, it is executed. The boot loader is the one providing you with the Haiku boot menu when pressing the space bar in early boot and is the one detecting basic system configuration. It also contains the logic to find and load the kernel (kernel_intel on BeOS and kernel_x86 on Haiku) as well as some boot modules required. Boot modules include the bus managers, bus and device drivers required by the kernel to successfully access the boot volume to load the rest of the modules and execute anything it needs to fully boot the system.<br />
If you boot to an ATA harddisk it would require for example the IDE or ATA bus manager, the harddisk controller driver and the helper modules used by them. Booting from USB would require the USB bus manager, the host controller drivers and the usb_disk driver for example. The boot loader also provides the kernel with configuration information and info about initial memory layout for example. This data passing between the boot loader and the kernel is specific to Haiku and the Haiku revision, it is possible that the information passed changes from one revision to another. This also makes it obvious that a zbeos from a BeOS installation cannot work with a Haiku kernel. Likewise using a BeOS bootfloppy that provides such a zbeos is not going to boot Haiku.</p>
<h1>The Kernel</h1>
<p>Once the kernel is loaded and starts executing it sets up a working environment. Memory management, bootstrapping and configuring non-boot CPUs, timers, interrupts, filesystems, module infrastructure, drivers... Everything that is needed for a fully working system and has not yet been loaded. Once this environment is set up, the kernel will start the bootscript, that then launches the different servers to provide a usable userland.</p>
</div>
<div class="bottomnav">
<p>
<a href="../contents.html">Contents</a>
&#160;&#160;&#160;
Back to <a href="../installation.html">Installing Haiku</a>
</p>
</div>
</body>
</html>