<commit_before># (Very) Basic Operating System in C++

[![Code Now](https://friendco.de/widgets/image/codenow?url=https%3A%2F%2Fgithub.com%2FSamyPesse%2Fdevos.git&file=&style=vertical&private=true&create=false&prepare=true)](https://friendco.de/widgets/url/codenow?url=https%3A%2F%2Fgithub.com%2FSamyPesse%2Fdevos.git&file=&style=vertical&private=true&create=false&prepare=true)

This code was written several years ago as one of my first projects when I was in High School so it's normal if some parts of the code looks like "crap".

But some parts of the code are usefull to learn how to create a bootable operating system with memory pagination, multitasking, virtual memory, EXT2, ...


## Features :

	* Code in C++
	* x86 32bits
	* Boot with Grub
	* Kind of modular system for drivers (I was in High school so it's not really great)
	* Kind of UNIX style (again: It's not great)
	* Multitasking
	* ELF executable in userland
	* Modules (accessible in userland using /dev/...) :
		* IDE disks
		* DOS partitions
		* Clock
		* EXT2 (read only)
		* Boch VBE


## Build & Run using Vagrant (for OS X and Linux users)

Make sure you have both Vagrant installed and this repo cloned (and an open terminal in it's folder)

Then run the following commands (ignore comment lines sarting with ```#```):

```bash
# Starts Vagrant VM
# This will start an ubuntu machine and install build-essential, make, Qemu ...
vagrant up

# SSH into machine
vagrant ssh

# Once SSHed
cd /vagrant

# Build kernel, userland ...
make all

# Go to SDK
cd ./sdk

# Build Disk image (requires old grub)
bash ./diskimage.sh
<commit_msg>Add sudo to disk image command<commit_after># (Very) Basic Operating System in C++

[![Code Now](https://friendco.de/widgets/image/codenow?url=https%3A%2F%2Fgithub.com%2FSamyPesse%2Fdevos.git&file=&style=vertical&private=true&create=false&prepare=true)](https://friendco.de/widgets/url/codenow?url=https%3A%2F%2Fgithub.com%2FSamyPesse%2Fdevos.git&file=&style=vertical&private=true&create=false&prepare=true)

This code was written several years ago as one of my first projects when I was in High School so it's normal if some parts of the code looks like "crap".

But some parts of the code are usefull to learn how to create a bootable operating system with memory pagination, multitasking, virtual memory, EXT2, ...


## Features :

	* Code in C++
	* x86 32bits
	* Boot with Grub
	* Kind of modular system for drivers (I was in High school so it's not really great)
	* Kind of UNIX style (again: It's not great)
	* Multitasking
	* ELF executable in userland
	* Modules (accessible in userland using /dev/...) :
		* IDE disks
		* DOS partitions
		* Clock
		* EXT2 (read only)
		* Boch VBE


## Build & Run using Vagrant (for OS X and Linux users)

Make sure you have both Vagrant installed and this repo cloned (and an open terminal in it's folder)

Then run the following commands (ignore comment lines sarting with ```#```):

```bash
# Starts Vagrant VM
# This will start an ubuntu machine and install build-essential, make, Qemu ...
vagrant up

# SSH into machine
vagrant ssh

# Once SSHed
cd /vagrant

# Build kernel, userland ...
make all

# Go to SDK
cd ./sdk

# Build Disk image (requires old grub)
sudo bash ./diskimage.sh

{'fraction_non_alphanumeric': 0.09932140653917335, 'fraction_numerical': 0.00987045033929673, 'mean_word_length': 4.325123152709359, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '392784', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1038, 'n_words': 406}