• Please review our updated Terms and Rules here

Bootstrapping an IBM PC with only blank media and no tweener machine

bhtooefr

Experienced Member
Joined
Dec 9, 2008
Messages
165
Location
Newark, OH, USA
So, I've been thinking about how someone could bootstrap an early IBM PC with a 5.25" drive (so, 5150, 5160, 5155, 4860, and 5170) without using a tweener machine (to install the drive into), without installing a 3.5" drive, and with only blank media. A machine that comes with a 3.5" drive (of the machines relevant to this subforum, 5140, 8525, 8530, 8550, and 8560) won't need this, as a USB 3.5" drive is readily available and can be used to bootstrap them using a modern machine easily.

I'm inspired by the ADTPro project for Apple machines, which can bring an Apple II up from nothing using either audio (it loads ProDOS and the ADTPro client over the cassette interface) or serial (using the Apple II's console redirection, and ADTPro "types" ProDOS and the ADTPro client into the ROM monitor). It also supports entering a short assembly snippet into the Apple III ROM monitor (which doesn't support console redirection), to bootstrap that machine over serial as well.

All of these machines have Cassette BASIC in ROM, and will boot to it if there's no device available. Unfortunately, Cassette BASIC doesn't have any form of serial support - OPEN "COM... is only available in Disk and Advanced BASIC. And, console redirection wasn't a thing in the IBM ROM either. This provides two approaches to getting these machines bootstrapped.

The first approach is valid for the 5150 and 4860 - they have cassette interfaces, so audio bootstrapping is available as an option. Load the bootstrap program over cassette, run it, and it can load anything else (including disk images) over the cassette interface. RAM is a concern on an early (32k-64k on 16-64 board) or low-end late (64k on 64-256 board) 5150, or a low-end (64k) 4860, but as BASIC doesn't need to be running after the bootstrap program is running, it's not that big of a deal.

The second approach is more complicated due to the lack of console redirection or serial loading support in Cassette BASIC, and therefore requires a short stub loader to be typed in (ala ADTPro on an Apple III), but it's valid on all of the models as long as they've got an Async. Communications Adapter (or the Parallel/Serial adapter in a 5170). INT 14h is at least available, though, which would likely help shorten the stub loader code. Essentially, this will involve a typed stub loader, which then either directly loads everything else, or loads a more robust loader to load everything else.

Has anyone already done this (I haven't seen it if it has been done), and if not, is there interest in this?
 
What are you going to do with a 5150 without a diskette controller? If you've got the controller, then it's a simple matter to attach a 3.5" drive.
 
What if you don't have a 3.5" drive?

I am in a similar situation with my Kaypro II. "Why don't you just hook the 5-1/4" drive up to your modern PC and write a disk?" I don't have, nor want, a "modern PC". (At least, I do have one, but it's hidden away and only used via VNC).
 
The 5160 can load and run code through the keyboard port, but I don't remember if and how this routine can be invoked during sartup.

Otherwise, the universal way would be to make an expansion ROM that takes over conroll and boots the way you'd like. The expansion ROM boot code problably have to set up the keyboard and diskette interfaces as well, as these are after the expansion ROM calls in the original POST.
 
Right, that's the key - nowadays, it's very much possible that someone won't have an internal 3.5" drive lying around, or a suitable cable to connect to the disk controller (remember that the floppy cables that are common nowadays don't have an edge connector, just 34-pin IDC connectors).

There is less need for this than there is for ADTPro (because the Apple II and III native disk format is GCR, not MFM, and no PC can natively read or write this, without another floppy controller that does support GCR), but I'm wondering if it'd be useful.

I was lucky that my 5155 had a working hard drive with MS-DOS 5.00 on it, so I was able to get file transfers between it and a modern system without having to resort to buying floppies with DOS on them, or buying another cable to share a floppy drive. However, I could easily see a scenario where someone buys an early IBM PC, and then has no way to get things going without buying more hardware or some software. I'm just wondering how often that happens, really.
 
I think you miss my point.

What, exactly, are you going to do with a 5150 without a diskette controller? Yes, you can use an audio tape drive; preferably one where the drive can be stopped and started by the PC. If you don't want to use a real floppy drive, you can purchase a 3.5" Chinese drive emulator for about $20. Compared to what you've spent or will spend on the rest of the PC, that's chicken feed.

And yes, you can rig something up to use the built-in BASIC via a keyboard port to put anything you'd like into memory. But again--what's the point?

You may as well ask about running a PC without a monitor or keyboard. I'm sure it can be done, but why?
 
I thought this topic was about how the initial bootstrap was done for IBM to get DOS with floppy support onto the 5150 in the first place. I was looking at the early 86-DOS source code that has been released
and noticed in the file IO.ASM that 86-DOS was brought up on either Tarbell or Cromemco controllers on an S100 system? I may be way off, but I imagine they created the initial boot disk for the 5150 on
one of those systems? As Spock would say, fascinating ...

Larry G
 
What, exactly, are you going to do with a 5150 without a diskette controller?

Where did he ever say that the PC doesn't have a disk controller? It was clear to me that he was asking for a solution just like the Apple II series' ADTpro, where you can type a few lines of code into the system monitor, load the program via serial port, and then use it to format and transfer data to floppy disks.

To answer the question, I know that a copy of IBM Diagnostics on cassette exists; if you look around, you can find an MP3 of it which you can load into a 5150 using a direct audio connection to any audio playback device. But what I don't know is if the cassette version also has the ability to format disks, like the disk version has.
 
Right, that's the key - nowadays, it's very much possible that someone won't have an internal 3.5" drive lying around, or a suitable cable to connect to the disk controller (remember that the floppy cables that are common nowadays don't have an edge connector, just 34-pin IDC connectors).
I have some NOS old style floppy ribbon cables with both IDC & edge connectors at each position, i.e., A: and B: if anybody's in need of one.
 
