xaizek / tos (License: GPLv3 only) (since 2018-12-07)
This is an alternative version of sources presented as part of Write Your Own OS video tutorial by Viktor Engelmann.
File Mode Size
src/ 040000
.gitignore 100644 17B
LICENSE 100644 34KiB
Makefile 100644 1,914B
README.md 100644 1,779B
hda 100644 68MiB
linker.ld 100644 435B


This is an alternative version of sources presented as part of Write Your Own OS video tutorial by Viktor Engelmann.

The sources were modified to be somewhat cleaner, more portable and with less bugs.

There are still many issues and limitations and a lot of things can be improved in the code base.

Makefile doesn't contain anything for VirtualBox and relies on qemu being available.

Differences from original

  • Use of C++11
  • Use of qemu (no iso images or grub is necessary)
  • Fixed invocation of constructors of global objects
  • Set alignment for multiboot header
  • Added dependency tracking to the Makefile
  • Flags and build target for running a debugger
  • Fixed various weird or incorrect things
  • Reduced number of UBs in the code (this results in more complicated and slow but more correct code; plus, it was quite fun to implement)
  • Cosmetic changes like consistent naming, no commented out code, etc
  • Make keyboard and mouse work at the same time
  • No include/ directory
  • No outermost namespace for everything (it's not a library after all)
  • Double buffering to avoid flickering of graphics


  • g++
  • GNU Make
  • qemu for i386

Trying it out

Starting the VM:

make run


make gdb

Testing network:

# start one of these before running the VM in a separate terminal
make udp-server
make tcp-server

# these can be run after VM has started (e.g. `make run; make udp-client`)
make udp-client
make tcp-client

# open in a browser

Possible additions/changes

  • Virtual memory
  • User-mode
  • SMP
  • USB
  • 64-bit mode
  • Syscalls using SYSENTER
  • Handle loopback in IP stack
  • Graceful shutdown (ACPI)
  • Support GPT




Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/tos

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/tos

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master