Christmas Project: Software-Implemented Virtual Computer

I'm always up to weird things, whether I tell it or not. This Christmas vacation, I plan to tackle a project that I have always wanted to do–create my own virtual computer architecture.

Now, this is just a plan, a plan that doesn't even have a certainty of completion. However, I've always wanted to build my own computer. By 'build', I didn't mean 'assemble'. I meant 'create' 😀

I know this will be a daunting task. I will have to invent my CPU architecture, the opcodes, the graphics adapter, the address mapping, even the BIOS, the drivers, the operating system, gosh, just thinking of all the things that I have to do is boggling my mind! Even though I said this is a Christmas project, I don't even believe I can finish this all during Christmas break, but I do expect that I will at least have a functional computer by the end of the year (goodbye, 2017!).

My final goal is basically to have an entire virtual computer. Like, imagine my own VirtualBox, running my self-made OS, with my own virtual CPU with my own instruction set, with my own virtual graphics adapter, heck, I will call the video standard KGS (Kyle's Graphics Standard) instead of VGA just for the sake of it! (Just kidding. But I will most probably reinvent VGA in my own style and name it something completely different.) There will be at least one native C++ compiler for my CPU architecture running natively, and a completely usable OS. I have majestic plans ahead.

That will be my end goal. But we all know I won't be able to finish that in time, we all know. So here's what I expect to finish before the year ends:

  1. The CPU architecture specification
  2. The CPU opcodes available
  3. The graphics adapter specification
  4. The cross-platform assembler program
  5. The input/output register mappings (but at first, I doubt I'll have even the most basic [virtual] hard drive controller, heck, not even a mouse controller, so when I said 'input/output', I meant keyboard only)
  6. The BIOS, including a basic ASCII font in ROM.
  7. and of course, the emulator for all that hardware.

What, no OS? Well, yeah, it's not like making an OS is easy! However, I plan to make simple program demos that can show the computer is working. Most computers of the past doesn't have an OS anyway. For example, the Nintendo Entertainment System is a fully capable computer, but it doesn't have an OS. All it needed to do is map the game cartridge to address space and start executing on that address. I plan to do the same with this computer on the very early stages, meaning, this month. There will be "cartridge image" files, and the "emulator" will provide options to choose the image file to load upon boot.

In the future, the emulator will have options to choose a CPU, a graphics adapter, other peripherals (such as hard disks connected via KSB (Kyle's Serial Bus–no Universal Serial Bus for you! Just kidding about the name 'KSB' though LOL ), hopefully a mouse, virtual audio hardware + controller, and of course, most importantly, a properly working and useable OS, together with development tools, such as an assembler, a compiler, a GUI windowing toolkit (I don't think I can make a multitasking OS, but we never know 😀 Besides, if I decide to support a multitasking OS, I may have to change the CPU architecture to support context switching, which I do not plan to support this year) but besides that, I have many other exciting things in store!

Funny thing is, this is a virtual machine, running on a virtual machine (of course, I'm making this in JavaFX!) so its performance will be far from your actual CPU speed, but why ask for more when the OS is simple enough to run on a 3MHz (virtual) CPU? Actually, I'd suggest you set the virtual CPU speed to about 500MHz so you can see the screen update pixel by pixel LOL

All joking aside, development will slow down considerably once work resumes, so don't expect miracles, but I do genuinely want to complete this project. It's one of my dreams.

I can't make any promises, but I really do want to at least have a working version before the year ends, so I hope my desire to finish this pushes me through, and makes me finish a working version by the end of the year.

Development will start as early as December 23, but depending on things (most importantly my mood and level of determination), development can start as late as Christmas day. And before you ask, yes, I have nothing better to do on Christmas day. Yay or nay? I don't know, but this is what I'm thinking: woe is me.

Previous Post Next Post