If you've got a floppy controller, you can attach a cheap disk emulator to it--and boot whatever you want. You don't need a 'tweener; just a PC that can write a USB pen drive (seems not to be out of the question). Emulators are cheap--in some cases, cheaper than a real floppy drive--and they hold more. I don't consider the transition from edge connector to pin header to be insurmountable. Just take the existing floppy cable and crimp an IDC header onto it for the drive.

If you want to get the thing going through the keyboard port, you can grab a Maple mini ($4 shipped from China) or even one of the Arduino flavors and start coding. The thing's got a USB port; interfacing to a 5150 keyboard port should be easy as the I/O is 5V tolerant.
 
Correct, let's start with this configuration:
5150, 64k, CGA (that doesn't actually matter), monitor, disk controller, at least one 5.25" floppy drive, keyboard, async serial adapter.

Compare to this configuration of Apple II:
][+, 48k plus language card (total of 64k), monitor, Disk II card, at least one Disk II drive, Super Serial Card.

(The exact machine configs aren't actually important, other than that they both have enough RAM to meaningfully run an OS, and they have storage devices.)

Let's assume that we have a box of blank 5.25" floppies to go with either machine, but no other software. (Could be a thrift store purchase, a machine being thrown out and rescued, or an eBay purchase - plenty of reasons you'd get a machine but no software.)

For the ][+, I can connect an audio cable to my modern laptop's headphone jack, plug it into the ][+'s cassette in jack, install and launch ADTPro in audio mode on my modern laptop, send ProDOS, and type this on the ][+:
Code:
CALL -151
2000:xxxxR
2000G
Then send ADTPro, and type this:
Code:
800:xxxxR
800G
(all end addresses missing, as ADTPro prompts for this)

If I instead wanted to do serial, using a null modem cable, and assuming the Super Serial Card was in slot 2, it'd be something along the lines of:
Code:
IN#2
Ctrl-A, 14B
Then send ProDOS, then repeat and send ADTPro. (Actually, 14B might not be the exact command, but ADTPro tells you what to do there.)

Once that's done, you're in an environment where you can image disks. (Admittedly, serial would be a lot harder due to no support for automatically running from serial in the PC ROM, but you could do a relatively short INT 14h loader program instead.)

On the 5150, here's my options for getting DOS and any other software over, assuming I have a modern laptop or desktop, and I don't have a stash of newer retro hardware, right now:

Buy a 3.5" floppy drive and a cable to connect it to the floppy controller, and a USB 3.5" drive
Buy a retro machine with a 5.25" floppy drive, as a tweener
Buy a floppy with PC-DOS or MS-DOS on it already, then I can use serial to transfer things (still a bit of a pain and requires multiple stages of loaders to do it stably from my experience)
Buy some sort of mass storage device and image that using a modern machine (but, unless it's a floppy emulator, it won't be bootable)

I mean, I personally actually do have a stash of newer retro hardware, although I'm not actually sure I've got enough to connect a 3.5" drive to an old PC, or a 5.25" drive to a newer machine. But, that's beside the point - I have the tools I need to do this other ways (my 5155 has ethernet, so it can be a tweener for anything I'd want to do with early PCs, even).
 
