<aname="l1"></a><spanclass=cF5> Booting A PC</span><spanclass=cF0>
<aname="l2"></a>
<aname="l3"></a>ZealOS only supports traditional </span><spanclass=cF2>BIOS</span><spanclass=cF0> booting, not the newer technique, </span><spanclass=cF2>UEFI</span><spanclass=cF0>. This document describes </span><spanclass=cF2>BIOS</span><spanclass=cF0> booting.
<aname="l5"></a>When you turn-on (power-up) a computer or you do a hardware reset, the computer starts executing the </span><spanclass=cF2>BIOS</span><spanclass=cF0>. Sometimes, you must
<aname="l8"></a>The </span><spanclass=cF2>BIOS</span><spanclass=cF0> loads a boot sector from CD/DVD, hard disk or whatever. The boot sector runs in 16-bit real mode and often loads-in
<aname="l15"></a>operating system must load the rest of itself. With ZealOS, the </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/Kernel.html#l1"><spanclass=cF4>::/Kernel.BIN.C</span></a><spanclass=cF0> file is loaded by the boot sector. We try to
<aname="l16"></a>put a minimum in the </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/Kernel.html#l1"><spanclass=cF4>Kernel Module</span></a><spanclass=cF0>, so that it will always fit in 640K. When Kernel.BIN runs, it switches to 32-bit mode, then,
<aname="l17"></a>to 64-bit mode allowing access to more memory. Then, it loads in the rest of ZealOS by executing </span><ahref="https://tomawezome.github.io/ZealOS/StartOS.html#l1"><spanclass=cF4>::/StartOS.CC</span></a><spanclass=cF0>.
<aname="l22"></a></span><ahref="https://tomawezome.github.io/ZealOS/System/Boot/BootDVDIns.html#l1"><spanclass=cF4>BootDVDIns.CC</span></a><spanclass=cF0> Prep for CD/DVD install by creating </span><spanclass=cF2>/0000Boot/0000Kernel.BIN.C</span><spanclass=cF0>.
<aname="l23"></a>If you are curious about CD/DVDs, see </span><ahref="https://tomawezome.github.io/ZealOS/System/Boot/DiskISORedSea.html#l1"><spanclass=cF4>DiskISORedSea.CC</span></a><spanclass=cF0>. To make a custom bootable CD/DVD, look here </span><ahref="https://tomawezome.github.io/ZealOS/Misc/DoDistro.html#l1"><spanclass=cF4>Bootable CD</span></a><spanclass=cF0>.
<aname="l28"></a></span><spanclass=cF2>BootMHD</span><spanclass=cF0> goes on block zero. </span><spanclass=cF2>/0000Boot/BootMHD2.BIN.C</span><spanclass=cF0> is stored as a file in a partition, risky and unusual, since most master
<aname="l29"></a>boot loaders place stage 2 in a gap that's not in any partition. </span><spanclass=cF2>BootMHD2</span><spanclass=cF0> displays a menu and boots a partition.
<aname="l31"></a></span><ahref="https://tomawezome.github.io/ZealOS/System/Boot/BootHD.html#l1"><spanclass=cF4>BootHD.CC</span></a><spanclass=cF0> HD partition boot record.</span><spanclass=cF4>
<aname="l32"></a></span><ahref="https://tomawezome.github.io/ZealOS/System/Boot/BootHDIns.html#l1"><spanclass=cF4>BootHDIns.CC</span></a><spanclass=cF0> Installs HD partition boot record.
<aname="l33"></a></span><spanclass=cF2>BootHD</span><spanclass=cF0> is the boot record for a ZealOS partition. Each partition has its own partition boot record, the first block of the
<aname="l34"></a>partition.
<aname="l35"></a>
<aname="l36"></a>The boot records don't access directories because that would make them too big for one block and would make them depend on a
<aname="l37"></a>file system layout. Instead, they get patched with the LBA, logical block addresses, to load files. To update with a new
<aname="l38"></a>ZealOS kernel, you must create a </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/Kernel.html#l1"><spanclass=cF4>::/Kernel.BIN.C</span></a><spanclass=cF0> binary file and patch the boot loader so it knows the LBA blocks to load. Ther
<aname="l39"></a>efore, you usually recompile the kernel and update the boot sector at the same time with </span><ahref="https://tomawezome.github.io/ZealOS/System/Boot/BootHDIns.html#l24"><spanclass=cF4>BootHDIns</span></a><spanclass=cF0>(). </span><ahref="https://tomawezome.github.io/ZealOS/System/Boot/BootMHDIns.html#l76"><spanclass=cF4>BootMHDIns</span></a><spanclass=cF0>() will
<aname="l42"></a>With ZealOS, </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/Kernel.html#l1"><spanclass=cF4>::/Kernel.BIN.C</span></a><spanclass=cF0> loads </span><ahref="https://tomawezome.github.io/ZealOS/Compiler/Compiler.html#l1"><spanclass=cF4>::/Compiler/Compiler.BIN</span></a><spanclass=cF0> so it can work with source code from then on. It compiles start-up
<aname="l43"></a>scripts beginning with </span><ahref="https://tomawezome.github.io/ZealOS/StartOS.html#l1"><spanclass=cF4>::/StartOS.CC</span></a><spanclass=cF0> into the </span><ahref="https://tomawezome.github.io/ZealOS/Doc/Glossary.html#l154"><spanclass=cF4>System Task</span></a><spanclass=cF0>'s memory including the code in the </span><spanclass=cF2>/System</span><spanclass=cF0> and </span><spanclass=cF2>/Home</span><spanclass=cF0> directories.
<aname="l45"></a>It is possible to do a fast reboot without doing a hardware reset. You might do this when working on </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/Kernel.html#l1"><spanclass=cF4>::/Kernel.BIN.C</span></a><spanclass=cF0> or your
<aname="l46"></a>start-up scripts when you want to compile them effect. See </span><ahref="https://tomawezome.github.io/ZealOS/System/Boot/BootRAM.html#l33"><spanclass=cF4>BootRAM</span></a><spanclass=cF0>().