CoreVM: Custom Architecture & Integrated Debugger

Building a from-scratch computer architecture and debugger in C++ to master low-level memory management.

Description

## Overview

CoreVM is a custom Virtual Machine (a "fantasy console") built entirely from scratch in C++. Instead of relying on existing frameworks, this project engineers a complete Instruction Set Architecture (ISA), a virtual memory map, and a custom CPU execution loop to deeply explore how software interacts with hardware at the lowest level.

Alongside the VM, I engineered an integrated User-Space Debugger that operates in "God Mode" over the virtual system, allowing for real-time memory inspection, execution stepping, and automated error catching.

## The Problem

Most high-level applications abstract away the complex reality of how memory is allocated and how the CPU processes binary instructions. I wanted to step away from standard CRUD apps and APIs to tackle a hardcore systems engineering challenge: building a computer inside a computer.

## The Approach

I designed the system using strict object-oriented C++ principles, focusing heavily on raw memory arrays and bitwise logic.

Key Technical Implementations:

* Custom ISA: Designed a unique hexadecimal instruction set (e.g., 0x01 for ADD, 0x02 for LOAD) that the virtual CPU fetches, decodes, and executes.

* Manual Memory Management: Implemented a 64KB virtual RAM array uint8_t memory[65536]), strictly managing how the CPU reads and writes to avoid virtual segmentation faults.

* Integrated Debugger: Built a stepping debugger that safely pauses the C++ execution loop. It dumps the current state of all CPU registers and prints real-time memory maps to the console, allowing developers to track memory leaks inside the VM.

* Error Catching: Engineered failsafes where the C++ host catches invalid memory access attempts by the virtual CPU and safely halts execution with detailed error logs, preventing host-system crashes.

## The Result

The result is a lightweight, blazing-fast virtual environment. This project serves as a comprehensive demonstration of low-level architecture, proving an advanced understanding of CPU cycles, pointers, bit-shifting, and safe memory manipulation in C++.

Issues & Pull Requests Thread
No issues or pull requests added.