I think one of those floppy emulators would be an easier option, they connect to the ribbon cable like a normal drive would and allow you to use USB drives or SD cards. They even have selection buttons so you can load up as many images as you want.
 
Cassette Basic has BSAVE/BLOAD, CALL and USR functions that should be able to load bootstrap functionality. Someone would have to write the machine language code for the bootstrap that would be BSAVEd and possibly a second BSAVE containing a memory representation of a minimal disk image. Lots of work and probably would need tweaks for each PC BIOS variation.
 
I thought ROM BASIC wouldn't do disk I/O natively. You'd have to call the BIOS routines directly.
 
I forgot that the IBM PC has BIOS routines in ROM for that, and was thinking that you'd have to load part of DOS to do that, actually - at least enough to get a RWTS (in Apple terminology). But, INT 13h is a RWTS!
 
This is not necessarily along the lines of what the OP was looking for, but then again maybe it is.

I think lines got crossed. A pc w/o a disk drive at all is essentially a doorstop. Why bother with a "modern" 16 bit pc when you can bootstrap a PDP-8e via the toggle switches? Any number of early, albeit historic, but useless bit bangers where booted just that way. But I digress. I guess.

Anyhoo, wow, this was a while back, I'd have to go over my archives. But a certain bloke in the Philadelphia area named Jonathan (I could take a jab at his last name from memory, and it just might be spot on, but being unwilling to offend...) managed to create a boot disk for the Victor 9000 from images scarfed from the that internet thing and a blank floppy disk. I said to myself, and him, there would seem to have to be a way to do it. And he fenagled the solution. He deserves at least 90% of the credit :)

You see you vanilla peecee guys are just getting around to this stuff. We (lol) have been doing it for years. These off the wall pc's demand all sorts of improvisation, overcoming, and adapting.

This k/b thing I didn't know a thing about. Does it require buffer overruns LOL? I once suggested that it should be possible to get an 8048 to cough up it's firmware code. I wasn't and am still not sure what made me think that. But it's at least good to know that there's more then one invaluable use for the venerable old keyboard port.
 
I thought ROM BASIC wouldn't do disk I/O natively. You'd have to call the BIOS routines directly.

You can change segments and load primitive code into memory. Getting it to execute is another matter. It's been a long time since I played w/that gunk. USR and CALL allow direct entry of assembler mnemonics, not sure if cartridge BASIC supported it though.
 
Look at the original IBM PC user's manual. There, a floppy is considered an option. You've got BASIC in ROM, up to 64KB of RAM; all you need is an audio recorder (and cable, available from Radio Shack) and you're in business. At least that was the theory.

You're forgetting the unpopulated ROM socket. Tuck your bootstrap in an EPROM, stick it in there, bring up BASIC, use a SYSTEM statement and Bob's your uncle.
 
SYSTEM does not exist in cassette BASIC. Instead, DEF SEG followed by CALL would need to be used. The OP should examine Appendix C of the BASIC reference for examples.
 
I have thought that using the cassette port to bootstrap an IBM PC or IBM PCjr is not a bad idea, especially if you want to write disk images without a disk drive emulator or tweener system to get up and running quickly. As someone else has commented, it a goal is to essentially be "IDTpro" (IBM Disk Transfer). Of course, for the IBM PC and PCjr, you need custom cassette cables :)
 
Back
Top