-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a070db
commit 1fe3d72
Showing
5 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
title: "Phase 1: Boot Process" | ||
description: Overview of the Bootloader boot process | ||
date: 2024-12-23 | ||
tags: | ||
- phase-1 | ||
- draft | ||
--- | ||
*[[Overview|Back to overview.]]* | ||
*[[Roadmap|Back to roadmap.]]* | ||
|
||
When a computer is turned on, the boot process has several stages to go through to prepare the system to run an operating system. This page is going to assume the system is booting in Legacy BIOS mode, not UEFI mode. | ||
|
||
The first stage in the boot process is the Power-On Self-Test. This is the process that tests the components, and looks for a bootable device. | ||
|
||
The BIOS then checks the bootable devices for the boot signature magic number. This is located in the first sector, and it has the byte sequence `0x55AA` at byte offsets 510 and 511. If the BIOS finds this boot sector, it loads it into memory. After its loaded, execution is then transferred to the boot record. On a floppy (which this system is intended to be run from at this current time) all 512 bytes can contain the executable code. | ||
|
||
Once the bootloader is loaded, it finds and loads the kernel into memory, and passes control to it. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
title: "Phase 1: Overview" | ||
description: Overview of the Bootloader phase | ||
date: 2024-12-23 | ||
tags: | ||
- phase-1 | ||
- draft | ||
--- | ||
*[[Roadmap|Back to roadmap.]]* | ||
|
||
The BIOS follows a simple [[Boot Process|boot process]] when a computer is turned on. Our job is to write the boot loader for the BIOS. It's responsible for loading the OS Kernel into memory. This phase focuses on understanding x86 real mode[^1] and transitioning into protected mode[^2]. | ||
|
||
##### Steps for the boot loader: | ||
|
||
- Load the kernel (and its dependencies) into memory | ||
- Provide the kernel with information about the system | ||
- Prepare the CPU and BIOS for the kernel | ||
- Transfer control to the kernel | ||
|
||
Since the bootloader is running in Real Mode, it has easy access to the BIOS. This is where steps like memory detection, file reading, video detection etc., should take place. Essentially, this prepares the system for Phase 2. | ||
|
||
[^1]: https://wiki.osdev.org/Real_Mode | ||
[^2]: https://wiki.osdev.org/Protected_Mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters