Skip to content

Commit

Permalink
Quartz sync: Dec 23, 2024, 2:06 AM
Browse files Browse the repository at this point in the history
  • Loading branch information
FloofyPlasma committed Dec 23, 2024
1 parent 9a070db commit 1fe3d72
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 4 deletions.
File renamed without changes.
19 changes: 19 additions & 0 deletions content/Phase 1/Boot Process.md
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.

23 changes: 23 additions & 0 deletions content/Phase 1/Overview.md
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
9 changes: 7 additions & 2 deletions content/Roadmap.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

---
title: Roadmap
description: The roadmap plans for my OS project.
Expand All @@ -7,8 +6,9 @@ tags:
- roadmap
- draft
---

##### **Phase 1: Bootloader**

*[[Overview|Main Page]]*
1. Learn the Basics of [Real Mode](https://wiki.osdev.org/Real_Mode):
- Understand [BIOS interrupts](https://wiki.osdev.org/BIOS#BIOS_functions) (e.g., `int 13h` for disk I/O, `int 10h` for display).
- Study x86 assembly for 16-bit real mode.
Expand All @@ -24,6 +24,7 @@ tags:
- Setup the Global Descriptor Table ([GDT](https://wiki.osdev.org/Global_Descriptor_Table)).

##### **Phase 2: Kernel Basics**

1. Set Up the Kernel Environment:
- Write the kernel entry point in assembly.
- Switch to C for higher-level kernel development.
Expand All @@ -36,6 +37,7 @@ tags:
- Write interrupt handlers for keyboard input and timer.

##### **Phase 3: Device Drivers**

1. Keyboard Input:
- Write a driver to capture [keyboard](https://wiki.osdev.org/PS/2_Keyboard) input.
- Display typed characters on the screen.
Expand All @@ -47,6 +49,7 @@ tags:
- Display mouse movements on the screen.

##### **Phase 4: Userland and File System**

1. Develop a [Simple CLI](https://wiki.osdev.org/Command_Line):
- Allow basic user commands (e.g., "help", "reboot").
- Handle I/O efficiently.
Expand All @@ -55,6 +58,7 @@ tags:
- Add support for reading files from disk.

##### **Phase 5: Advanced Features**

1. [Multi-tasking](https://wiki.osdev.org/Kernel_Multitasking):
- Learn about process management and [context switching](https://wiki.osdev.org/Context_Switching).
- Implement a [basic scheduler](https://wiki.osdev.org/Processes_and_Threads).
Expand All @@ -65,6 +69,7 @@ tags:
- Implement basic [networking](https://wiki.osdev.org/Network_Stack) capabilities.

##### **Phase 6: Refine and Expand**

1. Polish the OS:
- Optimize performance and memory usage.
- Refactor code for modularity.
Expand Down
14 changes: 12 additions & 2 deletions content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ description: The main page for my OS project.
date: 2024-12-22
tags:
---
This project is plans for an operating system developed as a learning tool to explore the principles of OS design and implementation. The initial focus is on understanding the boot process, kernel development, and basic hardware interaction. It will start as a theoretical idea, move onto a toy project, and possibly evolve into a more advanced system in the future.

I'll write a better homepage eventually...
See the [[Roadmap]] for more information.
- ##### Goals:
- Understand low-level system programming
- Explore the x86 architecture and possibly x86_64.
- Implement essential OS features such as keyboard input, display output and basic memory management.


You can see more detailed information in the [[Roadmap|roadmap]].

# Disclaimer

These notes are **heavily** based on the OSDev wiki, and the information on them will most definitely be more technical than my notes. My notes are mostly intended to write down things of importance for me to remember when designing certain elements of the OS. You can find the OSDev Wiki [here](https://wiki.osdev.org/Expanded_Main_Page).

0 comments on commit 1fe3d72

Please sign in to comment.