PC Mag, January 1989
It’s weird I was discussing putting this online in a more human readable format, and then  Jeff Parsons over at the incredible full system emulation in javascript site, pcjs.org just did it.
As you may or not be aware of, Microsoft hit it big as a computer languages company, before they added operating systems into it’s portfolio. And for some weird reason after the whole OS/2 divorce thing, someone decided that everything that had been painfully learned in the earlier eras should just be expunged from history. Which is a real shame to anyone interested in Basic, Fortran, Pascal, C and MASM. Years ago I had gone through the steps of extracting the text the only way I could figure out easily, by writing a simple TSR that would dump the contents of the text video buffer, and write it to a file, then press the page down key, and keep repeating the process. The end result being that I had then dumped the MSPL aka the Microsoft Programmer’s Library. I had put the text into an archive, aptly named Microsoft_Programmers_Library.7z, and pretty much used grep whenever I wanted any information, and left it at that..
It’s really cool to see it slowly transitioning to more useful information. You can read Jeff’s article Corporations Are Crappy Archivists about his quest for seemingly simple information about ancient Microsoft mice, and the archive of KB’s for Microsoft C.
One thing that is annoying is that information on CD from the late 1980’s seems to be darned near impossible to find. I know that each generation of machines until about 2005 was exponentially larger than the previous one (post 2007 we hit the iThing world, along with most machines being ‘good enough’ for day to day usage). I know this ad may seem insane, but Microsoft really was trying to push people to CD distributions. As we all know that internet thing didn’t quite tickle their fancy.  Did they ever put resources like this online? Like on BIX or Compuserve? It seems like an ideal resource. But I was a kid, and didn’t have that kind of money.
Awesome CD-ROM collection and drive, starting at a mere $899!
So in the interest of a bad idea, here is MSPL, aka qemu/curses in action.
Oh my god, what I have I done!?
Well as an addendum I thought it’d be cool to put MSPL online, via shellinabox. First off I needed a 5MB MS-DOS disk, basically enough MS-DOS too boot up, run smartdrive, idle and the CD-ROM driver, along with the minimal MSPL install. And to button it up, I added a reboot.com from the autoexec, so when you exit it’ll reboot the VM. Great.
The reboot command was input via debug, as it’ll let you assemble code directly. Although it isn’t a MACRO assembler, so you have to know exactly what you are doing.
DEBUG RESET.COM
A
XOR AX, AX
NOT AX
PUSH AX
NOT AX
PUSH AX
RETF
(return on a line by itself)
RCX
9
W
Q
And with that saved, now I have to setup Qemu. Since I’m taking the shellinabox approach that means I need something text mode, and I was thinking this was light weight. Qemu has a curses output so that’ll work. I set it up to use qcow2 and a backing store image so that way every forked user doesn’t eat 5MB of disk space, it’s more like 100kb.
#!/bin/sh
set -m
PID=$$
mkdir /tmp/$PID
cd /tmp/$PID
qemu-img create -f qcow2 -b /usr/local/mspl/MSPL.qcow2 MSPL.qcow2
qemu-system-i386 -m 4 -cpu 486 -hda MSPL.qcow2 -cdrom /usr/local/mspl/Microsoft-Programers-Library-v1.3.iso -curses -no-reboot
cd /tmp
rm -rf /tmp/$PID
Then to tie it into shell in a box, it’ll just need the flag:
-s /mspl:nobody:nogroup:/:/usr/local/bin/mspl.sh
and this will run it as nobody, and kick off the above bash script. Now that’s great and all, but what about stale/abandoned sessions? I wrote this quick script to clean them up.
#!/bin/bash
FIND=”find /tmp -type d -regextype sed -regex ‘.*/[0-9]*’ -mmin +30 | sed ‘s/\/tmp\///’>/tmp/kill_out.txt”
eval $FIND
while read process; do
KILL=”kill -9 ${process}”
eval $KILL
RMDIR=”rm -rf /tmp/${process}”
eval $RMDIR
done < /tmp/kill_out.txt
rm -rf /tmp/kill_out.txt
So it’ll find numerical directories that are at least 30 minutes old, kill them and remove their directory. Probably very dangerous to run, but it’s isolated so Im not too worried. Then just have root add that script to it’s crontab, and run it every minute, and it’ll kill the old stuff hanging around.
I’ll add a video later on how to use MSPL via this setup. And maybe I’ll rig something to have RDP access as well, depending on how I’m feeling.