Way, way back in time, when floppy disks still existed and even were kind of popular (who can believe it), there existed a program named Teledisk. What it did was quite simple: take an image from a floppy disk, compress it and annotate it. This allows you to make perfect low-level copies of a disk and, for example, store these on your hard drive if you had such luxury. The image is just a file you can do with as you please. You could then copy the image back to a disk of the same size to have your disk back. However, as times evolved, we kind of quit using floppies, and Teledisk went the way of the dodo. But if you happen to have a game that is packed in a file with extension
.TLD or something like that, you might want to play it again in these modern days. Here is a guide that might help you do it. It is not an easy guide since it features the command line (oh no) and you’ll need a bit of general computer knowledge to get it working. But that doesn’t scare us, does it?
Apart from computer knowledge, we will need:
- a copy of
teledisk.exe. I don’t know about the copyright status on this, but try not to break the law.
- Bochs, a free x86 emulation tool (in case you have no idea what that means… this is one hardcore tool).
- a copy of DOS. Of this I do know the copyright status, Microsoft is still pretty much alive so again, don’t break the law here. FreeDOS or something similar might work, I haven’t tried it.
- A way to manipulate FAT disk images
- I used mtools, a free toolset to manipulate FAT disk images, on my Linux computer. If you are on a decent Linux distro, this is probably in you package manager or even already installed.
- on Windows you’ll have less luck with mtools. Ben Lunt has compiled versions but these did not work on my Windows 7 64-bit machine. I couldn’t get them to compile either (missing headers) but I didn’t try very hard. Let me know if you tried mtools on Windows and how you did it.
- I have also heard ImDisk is an alternative to mtools, allowing you to use images as real disks. You might give that a whirl if you don’t feel like command-lining today.
As a little aside, if you couldn’t gather these, there might be another course of action if you want to read and experiment a lot. Will Kranz has a page documenting the Teledisk file format and there is some code and binaries available. I didn’t want to figure it all out though, but it might be an interesting project to do more research on this. If you manage to get a useful program out of this that works on recent versions of Windows or Linux, let me know and I’ll add you a million times to this page, because that’s what you deserve.
Anyway. Our course of attack will be pretty straightforward: we will get DOS running on Bochs, then load up Teledisk, copy the Teledisk image to a Bochs image, then either play in Bochs or get the files from the image and into DOSBox or your favorite other way to play those games. Allons-y!
First things first, download and install Bochs. If you are on Linux, see your package manager. If you are on Windows, I guess you are able to do this yourself. Make sure to associate
.bxrc files with Bochs, it’ll make your life easier.
I suggest you create a new folder where you will do all work in from now on. You’ll create a number of files and you want them together. I’ll name this folder
ovovivipary because it’s a cool word. I hope you have a better naming system on your computer though.
We will start with adding a Bochs configuration file to
ovovivipary, name it
bochsrc.bxrc. This will allow you to quickly boot the virtual machine by just double-clicking this file. Mucho awesomeness. A fully-documented sample configuration file comes with Bochs, but if you want to you can simply take over mine, below. We’ll need to edit this file a few times so keep your favorite text editor (I suggest Notepad++ on Windows, though notepad should do) around.
megs: 32 romimage: file=$BXSHARE/BIOS-bochs-latest vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest vga: extension=vbe log: bochsout.txt mouse: enabled=0 cpu: ips=15000000 vga_update_interval: 150000
Next step is to create a hard disk for our virtual machine we’ll be running. We’ll use the
bximage tool for this that comes with Bochs. Just run it and answer its questions. If you don’t know what kind of image to choose, go with flat file. 10 MB should be enough, but you can go for a bigger HD if you want to. I’ll name it
c.img like proposed, that will be useful to keep it right in our head. Windows Vista/7 users take care: if you execute
bximage from the start menu, it’ll try to dump the created image in the “Program Files” folder, where it probably has no writing permissions. Copy the program to
ovovivipary and run it there, or go find the image in the depths of AppData\VirtualStore and copy that to
ovovivipary, your call. BTW, if the file name of the image is blue in Windows Explorer, this is because the file is compressed: open the file properties, and check “size on disk”. Since the file exists of only nulls (byte value 0), Windows decides it can just store the attributes of the file, but doesn’t need all those zeros. Smart eh? You need not worry about this, the file can be used like any other file.
c.img was generated,
bximage printed a line starting with
ata0-master: to add to your configuration file. So do that now. It’ll make Bochs recognize the hard drive which is always useful.
Now that we have a virgin hard disk for our virtual system, let’s install DOS on it! We will need to boot our virtual machine from the DOS install floppy disks to do this. Good thing I had images of those around… Copy the images to
ovovivipary and add the following lines to your bochsrc.bxrc:
floppya: 1_44=dosdisk1.img, status=inserted boot: a
dosdisk1.img is the name of the first disk. Now we are ready to run our virtual machine! Exciting, isn’t it? Just double-click the
bochsrc.bxrc file and off we go. What should happen is that the machine boots from the floppy image, the DOS install program asks you to format your hard drive and then starts installing DOS on it. If it asks you to change disks, you can click the little disk marked A: in the top left corner, then load the second image, and let the installer continue.
At the end of the installation, the installer asks you to remove all disks from your computer and it’ll then reboot and restart. Well, this will not work because we still have only the floppy registered as our only boot device. So since the installation is finished now anyway, kill the simulation (Bochs might appear to hang but just close it), edit the configuration file to say
boot: c instead of
boot: a, and then restart the virtual machine.
You should have DOS running now. If you got this far, pat yourself on the back and grab a fresh drink. It’s time to get to serious business.
We have DOS inside our virtual machine, and we have the Teledisk files outside the virtual machine. We need to get them inside the machine. As said before, I used mtools on a Linux box for this, but there are probably a dozen other ways of which probably a dozen are actually better. Please leave a comment if you can offer a better way!
Okay, so what we’re going to do here is that we will totally bypass DOS and that virtual machine business, and sneak some data on the HD image without it ever going to stop us. Sounds totally cyberpunkish and it’s totally awesome to do too. Let’s start by gathering all files we need together in one folder – for me that meant copying a bit of stuff between machines. The files we’ll need are the disk image c.img, the Teledisk executable teledisk.exe and the Teledisk game images, which I’ll assume is just one file game.td0. We’ll then inject the files on the disk image with the following commands:
mcopy -i c.img ./game.td0 :: mcopy -i c.img ./teledisk.exe ::
The “::” means the following. mtools uses the DOS convention of naming a path by <drive>:<path>, for example C:\DOS means the \DOS path on the C drive. To name an image file as the drive, mtools uses a colon as identifier. So “::” means the root of the disk image specified by the -i switch.
Get your specially constructed c.img back to ovovivipary and restart the virtual machine. Check if your files are there with the dir command. You can do some tidying if you want the files in their own directory, like me. I’ll put them in a folder called meiosis. By the way, I totally don’t like biology, biology students are all treehuggers without a life. At least I, as a computer science student, have a blog, a virtual machine and a life!
We can now almost run teledisk.exe and get our game unpacked! We first need something to unpack the game to. A floppy disk image! So go create one with the bximage tool. Now, there’s one catch here. Since the Teledisk images are images of a floppy on a pretty low level, we will need to get the exact right type of floppy, up to the number of sectors, tracks and all that hardware stuff. Fortunately, there are only a few categories possible as presented to you by the sizes in the bximage tool. Unfortunately, due to the compression used in the Teledisk image file, it’s not always possible to know what size of floppy you will need. Teledisk will tell you, but only once you have actually started writing. How very inconvenient. Still, not much you can do about it. Try to guess the correct size from the size of the Teledisk image file and create a new image. I’d suggest naming it a.img, and remember to add the line bximage tells you to add to the configuration file. You’ll also have to remove the line you added to make it load the DOS install disks, but I think you can figure that out.
If you have a candidate image ready in ovovivipary and set up in the bocshrc.bxrc file, we can start the virtual machine again. cd to meiosis and start teledisk.exe!
After some fancy introduction, choose “Copy File to Disk”. Teledisk will ask you which disk you want to copy to, so select A: since that’s where you mounted your disk image. Then either type game.td0 or hit return to select the file from a list. Teledisk will read the file and might show a window with the comments stored in the file. After that, it’ll start writing the files to the disk! Yay!
If there is a mismatch between the required disk size and the provided image, Bochs will complain heavily because Teledisk requested a non-existent sector or whatever. Take this as a cue you need to adjust the disk image. At this point, Teledisk will show you want kind of disk you need. If your knowledge of ancient data carriers isn’t complete, you might need to google a bit to find out what exact size conforms to what Teledisk message.
Sometimes, Teledisk might make a mistake, giving you errors as if a wrong type of image was used, but in the middle of writing. This might signify data corruption, or it might be totally harmless, I have no idea. You can try to continue the simulation in the Bochs window, after which Teledisk also figures out something went wrong so you can just continue there, too. Keep in mind that the end result you get from it might not be what you wanted though.
Okay, so right now you have a plain disk image of the game! You can now try to get the files back out of the image with mtools or similar, but this might not work for all games. The point of disk images is that there might be data on the disk that is not in the file system. Some games are really hardcore like that. But in that case, you can take a look at the IMGMOUNT command of DOSBox (although I don’t know whether it’ll be sufficient) or you can try playing the game in Bochs. You might need to dig around some more in the bochsrc.bxrc file in that case to make sure you emulate hardware the game will support.
Whatever you want to do next, it should be no big deal compared to the skills you just displayed in rescuing your data. Enjoy your game!