CURRENT STATE
I'm currently in the middle of finishing the proper implementation of interrupts and the IDT.
At this point, the OS will simply just boot up, load its GDT, and that's it.
Once I complete interrupts, much more will be available in a short-time after.
This is a simple operating system written in Assembly and C/C++, derived from a combination of official manuals, reference web sites, YouTube videos, and online lectures.
My intent is to help break barriers down for developers coming from managed object-oriented languages and to also promote my own self-learning. My hope is that it will be helpful to others to at least learn bits and pieces about what happens down near the bare-metal and what's going on inside of our computers or anything with a microprocessor inside of it.
Please see the Source and Reference Materials section for a boat-load of links to supporting materials and information. Whenever you're at a loss, sift through the links and you should find answers or starting points to find them.
Having written software for a long time, but more-so at the high-level (web apps, web forms, PHP, etc.) I finally got frustrated not understanding the low-level functions of an OS and wanted to be able to troubleshoot much more precisely. So what better way than to understand what happens under all the higher-level stuff you work in on a daily basis? This applies to all sorts of fields as well! (IoT, Mobile, Embedded Systems, Security, etc)
- Understanding of compiling software at a bare minimum
- Understanding of binary calculations and hi/low bits
- Understanding of Assembly and C/C++
- *nix Distribution that can run the gnu compiler and tools
- Most importantly...Patience. YOU are the OS, so it takes a lot of time to get things working correctly sometimes.
One of my goals while working on this project is to do as much as possible with free tools and my existing hardware / operating system. That said, my configuration might be a little strange to some, but it's what I feel like rolling with and is comfortable for me personally. I like the flexibility of having both Operating Systems and their corresponding tools and environments both readily available. Like a lot of people, I need to have Windows as my main OS for a lot of games I play.
- Windows 10 Home/Professional - OS on my main machine
- Google Chrome - Main browser on my main machine
- Oracle VM Virtual Box - HyperVisor so we can run Linux for the dev machine
- Linux Mint 18.1 - Guest OS where development and debugging tools live
- Visual Studio Code - Main IDE and development tools
- Build tools, GRUB, and other dev-related libraries and programs
- Linux Mint 18.1 - Guest OS where development and debugging tools live
Note: I tried getting this to work in Bash on Ubuntu on Windows - Beta, but due to a limitation accessing the network stack, I was unable to proceed. I will revisit this setup later on if they decide to expose more inside that feature.
- Download and install Oracle VM Virtual Box
- Download the Linux Mint 18.1 ISO
- Open up Oracle VM Virtual Box and create a new Ubuntu (64-bit) Linux Virtual Machine (VM) with a 20GB hard drive and whatever memory you feel like allocating
- Go into the VM settings and under General - Advanced set the Shared Clipboard to Bidirectional
- Go to the Storage area of the VM settings and set the CDROM to point to the Linux Mint 18.1 ISO file downloaded earlier
- Start the VM and the Linux Mint ISO should boot up to a LIVE (in memory) version
- When you get to the desktop, double-click on Install Linux Mint
- Just install it using all the defaults, that will suffice for our purposes
- Open a Terminal window up (Ctrl+Alt+T)
- Run the following commands:
sudo apt-get update
sudo apt-get --yes upgrade
- Note: If the upgrade process gets hung-up, just restart the machine and re-open a Terminal, then run:
sudo dpkg --configure -a
- Note: If the upgrade process gets hung-up, just restart the machine and re-open a Terminal, then run:
sudo apt-get install git
sudo apt-get install g++ binutils libc6-dev-i386 grub xorriso
shutdown -r now
(just for good measure)
- Open another Terminal after restart and run:
sudo apt-get install --yes git g++ binutils libc6-dev-i386 grub xorriso qemu-system-x86-64
mkdir ~/Development
git clone https://github.com/Tri4ce/cppOS.git ~/Development/cppOS
- Download and install Visual Studio Code
- Open Visual Studio Code
- Click File, click Open Folder..., pick the /Development/cppOS folder we cloned into earlier.
This project utilizes a Makefile to quickly compile, debug, run, and package the OS code and binaries. This section is an overview of each target available in the Makefile.
Runs the g++
and as
compilers against source to generate objects, followed by running ld
to link them and create a cppOS.bin file.
Calls qemu-system-x86_64 -kernel cppOS.bin -s -S &
to start cppOS in debug mode and then remotely attaches with gdb pointing to the working directory for symbols.
Calls qemu-system-x86_64
with the -kernel flag, passing it the cppOS.bin file to use as the kernel.
Generates a bootable ISO image of cppOS by calling grub-mkrescue
and providing the cppOS.bin and Multiboot v1 entries for the GRUB Bootloader to see the OS.
Copies the cppOS.bin generated from the default make target to the /boot directory. Use this if you want to try rebooting and pointing to your own kernel when you hit GRUB.
Removes all files generated by any of the make targets.
- Asm Debugging with GDB
- GNU make
- Linux x86 Program Start Up
- OSDev Wiki - Multiboot
- Multiboot Specification - multiboot.h
- Hexspeak - Wikipedia
- Assembly Basic Syntax
- Using as - Assembler Directives
- Assembly Programming Tutorial
git clone https://github.com/volatilityfoundation/volatility.git
cd ~/Development/volatility
git checkout 2.6
apt-get install build-essential dwarfdump