This repository has been archived by the owner on Apr 7, 2022. It is now read-only.
-
-
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
Showing
1 changed file
with
13 additions
and
18 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,28 +1,23 @@ | ||
# RomainOS | ||
|
||
Une idée à la con mais vlà mon OS, from scratch, en 64 bits, à base d'assembleur et de C++ ! | ||
Here's a 64 bits OS, from scratch, using assembly and C++. | ||
|
||
<img src="https://image.noelshack.com/fichiers/2016/24/1466366192-risitas8.png" alt="Hard" /> <br> | ||
<sub><i>My face when j'ai découvert que c'était compliqué l'assembleur lol</i></sub> | ||
### How and why is it working | ||
|
||
### Comment que c'est fait tout ça | ||
When booting, the BIOS will load the first 512 bytes from the disk (aka the boot sector), defined in <code>src/bootSector/bootloader.asm</code>. | ||
|
||
Au moment du boot, le BIOS va load les 512 premiers bytes du disques (aka boot sector), définis dans <code>src/bootSector/bootloader.asm</code>. | ||
The bootloader, still in "real-mode" 16-bits, will then enter in "protected-mode" 32-bits using <code>src/secondSector/extendedProgram.asm</code>.<br> | ||
At this stage, the available memory is listed and well-structured,<br> | ||
there's no wrap-around at 1 MB (yeah this bug really haunted me, but the A20 line is finally enabled),<br> | ||
the interrupts are disabled, and there's a basic permission system applied, while still being limited at 4 GB. | ||
|
||
Le bootloader, alors encore en "real-mode" 16-bits, va ensuite entrer en "protected-mode" 32-bits via <code>src/secondSector/extendedProgram.asm</code>.<br> | ||
La mémoire utilisable est listée, la ligne A20 est activée (pour éviter un wrap-around à 1 Mo), les interruptions sont désactivées, | ||
la RAM est structurée et un système de permissions basique est appliqué (tout en restant limitée à 4 Go). | ||
Then, we continue up to 64-bits mode, handling a VGA display of 25x80 pixels (!).<br> | ||
CPU infos are availables, 64 bits int are usable, GDT goes on 64 bits and the RAM finally has paging. | ||
|
||
Puis le boot va continuer en mode 64-bits, gérant un affichage VGA 25x80.<br> | ||
Les informations du CPU sont accessibles, les long int (64 bits) sont activés, un paging de la RAM est effectué, et le GDT passe en 64 bits. | ||
Then, floating points operations inside the kernel are supported using SSE. | ||
|
||
Après ça, les SSE sont activés pour utiliser les nombres flottants dans le kernel. | ||
Last assembly trick, the function <code>_start</code> from <code>src/kernel.cpp</code> is called, finally loading the "true" C++ kernel. | ||
|
||
Pour finir en assembleur, la méthode <code>_start</code> de <code>src/kernel.cpp</code> est appelée, chargeant le kernel C++ à proprement parler. | ||
In C++ now, keyboards interrupts are initialized, and the available memory regions fetched. | ||
|
||
En C++ maintenant, le curseur est instancié, les interruptions clavier (IDT) initialisées, le layout du clavier set, | ||
et les régions utilisables en mémoire récupérées. | ||
|
||
Et après tout ça, le noyau est ready ! | ||
|
||
<img src="https://image.noelshack.com/fichiers/2018/18/5/1525431412-macron2.png" alt="Ready" /> | ||
And THEN, the kernel is ready ! |