A few weeks back, “work” asked if I would be interested in hosting a webinar on GitHub and some of the dev tools in their stack.
Been that guy, I responded “of course”. The cool thing about this “project" or shall I say webinar, is that it ties in perfectly with my Project Genie.
Back in collage two of the courses that were part of the curriculum were MS-DOS 5 and QBasic, and just like that my age is given away...
Nibbles is a BASIC game program basically “Snake” and was included with MS-DOS 5 up to MS-DOS 6.22 and also a game we played a lot in class.
For this project I needed the source code, I could have searched the web for the code, but me being me, I wanted to source the original code, from the original media, being 2025 that was going to fun.
Back in the day I used to have a Microsoft TechNet subscription, and lucky enough I still have the MS-DOS 6.22 image files I created back then, digital hoarder I know.
If you need a copy of MS-DOS and found this blog post and for me to avoid the Microsoft legal team paying me a visit, I assume you know how to use a search engine.
Also note that the nibbles program file is on the MS-DOS 6.22 supplement disk.
Now how do I get this up and running with current technology and on M1?
MS-DOS 6.22 was written for x86 architecture, and Apple Silicon is based on ARM architecture.
In steps QEMU, QEMU is an emulator that allows you to run an operating system designed for one hardware architecture on a different, host architecture, I know I could of used UTM for macOS (QEMU backend) but wanted to go CLI vs GUI for this.
All the below steps are performed from the terminal.
Firstly, let’s install QEMU, for that we need to install Homebrew.
Here are the instructions to install Homebrew.
Now let’s install QEMU
% brew install qemu
Let me create a <projects> directory and create a <msdos> directory within it.
Note: you can create your own directories here but make sure you drop the MS-DOS files into your <msdos> directory.
I have done the below from my Home directory
% mkdir Projects
% cd Projects
% mkdir msdos
% cd msdos
Now let's create the virtual hard disk.
% qemu-img create –f qcow2 msdos.disk 128M
The above command creates a 128MB [128M] file named [msdos.disk] using QEMU’s second generation disk format [-f qcow2]
Let’s run QEMU using the above created disk.
% qemu-system-i386 –hda msdos.disk -m 64 –fda Disk1.img -boot a
The above command creates an 80386 CPU VM (x86 family) [qemu-system-i386], using msdos.disk as its first hard drive [–hda msdos.disk], the virtual machine will have 64MB of RAM [-m 64] and boot Disk1.img (first MS-DOS disk) in the first floppy disk drive [–fda Disk1.img -boot a]
Let the MS-DOS installation process begin -
MS-DOS 6.22 is now installed, now to get the nibbles.bas file. On the qemu-system-i386 system menu, select Machine, then select Change floppy0... point this to Disk4.img (supplement disk) and select Open.
Mission accomplished, you can now copy the file across and open it in your IDE of choice, mine for this project is Visual Studio Code (vscode).